openexr shut down early

for non-tiled images anyway
This commit is contained in:
John Cupitt 2018-08-19 05:30:49 +01:00
parent a0c8417109
commit b92c55770f
2 changed files with 18 additions and 3 deletions

View File

@ -14,6 +14,8 @@
* - redo as a set of fns ready for wrapping in a new-style class * - redo as a set of fns ready for wrapping in a new-style class
* 17/9/16 * 17/9/16
* - tag output as scRGB * - tag output as scRGB
* 16/8/18
* - shut down the input file as soon as we can [kleisauke]
*/ */
/* /*
@ -121,13 +123,19 @@ get_imf_error( void )
vips_error( "exr2vips", _( "EXR error: %s" ), ImfErrorMessage() ); vips_error( "exr2vips", _( "EXR error: %s" ), ImfErrorMessage() );
} }
static void
read_close( Read *read )
{
VIPS_FREEF( ImfCloseTiledInputFile, read->tiles );
VIPS_FREEF( ImfCloseInputFile, read->lines );
}
static void static void
read_destroy( VipsImage *out, Read *read ) read_destroy( VipsImage *out, Read *read )
{ {
VIPS_FREE( read->filename ); VIPS_FREE( read->filename );
VIPS_FREEF( ImfCloseTiledInputFile, read->tiles ); read_close( read );
VIPS_FREEF( ImfCloseInputFile, read->lines );
vips_free( read ); vips_free( read );
} }
@ -329,6 +337,11 @@ vips__openexr_generate( VipsRegion *out,
} }
} }
/* We can't shut down the input file early for tile read, even if we
* know load is in sequential mode, since we are not inside a
* vips_sequential() and requests are not guaranteed to be in order.
*/
return( 0 ); return( 0 );
} }
@ -408,6 +421,8 @@ vips__openexr_read( const char *filename, VipsImage *out )
(VipsPel *) vips_buffer ) ) (VipsPel *) vips_buffer ) )
return( -1 ); return( -1 );
} }
read_close( read );
} }
return( 0 ); return( 0 );

View File

@ -1632,7 +1632,7 @@ rtiff_fill_region( VipsRegion *out,
/* We can't shut down the input file early for tile read, even if we /* We can't shut down the input file early for tile read, even if we
* know load is in sequential mode, since we are not inside a * know load is in sequential mode, since we are not inside a
* vips_sequential() and requests are not guarateed to be in order. * vips_sequential() and requests are not guaranteed to be in order.
*/ */
return( 0 ); return( 0 );