fix vips_image_write() for non "p" sources

oops!
This commit is contained in:
John Cupitt 2013-06-06 14:43:52 +01:00
parent bd5c4757e8
commit 697555962a
2 changed files with 8 additions and 7 deletions

View File

@ -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,

View File

@ -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;