Commit 8a24b6aa2 for imagemagick.org
commit 8a24b6aa26bfd57ebb2185d215cebf47fa7d505c
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Mon May 11 19:28:33 2026 +0200
Added extra conditions for when ReadGenericMethod should be used when reading a jpeg compressed tiff file (dlemstra/Magick.NET/issues/2016)
diff --git a/coders/tiff.c b/coders/tiff.c
index ccdfe0788..ba79c1c26 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -1744,7 +1744,9 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
{
if (photometric == PHOTOMETRIC_SEPARATED)
method=GetJPEGMethod(image,tiff,photometric,bits_per_sample);
- else if (method != ReadStripMethod)
+ else if ((method != ReadStripMethod) ||
+ (compress_tag == COMPRESSION_OJPEG) ||
+ (photometric == PHOTOMETRIC_YCBCR))
method=ReadGenericMethod;
}
#if defined(WORDS_BIGENDIAN)