Browse Source

Add new resize tests. Fix #1049

af/merge-core
James Jackson-South 6 years ago
parent
commit
2fd662fb74
  1. 24
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs
  2. 1
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Jpg/issues/issue1049-exif-resize.jpg

24
tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

@ -58,9 +58,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
}
}
[Theory(
Skip = "Debug only, enable manually"
)]
[Theory(Skip = "Debug only, enable manually")]
[WithTestPatternImages(4000, 4000, PixelTypes.Rgba32, 300, 1024)]
[WithTestPatternImages(3032, 3032, PixelTypes.Rgba32, 400, 1024)]
[WithTestPatternImages(3032, 3032, PixelTypes.Rgba32, 400, 128)]
@ -560,5 +558,25 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
image.CompareToReferenceOutput(ValidatorComparer, provider);
}
}
[Theory]
[WithFile(TestImages.Jpeg.Issues.ExifDecodeOutOfRange694, DefaultPixelType)]
[WithFile(TestImages.Jpeg.Issues.ExifGetString750Transform, DefaultPixelType)]
[WithFile(TestImages.Jpeg.Issues.ExifResize1049, DefaultPixelType)]
public void CanResizeExifIssueImages<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
// Test images are large so skip on 32bit for now.
if (!TestEnvironment.Is64BitProcess)
{
return;
}
using (Image<TPixel> image = provider.GetImage())
{
// Don't bother saving, we're testing the EXIF metadata updates.
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2));
}
}
}
}

1
tests/ImageSharp.Tests/TestImages.cs

@ -191,6 +191,7 @@ namespace SixLabors.ImageSharp.Tests
public const string IncorrectQuality845 = "Jpg/issues/Issue845-Incorrect-Quality99.jpg";
public const string IncorrectColorspace855 = "Jpg/issues/issue855-incorrect-colorspace.jpg";
public const string IncorrectResize1006 = "Jpg/issues/issue1006-incorrect-resize.jpg";
public const string ExifResize1049 = "Jpg/issues/issue1049-exif-resize.jpg";
public static class Fuzz
{

3
tests/Images/Input/Jpg/issues/issue1049-exif-resize.jpg

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