lock progress to 100% on posteval

Because signals can be delayed, progress isn't always 100% in posteval.
Lock it to 100%.

See https://github.com/libvips/libvips/issues/2820
This commit is contained in:
John Cupitt 2022-05-23 19:27:40 +01:00
parent a9bfd508f5
commit 111eef0049

View File

@ -1582,11 +1582,26 @@ vips_image_posteval( VipsImage *image )
{
if( image->progress_signal &&
image->progress_signal->time ) {
gint64 processed;
VIPS_DEBUG_MSG( "vips_image_posteval: %p\n", image );
g_assert( vips_object_sanity(
VIPS_OBJECT( image->progress_signal ) ) );
/* Make sure posteval sees a finished progress.
*/
processed = image->time->tpels;
vips_progress_update( image->time, processed );
/* For vips7 compat, update the ->time on the signalling image
* too, even though it may have a different width/height to
* the image we are actually generating.
*/
if( image->progress_signal->time != image->time )
vips_progress_update( image->progress_signal->time,
processed );
if( !vips_image_get_typeof( image, "hide-progress" ) )
g_signal_emit( image->progress_signal,
vips_image_signals[SIG_POSTEVAL], 0,