From fa4b80b74b1c0612a7dac9493aaee491509351a5 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 21 Sep 2022 11:48:48 +0100 Subject: [PATCH] earlier quit of dzsave on kill We were only testing "killed" once for each strip of tiles. Check on each tile as well to make set_kill() faster. see https://github.com/kleisauke/net-vips/issues/179 --- ChangeLog | 1 + libvips/foreign/dzsave.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9a043a0b..a80f9711 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ - fix 8 bit pallete PNG save [lovell] - fix null string in buffer print [pclewis] - revise caching of seq mode loaders [jcupitt] +- reduce latency on dzsave kill [kleisauke] 24/7/22 started 8.13.1 - fix im7 feature detection in meson diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c index 61821120..5b3fd713 100644 --- a/libvips/foreign/dzsave.c +++ b/libvips/foreign/dzsave.c @@ -1828,6 +1828,12 @@ strip_work( VipsThreadState *state, void *a ) printf( "strip_work\n" ); #endif /*DEBUG_VERBOSE*/ + /* killed is checked by sink_disc, but that's only once per strip, and + * they can be huge. Check per output tile as well. + */ + if( vips_image_iskilled( save->in ) ) + return( -1 ); + /* If we are centering we may be outside the real pixels. Skip in * this case, and the viewer will display blank.png for us. */