From 697555962ae9bd5f524a23fbb76b9eabe8a31ceb Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 6 Jun 2013 14:43:52 +0100 Subject: [PATCH] fix vips_image_write() for non "p" sources oops! --- libvips/iofuncs/image.c | 12 ++++++------ libvips/iofuncs/sinkscreen.c | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c index 2f06db84..46b58d46 100644 --- a/libvips/iofuncs/image.c +++ b/libvips/iofuncs/image.c @@ -2,6 +2,8 @@ * * 4/2/11 * - hacked up from various places + * 6/6/13 + * - vips_image_write() didn't ref non-partial sources */ /* @@ -1754,13 +1756,11 @@ vips_image_write( VipsImage *image, VipsImage *out ) vips_demand_hint( out, VIPS_DEMAND_STYLE_THINSTRIP, image, NULL ); - /* If this will be a delayed calculation we need to keep @image - * around for as long as @out is about. + /* We generate from @image partially, so we need to keep it about as + * long as @out is about. */ - if( vips_image_ispartial( image ) ) { - g_object_ref( image ); - vips_object_local( out, image ); - } + g_object_ref( image ); + vips_object_local( out, image ); if( vips_image_generate( out, vips_start_one, vips_image_write_gen, vips_stop_one, diff --git a/libvips/iofuncs/sinkscreen.c b/libvips/iofuncs/sinkscreen.c index 6ae08172..4e91f9ef 100644 --- a/libvips/iofuncs/sinkscreen.c +++ b/libvips/iofuncs/sinkscreen.c @@ -418,7 +418,8 @@ render_work( VipsThreadState *state, void *a ) if( vips_region_prepare_to( state->reg, tile->region, &tile->area, tile->area.left, tile->area.top ) ) { VIPS_DEBUG_MSG_RED( "render_work: " - "vips_region_prepare_to() failed\n" ); + "vips_region_prepare_to() failed: %s\n", + vips_error_buffer() ); return( -1 ); } tile->painted = TRUE;