Skip to content

Commit

Permalink
Merge branch '8.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcupitt committed Apr 19, 2019
2 parents 56e5e3c + 6acfcb0 commit 5301df3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libvips/foreign/tiff2vips.c
Expand Up @@ -1763,7 +1763,8 @@ rtiff_strip_read_interleaved( Rtiff *rtiff, tstrip_t strip, tdata_t buf )
if( rtiff->header.separate ) {
int page_width = rtiff->header.width;
int page_height = rtiff->header.height;
int strips_per_plane = 1 + (page_height - 1) / read_rows_per_strip;
int strips_per_plane = 1 + (page_height - 1) /
read_rows_per_strip;
int strip_height = VIPS_MIN( read_rows_per_strip,
page_height - strip_y );
int pels_per_strip = page_width * strip_height;
Expand Down Expand Up @@ -2173,9 +2174,15 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
*
* Don't do this in plane-separate mode. TIFFReadScanline() is
* too fiddly to use in this case.
*
* Don't try scanline reading for YCbCr images.
* TIFFScanlineSize() will not work in this case due to
* chroma subsampling.
*/
if( header->rows_per_strip > 128 &&
!header->separate ) {
!header->separate &&
header->photometric_interpretation !=
PHOTOMETRIC_YCBCR ) {
header->read_scanlinewise = TRUE;
header->read_rows_per_strip = 1;
header->read_strip_size =
Expand Down

0 comments on commit 5301df3

Please sign in to comment.