Browse Source

re-apply DebugSave() changes after merging mutate-api

af/merge-core
Anton Firszov 9 years ago
parent
commit
ae549a0338
  1. 6
      tests/ImageSharp.Tests/Image/ImageRotationTests.cs
  2. 4
      tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs
  3. 8
      tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs
  4. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs
  5. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs
  6. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs
  7. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs
  8. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs
  9. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs
  10. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs
  11. 4
      tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs
  12. 4
      tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs
  13. 4
      tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs
  14. 4
      tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs
  15. 4
      tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs
  16. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs
  17. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs
  18. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs
  19. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs
  20. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs
  21. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs
  22. 4
      tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs
  23. 8
      tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs
  24. 8
      tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs
  25. 4
      tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs
  26. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs
  27. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs
  28. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs
  29. 37
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs
  30. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs
  31. 4
      tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs
  32. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs

6
tests/ImageSharp.Tests/Image/ImageRotationTests.cs

@ -45,9 +45,9 @@ namespace ImageSharp.Tests
TestFile file = TestFile.Create(TestImages.Bmp.Car);
using (Image<Rgba32> image = Image.Load<Rgba32>(file.FilePath))
{
Size original = image.Bounds.Size;
image.Rotate(angle);
return (original, image.Bounds.Size);
Size original = image.Bounds().Size;
image.Mutate(ctx => ctx.Rotate(angle));
return (original, image.Bounds().Size);
}
}
}

4
tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Binarization
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.BinaryThreshold(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -42,7 +42,7 @@ namespace ImageSharp.Tests.Processing.Processors.Binarization
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.BinaryThreshold(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

8
tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs

@ -39,7 +39,7 @@ namespace ImageSharp.Tests.Processing.Processors.Binarization
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Dither(ditherer));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -54,7 +54,7 @@ namespace ImageSharp.Tests.Processing.Processors.Binarization
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Dither(ditherer, bounds));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
@ -68,7 +68,7 @@ namespace ImageSharp.Tests.Processing.Processors.Binarization
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Dither(diffuser, .5F));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -83,7 +83,7 @@ namespace ImageSharp.Tests.Processing.Processors.Binarization
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Dither(diffuser, .5F, bounds));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.BlackWhite());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -34,7 +34,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.BlackWhite(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs

@ -33,7 +33,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.ColorBlindness(colorBlindness));
image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp);
image.DebugSave(provider, colorBlindness.ToString());
}
}
@ -48,7 +48,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.ColorBlindness(colorBlindness, bounds));
image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp);
image.DebugSave(provider, colorBlindness.ToString());
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Hue(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Hue(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Kodachrome());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -34,7 +34,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Kodachrome(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs

@ -21,7 +21,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Lomograph());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -36,7 +36,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Lomograph(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Polaroid());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -34,7 +34,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Polaroid(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Saturation(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Saturation(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Sepia());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -34,7 +34,7 @@ namespace ImageSharp.Tests.Processing.Processors.ColorMatrix
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Sepia(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.BoxBlur(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.BoxBlur(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs

@ -35,7 +35,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.DetectEdges(detector));
image.DebugSave(provider, detector.ToString(), Extensions.Bmp);
image.DebugSave(provider, detector.ToString());
}
}
@ -50,7 +50,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.DetectEdges(detector, bounds));
image.DebugSave(provider, detector.ToString(), Extensions.Bmp);
image.DebugSave(provider, detector.ToString());
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.GaussianBlur(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.GaussianBlur(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.GaussianSharpen(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Convolution
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.GaussianSharpen(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Alpha(value));
image.DebugSave(provider, value, Extensions.Png);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Alpha(value, bounds));
image.DebugSave(provider, value, Extensions.Png);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.BackgroundColor(NamedColors<TPixel>.HotPink));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -34,7 +34,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.BackgroundColor(NamedColors<TPixel>.HotPink, bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Brightness(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Brightness(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); ;
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Contrast(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Contrast(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Invert());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -34,7 +34,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Invert(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.OilPaint(levels, brushSize));
image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp);
image.DebugSave(provider, string.Join("-", levels, brushSize));
}
}
@ -41,7 +41,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.OilPaint(levels, brushSize, bounds));
image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp);
image.DebugSave(provider, string.Join("-", levels, brushSize));
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds, 0.001F);
}

4
tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Pixelate(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
// Test the neigbouring pixels
for (int y = 0; y < image.Height; y += value)
@ -57,7 +57,7 @@ namespace ImageSharp.Tests.Processing.Processors.Effects
var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Pixelate(value, bounds));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
for (int y = 0; y < image.Height; y++)
{

8
tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Glow());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -31,7 +31,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Glow(NamedColors<TPixel>.Orange));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -43,7 +43,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Glow(image.Width / 4F));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -58,7 +58,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Glow(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

8
tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Vignette());
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -31,7 +31,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Vignette(NamedColors<TPixel>.Orange));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -43,7 +43,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Vignette(image.Width / 4F, image.Height / 4F));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
@ -58,7 +58,7 @@ namespace ImageSharp.Tests.Processing.Processors.Overlays
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Vignette(bounds));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}

4
tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs

@ -50,10 +50,10 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
image.MetaData.ExifProfile.SetValue(ExifTag.Orientation, orientation);
image.Mutate(x => x.RotateFlip(rotateType, flipType));
image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "1_before"), Extensions.Bmp);
image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "1_before"));
image.Mutate(x => x.AutoOrient());
image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "2_after"), Extensions.Bmp);
image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "2_after"));
}
}

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Crop(image.Width / 2, image.Height / 2));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
}
}
}

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.EntropyCrop(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
}

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs

@ -19,7 +19,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Pad(image.Width + 50, image.Height + 50));
image.DebugSave(provider, null, Extensions.Bmp);
image.DebugSave(provider);
// Check pixels are empty
for (int y = 0; y < 25; y++)

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

@ -12,7 +12,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
public class ResizeTests : FileTestBase
{
public static readonly string[] ResizeFiles = { TestImages.Jpeg.Baseline.Calliphora };
public static readonly string[] ResizeFiles = { TestImages.Png.CalliphoraPartial };
public static readonly TheoryData<string, IResampler> ReSamplers =
new TheoryData<string, IResampler>
@ -33,6 +33,19 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
[Theory]
[WithFile(TestImages.Gif.Giphy, DefaultPixelType)]
public void ResizeShouldApplyToAllFrames<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, true));
image.DebugSave(provider, extension: Extensions.Gif);
}
}
[Theory]
[WithTestPatternImages(nameof(ReSamplers), 100, 100, DefaultPixelType)]
[WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)]
public void ImageShouldResize<TPixel>(TestImageProvider<TPixel> provider, string name, IResampler sampler)
where TPixel : struct, IPixel<TPixel>
@ -40,7 +53,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, sampler, true));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -55,7 +68,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
var destRectangle = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2);
image.Mutate(x => x.Resize(image.Width, image.Height, sampler, sourceRectangle, destRectangle, false));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -67,7 +80,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Resize(image.Width / 3, 0, sampler, false));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -79,7 +92,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Resize(0, image.Height / 3, sampler, false));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -97,7 +110,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -115,7 +128,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -134,7 +147,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -153,7 +166,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -172,7 +185,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -191,7 +204,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}
@ -210,7 +223,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
image.Mutate(x => x.Resize(options));
image.DebugSave(provider, name, Extensions.Bmp);
image.DebugSave(provider, name);
}
}

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs

@ -32,7 +32,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.RotateFlip(rotateType, flipType));
image.DebugSave(provider, string.Join("_", rotateType, flipType), Extensions.Bmp);
image.DebugSave(provider, string.Join("_", rotateType, flipType));
}
}
}

4
tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs

@ -36,7 +36,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Rotate(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
@ -48,7 +48,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.Rotate(value));
image.DebugSave(provider, value, Extensions.Bmp);
image.DebugSave(provider, value);
}
}
}

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs

@ -26,7 +26,7 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(i => i.Skew(x, y));
image.DebugSave(provider, string.Join("_", x, y), Extensions.Bmp);
image.DebugSave(provider, string.Join("_", x, y));
}
}
}

Loading…
Cancel
Save