From fa893ab2568ecbb30a2bca1580b1fb3bcdf1b0ae Mon Sep 17 00:00:00 2001 From: Thomas Broust Date: Thu, 26 Feb 2015 14:53:36 +0100 Subject: [PATCH] Adds imagefactory unit test for counter-clockwise rotation Former-commit-id: 81dce778eeb039bb8f26a7d3ed997d3f1e89fece Former-commit-id: b73f8fc19bb9fe1c4113882ef61a1e8a2882da65 --- .../ImageFactoryUnitTests.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs b/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs index 12abc9e04..ac3f9cdb6 100644 --- a/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs +++ b/src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs @@ -547,6 +547,27 @@ namespace ImageProcessor.UnitTests } } + /// + /// Tests that the image's inside is rotated counter-clockwise + /// + [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"); + } + } + /// /// Tests that the image's inside is rotated and resized ///