Browse Source

Add new resize tests. Fix #1049

pull/1067/head
James Jackson-South 6 years ago
parent
commit
234eb70967
  1. 24
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs
  2. 1
      tests/ImageSharp.Tests/TestImages.cs
  3. BIN
      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
{

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 KiB

Loading…
Cancel
Save