From 12764053db05ec4c8aa6ed7a7c0a46dbaf56c344 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 20 Jun 2015 11:23:13 +0100 Subject: [PATCH 1/2] note bug --- TODO | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index a95734c8..929b20bb 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,11 @@ -- vips_sink_screen() should create its output images +- try: + $ python test_colour.py TestColour.test_icc + Segmentation fault (core dumped) + + C stack overflow, related to the progress changes? + +- vips_sink_screen() should create its output images - how about something like vips_grid() which turns a tall thin one-band image into a much smaller many-band image? From 7077356496e76021075b16fe35ab72d5992a4677 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 21 Jun 2015 19:28:10 +0100 Subject: [PATCH 2/2] another try at improving progress feedback --- TODO | 8 -------- libvips/foreign/foreign.c | 36 +++--------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/TODO b/TODO index 929b20bb..0a4d59de 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,3 @@ -- try: - - $ python test_colour.py TestColour.test_icc - Segmentation fault (core dumped) - - C stack overflow, related to the progress changes? - -- vips_sink_screen() should create its output images - how about something like vips_grid() which turns a tall thin one-band image into a much smaller many-band image? diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c index 29a92a00..37f77d52 100644 --- a/libvips/foreign/foreign.c +++ b/libvips/foreign/foreign.c @@ -760,31 +760,6 @@ vips_foreign_load_iscompat( VipsImage *a, VipsImage *b ) return( TRUE ); } -/* Forward pre-eval-post signals to our output image so our caller can see - * progress for load via disc or memory. - */ - -static void -vips_foreign_load_preeval( VipsImage *image, - VipsProgress *progress, VipsForeignLoad *load ) -{ - vips_image_preeval( load->out ); -} - -static void -vips_foreign_load_eval( VipsImage *image, - VipsProgress *progress, VipsForeignLoad *load ) -{ - vips_image_eval( load->out, progress->npels ); -} - -static void -vips_foreign_load_posteval( VipsImage *image, - VipsProgress *progress, VipsForeignLoad *load ) -{ - vips_image_posteval( load->out ); -} - /* Our start function ... do the lazy open, if necessary, and return a region * on the new image. */ @@ -806,15 +781,9 @@ vips_foreign_load_start( VipsImage *out, void *a, void *b ) * will finish with load->real holding the decompressed image. * * We want our caller to be able to see this computation on - * @out, so we need to forward the signals. + * @out, so eval signals on ->real need to appear on ->out. */ - g_signal_connect( load->real, "preeval", - G_CALLBACK( vips_foreign_load_preeval ), load ); - g_signal_connect( load->real, "eval", - G_CALLBACK( vips_foreign_load_eval ), load ); - g_signal_connect( load->real, "posteval", - G_CALLBACK( vips_foreign_load_posteval ), load ); - vips_image_set_progress( load->real, TRUE ); + load->real->progress_signal = load->out; if( class->load( load ) || vips_image_pio_input( load->real ) ) @@ -835,6 +804,7 @@ vips_foreign_load_start( VipsImage *out, void *a, void *b ) */ vips_image_pipelinev( load->out, load->out->dhint, load->real, NULL ); + } return( vips_region_new( load->real ) );