Browse Source

introduced test for #178

pull/322/head
Anton Firszov 9 years ago
parent
commit
b18cbb408e
  1. 9
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  2. 4
      tests/ImageSharp.Tests/TestImages.cs
  3. BIN
      tests/Images/Input/Jpg/issues/Issue178Lemon-ProgressiveWithTooManyCoefficients.jpg

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

@ -36,13 +36,16 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
TestImages.Jpeg.Baseline.Jpeg420Small,
TestImages.Jpeg.Baseline.Jpeg444,
TestImages.Jpeg.Baseline.Bad.BadEOF,
TestImages.Jpeg.Baseline.Bad.ExifUndefType
TestImages.Jpeg.Baseline.Bad.ExifUndefType,
};
public static string[] ProgressiveTestJpegs =
{
TestImages.Jpeg.Progressive.Fb, TestImages.Jpeg.Progressive.Progress,
TestImages.Jpeg.Progressive.Festzug, TestImages.Jpeg.Progressive.Bad.BadEOF
TestImages.Jpeg.Progressive.Festzug, TestImages.Jpeg.Progressive.Bad.BadEOF,
TestImages.Jpeg.Issues.ProgressiveWithTooManyCoefficients178
};
public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.RgbaVector;
@ -136,7 +139,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
}
[Theory]
[WithFile(TestImages.Jpeg.Issues.Issue214CriticalEOF, PixelTypes.Rgba32)]
[WithFile(TestImages.Jpeg.Issues.CriticalEOF214, PixelTypes.Rgba32)]
public void DecodeBaselineJpeg_CriticalEOF_ShouldThrow_Orig<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{

4
tests/ImageSharp.Tests/TestImages.cs

@ -114,9 +114,9 @@ namespace SixLabors.ImageSharp.Tests
public class Issues
{
public const string Issue214CriticalEOF = "Jpg/issues/Issue214-CriticalEOF .jpg";
public const string CriticalEOF214 = "Jpg/issues/Issue214-CriticalEOF.jpg";
public const string Issue159Girl = "Jpg/issues/Issue159Girl.jpg";
public const string Issue178Lemon = "Jpg/issues/Issue178.jpg";
public const string ProgressiveWithTooManyCoefficients178 = "Jpg/issues/Issue178Lemon-ProgressiveWithTooManyCoefficients.jpg";
}
public static readonly string[] All = Baseline.All.Concat(Progressive.All).ToArray();

BIN
tests/Images/Input/Jpg/issues/Issue178Lemon-ProgressiveWithTooManyCoefficients.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

Loading…
Cancel
Save