Browse Source

bad EOF progressive test image

af/merge-core
Anton Firszov 9 years ago
parent
commit
f07eec7d5f
  1. 11
      tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs
  2. 3
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  3. 6
      tests/ImageSharp.Tests/TestImages.cs
  4. 3
      tests/ImageSharp.Tests/TestImages/Formats/Jpg/progressive/BadEofProgressive.jpg

11
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<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
@ -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<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var image = provider.GetImage();
Assert.NotNull(image);
provider.Utility.SaveTestOutputFile(image, "bmp");
}
}
}

3
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;

6
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 =
{

3
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
Loading…
Cancel
Save