Browse Source

Add YCCK test

pull/2922/head
James Jackson-South 1 year ago
parent
commit
b860f550ae
  1. 15
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  2. 1
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_YCCK_ICC_Jpeg_Rgba32_issue_2723.png
  4. 3
      tests/Images/Input/Jpg/icc-profiles/issue_2723.jpg

15
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

@ -380,6 +380,21 @@ public partial class JpegDecoderTests
image.CompareToReferenceOutput(provider);
}
[Theory]
[WithFile(TestImages.Jpeg.ICC.YCCK, PixelTypes.Rgba32)]
public void Decode_YCCK_ICC_Jpeg<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
JpegDecoderOptions options = new()
{
GeneralOptions = new() { ColorProfileHandling = ColorProfileHandling.Convert }
};
using Image<TPixel> image = provider.GetImage(JpegDecoder.Instance, options);
image.DebugSave(provider);
image.CompareToReferenceOutput(provider);
}
[Theory]
[WithFile(TestImages.Jpeg.ICC.SRgb, PixelTypes.Rgba32)]
[WithFile(TestImages.Jpeg.ICC.AdobeRgb, PixelTypes.Rgba32)]

1
tests/ImageSharp.Tests/TestImages.cs

@ -212,6 +212,7 @@ public static class TestImages
public const string WideRGB = "Jpg/icc-profiles/Momiji-WideRGB-yes.jpg";
public const string AppleRGB = "Jpg/icc-profiles/Momiji-AppleRGB-yes.jpg";
public const string CMYK = "Jpg/icc-profiles/issue-129.jpg";
public const string YCCK = "Jpg/icc-profiles/issue_2723.jpg";
}
public static class Progressive

3
tests/Images/External/ReferenceOutput/JpegDecoderTests/Decode_YCCK_ICC_Jpeg_Rgba32_issue_2723.png

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cef85199e8560d6669766c094d078831024e44ac7fc537f8696f802c8e06138b
size 420141

3
tests/Images/Input/Jpg/icc-profiles/issue_2723.jpg

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56dc6400d8f4c42c505ec562e4ade0b23e613b2c16e1666eccbbaa8e997efcc7
size 766523
Loading…
Cancel
Save