Skip to content

Commit

Permalink
Fix for #70 - Height and width ratio should round up to nearest pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeavon authored and JimBobSquarePants committed Aug 4, 2014
1 parent bf4c364 commit 9d7ccd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ImageProcessor.Web/NET45/Processors/Resize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ private Size ParseSize(string input)
// Replace 0 width
if (size.Width == 0 && size.Height > 0 && input.Contains(WidthRatio) && !input.Contains(HeightRatio))
{
size.Width = (int)(value.ToPositiveFloatArray()[0] * size.Height);
size.Width = (int)Math.Ceiling(value.ToPositiveFloatArray()[0] * size.Height);
}

// Replace 0 height
if (size.Height == 0 && size.Width > 0 && input.Contains(HeightRatio) && !input.Contains(WidthRatio))
{
size.Height = (int)(value.ToPositiveFloatArray()[0] * size.Width);
size.Height = (int)Math.Ceiling(value.ToPositiveFloatArray()[0] * size.Width);
}
}

Expand Down

0 comments on commit 9d7ccd0

Please sign in to comment.