Browse Source

Added test image & test method

pull/1766/head
Gerard Gunnewijk 5 years ago
parent
commit
f7bc8d7747
  1. 4
      ImageSharp.sln
  2. 18
      tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs
  3. 3
      tests/ImageSharp.Tests/TestImages.cs
  4. 3
      tests/Images/Input/Png/issues/Issue_1765.png

4
ImageSharp.sln

@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.28902.138 VisualStudioVersion = 17.0.31710.8
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject

18
tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs

@ -368,6 +368,24 @@ namespace SixLabors.ImageSharp.Tests.Formats.Png
Assert.Null(ex); Assert.Null(ex);
} }
// https://github.com/SixLabors/ImageSharp/issues/1765
[Theory]
[WithFile(TestImages.Png.Issue1765, PixelTypes.Rgba32)]
public void Issue1765<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
System.Exception ex = Record.Exception(
() =>
{
using (Image<TPixel> image = provider.GetImage(PngDecoder))
{
image.DebugSave(provider);
image.CompareToOriginal(provider, ImageComparer.Exact);
}
});
Assert.Null(ex);
}
// https://github.com/SixLabors/ImageSharp/issues/410 // https://github.com/SixLabors/ImageSharp/issues/410
[Theory] [Theory]
[WithFile(TestImages.Png.Bad.Issue410_MalformedApplePng, PixelTypes.Rgba32)] [WithFile(TestImages.Png.Bad.Issue410_MalformedApplePng, PixelTypes.Rgba32)]

3
tests/ImageSharp.Tests/TestImages.cs

@ -111,6 +111,9 @@ namespace SixLabors.ImageSharp.Tests
// Issue 935: https://github.com/SixLabors/ImageSharp/issues/935 // Issue 935: https://github.com/SixLabors/ImageSharp/issues/935
public const string Issue935 = "Png/issues/Issue_935.png"; public const string Issue935 = "Png/issues/Issue_935.png";
// Issue 1765: https://github.com/SixLabors/ImageSharp/issues/1765
public const string Issue1765 = "png/issues/Issue_1765.png";
public static class Bad public static class Bad
{ {
public const string MissingDataChunk = "Png/xdtn0g01.png"; public const string MissingDataChunk = "Png/xdtn0g01.png";

3
tests/Images/Input/Png/issues/Issue_1765.png

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