From 8a24b6aa26bfd57ebb2185d215cebf47fa7d505c Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 11 May 2026 19:28:33 +0200 Subject: [PATCH] Added extra conditions for when ReadGenericMethod should be used when reading a jpeg compressed tiff file (dlemstra/Magick.NET/issues/2016) --- coders/tiff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coders/tiff.c b/coders/tiff.c index ccdfe07882..ba79c1c267 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)