better tiled tiff detection

for tiffs with mixed strip and tile images
This commit is contained in:
John Cupitt 2020-05-29 18:30:49 +01:00
parent dc29f8dde6
commit f0d4b36d7d

View File

@ -637,9 +637,9 @@ rtiff_set_page( Rtiff *rtiff, int page )
rtiff->subifd >= subifd_count ) { rtiff->subifd >= subifd_count ) {
vips_error( "tiff2vips", vips_error( "tiff2vips",
_( "subifd %d out of range, " _( "subifd %d out of range, "
"only %d available" ), "only 0-%d available" ),
rtiff->subifd, rtiff->subifd,
subifd_count ); subifd_count - 1 );
return( -1 ); return( -1 );
} }
@ -2422,8 +2422,11 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
} }
/* Tiles and strip images have slightly different fields. /* Tiles and strip images have slightly different fields.
*
* We can't use TIFFIsTiled() since some TIFFs have a mix of tiled and
* stip layouts. Test for TILEWIDTH in this directory.
*/ */
header->tiled = TIFFIsTiled( rtiff->tiff ); header->tiled = tfexists( rtiff->tiff, TIFFTAG_TILEWIDTH );
if( header->tiled ) { if( header->tiled ) {
if( !tfget32( rtiff->tiff, if( !tfget32( rtiff->tiff,