diff --git a/src/ImageProcessor/Processors/Resize.cs b/src/ImageProcessor/Processors/Resize.cs index d0ba5539a..20d5b4476 100644 --- a/src/ImageProcessor/Processors/Resize.cs +++ b/src/ImageProcessor/Processors/Resize.cs @@ -252,13 +252,13 @@ namespace ImageProcessor.Processors { ratio = percentHeight; destinationX = (int)((width - (sourceWidth * ratio)) / 2); - destinationWidth = (int)Math.Floor(sourceWidth * percentHeight); + destinationWidth = (int)Math.Ceiling(sourceWidth * percentHeight); } else { ratio = percentWidth; destinationY = (int)((height - (sourceHeight * ratio)) / 2); - destinationHeight = (int)Math.Floor(sourceHeight * percentWidth); + destinationHeight = (int)Math.Ceiling(sourceHeight * percentWidth); } } @@ -285,7 +285,7 @@ namespace ImageProcessor.Processors break; } - destinationHeight = (int)Math.Floor(sourceHeight * percentWidth); + destinationHeight = (int)Math.Ceiling(sourceHeight * percentWidth); } else { @@ -304,7 +304,7 @@ namespace ImageProcessor.Processors break; } - destinationWidth = (int)Math.Floor(sourceWidth * percentHeight); + destinationWidth = (int)Math.Ceiling(sourceWidth * percentHeight); } } @@ -330,13 +330,13 @@ namespace ImageProcessor.Processors // If height or width is not passed we assume that the standard ratio is to be kept. if (height == 0) { - destinationHeight = (int)Math.Floor(sourceHeight * percentWidth); + destinationHeight = (int)Math.Ceiling(sourceHeight * percentWidth); height = destinationHeight; } if (width == 0) { - destinationWidth = (int)Math.Floor(sourceWidth * percentHeight); + destinationWidth = (int)Math.Ceiling(sourceWidth * percentHeight); width = destinationWidth; } @@ -376,7 +376,7 @@ namespace ImageProcessor.Processors } // An unwanted border appears when using InterpolationMode.HighQualityBicubic to resize the image - // as the algorithm appears to be pulling averaging detail from surFlooring pixels beyond the edge + // as the algorithm appears to be pulling averaging detail from surCeilinging pixels beyond the edge // of the image. Using the ImageAttributes class to specify that the pixels beyond are simply mirror // images of the pixels within solves this problem. using (ImageAttributes wrapMode = new ImageAttributes()) diff --git a/src/TestWebsites/NET45/Test_Website_NET45/Images/header_1.jpg.REMOVED.git-id b/src/TestWebsites/NET45/Test_Website_NET45/Images/header_1.jpg.REMOVED.git-id new file mode 100644 index 000000000..8ff35359a --- /dev/null +++ b/src/TestWebsites/NET45/Test_Website_NET45/Images/header_1.jpg.REMOVED.git-id @@ -0,0 +1 @@ +f956fa8105d6d9628a0413b8884ec7684e820381 \ No newline at end of file diff --git a/src/TestWebsites/NET45/Test_Website_NET45/Test_Website_NET45.csproj b/src/TestWebsites/NET45/Test_Website_NET45/Test_Website_NET45.csproj index 29f1dbe8f..f74393cf5 100644 --- a/src/TestWebsites/NET45/Test_Website_NET45/Test_Website_NET45.csproj +++ b/src/TestWebsites/NET45/Test_Website_NET45/Test_Website_NET45.csproj @@ -127,15 +127,16 @@ + + - @@ -145,10 +146,12 @@ + + diff --git a/src/TestWebsites/NET45/Test_Website_NET45/Views/Home/Index.cshtml b/src/TestWebsites/NET45/Test_Website_NET45/Views/Home/Index.cshtml index 0aa9fc37a..f4d137cd5 100644 --- a/src/TestWebsites/NET45/Test_Website_NET45/Views/Home/Index.cshtml +++ b/src/TestWebsites/NET45/Test_Website_NET45/Views/Home/Index.cshtml @@ -209,4 +209,11 @@ +
+
+

Rounding

+ + +
+