Browse Source

Adds imagefactory unit test for counter-clockwise rotation

Former-commit-id: 81dce778eeb039bb8f26a7d3ed997d3f1e89fece
Former-commit-id: b73f8fc19bb9fe1c4113882ef61a1e8a2882da65
pull/17/head
Thomas Broust 11 years ago
parent
commit
fa893ab256
  1. 21
      src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs

21
src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs

@ -547,6 +547,27 @@ namespace ImageProcessor.UnitTests
}
}
/// <summary>
/// Tests that the image's inside is rotated counter-clockwise
/// </summary>
[Test]
public void ImageIsRotatedInsideCounterClockwise()
{
int i = 0;
foreach (ImageFactory imageFactory in this.ListInputImages())
{
Image original = (Image)imageFactory.Image.Clone();
imageFactory.RotateBounded(-45, true);
imageFactory.Image.Width.Should().Be(original.Width, "because the rotated image dimensions should not have changed");
imageFactory.Image.Height.Should().Be(original.Height, "because the rotated image dimensions should not have changed");
AssertionHelpers.AssertImagesAreDifferent(original, imageFactory.Image, "because the inside image should have been rotated on {0}", imageFactory.ImagePath);
imageFactory.Format(new ImageProcessor.Imaging.Formats.JpegFormat()).Save("./output/rotateboundedccw-" + i++.ToString() + ".jpg");
}
}
/// <summary>
/// Tests that the image's inside is rotated and resized
/// </summary>

Loading…
Cancel
Save