From ff4b67b642a59f589bc2392a39e3804fbb19a076 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 7 Nov 2007 23:41:08 +0000 Subject: [PATCH] stuff --- include/vips/threadgroup.h | 2 ++ libsrc/iofuncs/im_generate.c | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/include/vips/threadgroup.h b/include/vips/threadgroup.h index e27b59b1..8912e04a 100644 --- a/include/vips/threadgroup.h +++ b/include/vips/threadgroup.h @@ -98,6 +98,8 @@ typedef struct im__threadgroup_t { #endif /*DEBUG_HIGHWATER*/ int kill; /* Set this to stop threadgroup early */ + + int progress; /* Set this to get eval progress feedback */ } im_threadgroup_t; void im_concurrency_set( int concurrency ); diff --git a/libsrc/iofuncs/im_generate.c b/libsrc/iofuncs/im_generate.c index 1148c92a..57e4fb7d 100644 --- a/libsrc/iofuncs/im_generate.c +++ b/libsrc/iofuncs/im_generate.c @@ -253,10 +253,6 @@ eval_to_region( REGION *or, im_threadgroup_t *tg ) thr->y = clipped.top; im_threadgroup_trigger( thr ); - /* Trigger any eval callbacks on our source image. - */ - im__handle_eval( tg->im, tg->pw, tg->ph ); - /* Check for errors. */ if( im_threadgroup_iserror( tg ) ) { @@ -316,7 +312,7 @@ eval_to_memory( im_threadgroup_t *tg, REGION *or ) pos.left = 0; pos.top = y; pos.width = im->Xsize; - pos.height = chunk; + pos.height = IM_MIN( chunk, im->Ysize - y ); if( (result = im_region_image( or, &pos )) ) break; @@ -325,6 +321,11 @@ eval_to_memory( im_threadgroup_t *tg, REGION *or ) if( (result = eval_to_region( or, tg )) ) break; + /* Trigger any eval callbacks on our source image. + */ + if( (result = im__handle_eval( im, pos.width, pos.height )) ) + break; + #ifdef DEBUG_IO ntiles++; #endif /*DEBUG_IO*/