From f07eec7d5fcfbbda3311e1dd02b0a5145a7465a8 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Sun, 22 Jan 2017 00:36:02 +0100 Subject: [PATCH] bad EOF progressive test image --- tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs | 11 ++++++++++- .../ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs | 3 ++- tests/ImageSharp.Tests/TestImages.cs | 6 ++++++ .../Formats/Jpg/progressive/BadEofProgressive.jpg | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 tests/ImageSharp.Tests/TestImages/Formats/Jpg/progressive/BadEofProgressive.jpg diff --git a/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs index 2a04cc2c7..94ae9a2b1 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs @@ -28,7 +28,6 @@ namespace ImageSharp.Tests [Theory] [WithFile(TestImages.Jpeg.Baseline.Bad.MissingEOF, PixelTypes.Color)] - [WithFile(TestImages.Jpeg.Progressive.Progress, PixelTypes.Color)] public void LoadBaselineImage(TestImageProvider provider) where TColor : struct, IPackedPixel, IEquatable { @@ -36,5 +35,15 @@ namespace ImageSharp.Tests Assert.NotNull(image); provider.Utility.SaveTestOutputFile(image, "bmp"); } + + // [Theory] // TODO: #18 + [WithFile(TestImages.Jpeg.Progressive.Bad.BadEOF, PixelTypes.Color)] + public void LoadProgressiveImage(TestImageProvider provider) + where TColor : struct, IPackedPixel, IEquatable + { + var image = provider.GetImage(); + Assert.NotNull(image); + provider.Utility.SaveTestOutputFile(image, "bmp"); + } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs index c9d4cfd73..b02f99be1 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs @@ -15,7 +15,8 @@ namespace ImageSharp.Tests public static string[] BaselineTestJpegs = { TestImages.Jpeg.Baseline.Calliphora, TestImages.Jpeg.Baseline.Cmyk, - TestImages.Jpeg.Baseline.Jpeg400, TestImages.Jpeg.Baseline.Jpeg444 + TestImages.Jpeg.Baseline.Jpeg400, TestImages.Jpeg.Baseline.Jpeg444, + TestImages.Jpeg.Baseline.Testimgorig }; public static string[] ProgressiveTestJpegs = TestImages.Jpeg.Progressive.All; diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index 2e41eb0f1..cd365156a 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -44,6 +44,11 @@ namespace ImageSharp.Tests public const string Progress = "Jpg/progressive/progress.jpg"; public const string Festzug = "Jpg/progressive/Festzug.jpg"; + public static class Bad + { + public const string BadEOF = "Jpg/progressive/BadEofProgressive.jpg"; + } + public static readonly string[] All = { Fb, Progress, Festzug }; } @@ -67,6 +72,7 @@ namespace ImageSharp.Tests public const string Jpeg400 = "Jpg/baseline/jpeg400jfif.jpg"; public const string Jpeg420 = "Jpg/baseline/jpeg420exif.jpg"; public const string Jpeg444 = "Jpg/baseline/jpeg444.jpg"; + public const string Testimgorig = "Jpg/baseline/testorig.jpg"; public static readonly string[] All = { diff --git a/tests/ImageSharp.Tests/TestImages/Formats/Jpg/progressive/BadEofProgressive.jpg b/tests/ImageSharp.Tests/TestImages/Formats/Jpg/progressive/BadEofProgressive.jpg new file mode 100644 index 000000000..82a5707e0 --- /dev/null +++ b/tests/ImageSharp.Tests/TestImages/Formats/Jpg/progressive/BadEofProgressive.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22697fcab865bda38c760c6402382bffd47dccdef34d93ce5f8ae63f9b7918aa +size 67503