small fix to openexr load
This commit is contained in:
parent
8d6f90c060
commit
7d69f6bc84
@ -226,7 +226,11 @@ read_header( Read *read, VipsImage *out )
|
||||
VIPS_FORMAT_FLOAT,
|
||||
VIPS_CODING_NONE, VIPS_INTERPRETATION_scRGB, 1.0, 1.0 );
|
||||
if( read->tiles )
|
||||
vips_image_pipelinev( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL );
|
||||
/* Even though this is a tiled reader, we hint thinstrip
|
||||
* since with the cache we are quite happy serving that if
|
||||
* anything downstream would like it.
|
||||
*/
|
||||
vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL );
|
||||
else
|
||||
vips_image_pipelinev( out, VIPS_DEMAND_STYLE_FATSTRIP, NULL );
|
||||
}
|
||||
@ -363,7 +367,8 @@ vips__openexr_read( const char *filename, VipsImage *out )
|
||||
VipsImage *raw;
|
||||
VipsImage *t;
|
||||
|
||||
/* Tile cache: keep enough for two complete rows of tiles.
|
||||
/* Tile cache: keep enough for two complete rows of tiles,
|
||||
* plus 50%.
|
||||
*/
|
||||
raw = vips_image_new();
|
||||
vips_object_local( out, raw );
|
||||
@ -375,14 +380,11 @@ vips__openexr_read( const char *filename, VipsImage *out )
|
||||
read, NULL ) )
|
||||
return( -1 );
|
||||
|
||||
/* Copy to out, adding a cache. Enough tiles for a complete
|
||||
* row, plus 50%.
|
||||
*/
|
||||
if( vips_tilecache( raw, &t,
|
||||
"tile_width", read->tile_width,
|
||||
"tile_height", read->tile_height,
|
||||
"max_tiles", (int)
|
||||
(1.5 * (1 + raw->Xsize / read->tile_width)),
|
||||
(2.5 * (1 + raw->Xsize / read->tile_width)),
|
||||
NULL ) )
|
||||
return( -1 );
|
||||
if( vips_image_write( t, out ) ) {
|
||||
|
@ -92,7 +92,7 @@ G_STMT_START { \
|
||||
(void) g_once( ONCE, FUNC, CLIENT ); \
|
||||
} G_STMT_END
|
||||
|
||||
/* VIPS_RINT() does "bankers rounding", it rounds to the nerarest even integer.
|
||||
/* VIPS_RINT() does "bankers rounding", it rounds to the nearest even integer.
|
||||
* For things like image geometry, we want strict nearest int.
|
||||
*
|
||||
* If you know it's unsigned, _UINT is a little faster.
|
||||
|
Loading…
Reference in New Issue
Block a user