Browse Source

Adds imagefactory unit test for counter-clockwise rotation

Former-commit-id: 7a4859a397c53aebb3701e5d9bee8f53984eeade
Former-commit-id: 57d54f8e7906ad2f12cf5e1420c1b54e587cad33
pull/17/head
Thomas Broust 11 years ago
parent
commit
5a1efde19e
  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