From bd4620f04e3c4909d82a4a5e5248065c49982d56 Mon Sep 17 00:00:00 2001 From: Evgeny Talanin Date: Thu, 11 Oct 2012 14:38:25 +0400 Subject: [PATCH] #2408 patch apply (see pull request at https://github.com/Itseez/opencv/pull/33) --- modules/highgui/src/grfmt_tiff.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/grfmt_tiff.cpp b/modules/highgui/src/grfmt_tiff.cpp index dfca4525f8..d2321ceb5e 100644 --- a/modules/highgui/src/grfmt_tiff.cpp +++ b/modules/highgui/src/grfmt_tiff.cpp @@ -197,12 +197,14 @@ bool TiffDecoder::readData( Mat& img ) } } - if( (!is_tiled && - TIFFGetField( tif, TIFFTAG_ROWSPERSTRIP, &tile_height0 )) || + if( (!is_tiled) || (is_tiled && TIFFGetField( tif, TIFFTAG_TILEWIDTH, &tile_width0 ) && TIFFGetField( tif, TIFFTAG_TILELENGTH, &tile_height0 ))) { + if(!is_tiled) + TIFFGetField( tif, TIFFTAG_ROWSPERSTRIP, &tile_height0 ); + if( tile_width0 <= 0 ) tile_width0 = m_width;