diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs index 0c35008658..8ba76193c5 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs @@ -25,6 +25,7 @@ public class TiffDecoderTests : TiffDecoderBaseTester [Theory] [WithFile(MultiframeDifferentSize, PixelTypes.Rgba32)] [WithFile(MultiframeDifferentVariants, PixelTypes.Rgba32)] + [WithFile(Cmyk64BitDeflate, PixelTypes.Rgba32)] public void ThrowsNotSupported(TestImageProvider provider) where TPixel : unmanaged, IPixel => Assert.Throws(() => provider.GetImage(TiffDecoder.Instance)); diff --git a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs index 0c6cdbc207..40346cdd89 100644 --- a/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs +++ b/tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs @@ -110,8 +110,10 @@ public class TiffMetadataTests } [Theory] - [InlineData(Cmyk, 1, TiffPhotometricInterpretation.Separated, TiffInkSet.Cmyk)] - public void Identify_Frames(string imagePath, int framesCount, TiffPhotometricInterpretation photometric, TiffInkSet? inkSet) + [InlineData(Cmyk, 1, TiffBitsPerPixel.Bit32, TiffPhotometricInterpretation.Separated, TiffInkSet.Cmyk)] + [InlineData(Cmyk64BitDeflate, 1, 64, TiffPhotometricInterpretation.Separated, TiffInkSet.Cmyk)] + [InlineData(YCbCrJpegCompressed, 1, TiffBitsPerPixel.Bit24, TiffPhotometricInterpretation.YCbCr, null)] + public void Identify_Frames(string imagePath, int framesCount, TiffBitsPerPixel bitsPerPixel, TiffPhotometricInterpretation photometric, TiffInkSet? inkSet) { TestFile testFile = TestFile.Create(imagePath); using MemoryStream stream = new(testFile.Bytes, false); @@ -127,6 +129,7 @@ public class TiffMetadataTests foreach (ImageFrameMetadata metadata in imageInfo.FrameMetadataCollection) { TiffFrameMetadata tiffFrameMetadata = metadata.GetTiffMetadata(); + Assert.Equal(bitsPerPixel, tiffFrameMetadata.BitsPerPixel); Assert.Equal(photometric, tiffFrameMetadata.PhotometricInterpretation); Assert.Equal(inkSet, tiffFrameMetadata.InkSet); } diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index 7c383d389d..2dd1ca71c2 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -762,6 +762,7 @@ public static class TestImages public const string Benchmark_RgbLzw = "medium_rgb_lzw.tiff"; public const string Benchmark_RgbPackbits = "medium_rgb_packbits.tiff"; public const string Benchmark_RgbUncompressed = "medium_rgb_uncompressed.tiff"; + public const string Benchmark_CmykUncompressed = "medium_cmyk_uncompressed.tiff"; public const string Calliphora_GrayscaleUncompressed = "Tiff/Calliphora_grayscale_uncompressed.tiff"; public const string Calliphora_GrayscaleDeflate_Predictor = "Tiff/Calliphora_gray_deflate_predictor.tiff"; @@ -957,6 +958,7 @@ public static class TestImages public const string CieLabLzwPredictor = "Tiff/CieLab_lzwcompressed_predictor.tiff"; public const string Cmyk = "Tiff/Cmyk.tiff"; + public const string Cmyk64BitDeflate = "Tiff/cmyk_deflate_64bit.tiff"; public const string Issues1716Rgb161616BitLittleEndian = "Tiff/Issues/Issue1716.tiff"; public const string Issues1891 = "Tiff/Issues/Issue1891.tiff"; diff --git a/tests/Images/Input/Tiff/cmyk_deflate_64bit.tiff b/tests/Images/Input/Tiff/cmyk_deflate_64bit.tiff new file mode 100644 index 0000000000..f267c5e152 --- /dev/null +++ b/tests/Images/Input/Tiff/cmyk_deflate_64bit.tiff @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45793bfd1c9e92910b5b38805499859c38bb2fa1a2ae0c22888c16cc88b25d23 +size 53002