Browse Source

Add test

pull/2594/head
James Jackson-South 2 years ago
parent
commit
2200ac2b3c
  1. 11
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  2. 1
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Jpg/issues/issue2517-bad-d7.jpg

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

@ -353,4 +353,15 @@ public partial class JpegDecoderTests
Assert.Equal(65503, image.Width);
Assert.Equal(65503, image.Height);
}
// https://github.com/SixLabors/ImageSharp/issues/2517
[Theory]
[WithFile(TestImages.Jpeg.Issues.Issue2517, PixelTypes.Rgba32)]
public void Issue2517_DecodeWorks<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using Image<TPixel> image = provider.GetImage(JpegDecoder.Instance);
image.DebugSave(provider);
image.CompareToOriginal(provider);
}
}

1
tests/ImageSharp.Tests/TestImages.cs

@ -307,6 +307,7 @@ public static class TestImages
public const string Issue2478_JFXX = "Jpg/issues/issue-2478-jfxx.jpg";
public const string Issue2564 = "Jpg/issues/issue-2564.jpg";
public const string HangBadScan = "Jpg/issues/Hang_C438A851.jpg";
public const string Issue2517 = "Jpg/issues/issue2517-bad-d7.jpg";
public static class Fuzz
{

3
tests/Images/Input/Jpg/issues/issue2517-bad-d7.jpg

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