From caed71af04cce001917ad68ee556a687af35baf8 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Fri, 16 Dec 2022 11:32:16 +0000 Subject: [PATCH] emit "finish" at the end of targetcustom write In 8.13 we deprecated target_finish() (it did not have an error return) to target_end() (now has an error return). This PR makes target_end() also emit the "finish" signal for compatibility with the previous API. ruby-vips, for example, looks for on_finish() to close files. See https://github.com/libvips/ruby-vips/issues/351 Thanks lucaskanashiro --- ChangeLog | 1 + libvips/iofuncs/targetcustom.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index d832f022..c268e79d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 9/11/22 started 8.13.4 - missing include in mosaic_fuzzer [ServOKio] +- emit "finish" at the end of targetcustom write [lucaskanashiro] 11/10/22 started 8.13.3 - improve rules for 16-bit heifsave [johntrunc] diff --git a/libvips/iofuncs/targetcustom.c b/libvips/iofuncs/targetcustom.c index 603422d5..82237458 100644 --- a/libvips/iofuncs/targetcustom.c +++ b/libvips/iofuncs/targetcustom.c @@ -161,6 +161,11 @@ vips_target_custom_end_real( VipsTarget *target ) VIPS_DEBUG_MSG( "vips_target_custom_end_real:\n" ); + /* For compatibility with oklder libvipses, we have to emit "finish" + * as well. ruby-vips relies on this. + */ + g_signal_emit( target, vips_target_custom_signals[SIG_FINISH], 0 ); + /* Return value if no attached handler. */ result = 0;