Skip to content

Commit 14ced6f

Browse files
committed
Set YcbcrSubSampling to 1, 1 with jpeg compression and PhotometricInterpretation YCbCr
1 parent 7e7c795 commit 14ced6f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,12 @@ private static void ParseCompression(this TiffDecoderCore options, TiffCompressi
628628
options.ColorType = TiffColorType.Rgb;
629629
}
630630

631+
if (options.PhotometricInterpretation is TiffPhotometricInterpretation.YCbCr)
632+
{
633+
options.YcbcrSubSampling[0] = 1;
634+
options.YcbcrSubSampling[1] = 1;
635+
}
636+
631637
break;
632638
}
633639

@@ -642,6 +648,12 @@ private static void ParseCompression(this TiffDecoderCore options, TiffCompressi
642648
options.ColorType = TiffColorType.Rgb;
643649
}
644650

651+
if (options.PhotometricInterpretation is TiffPhotometricInterpretation.YCbCr)
652+
{
653+
options.YcbcrSubSampling[0] = 1;
654+
options.YcbcrSubSampling[1] = 1;
655+
}
656+
645657
break;
646658
}
647659

0 commit comments

Comments
 (0)