Commit 10e20581 authored by Richard Mansfield's avatar Richard Mansfield

Don't try to scale images to be less than 1 pixel width/height

Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent a320238a
......@@ -571,8 +571,8 @@ function image_get_new_dimensions($oldx, $oldy, $size) {
}
else if (isset($size['maxw']) && isset($size['maxh'])) {
$scale = min(min($size['maxw'], $oldx) / $oldx, min($size['maxh'], $oldy) / $oldy);
$newx = $oldx * $scale;
$newy = $oldy * $scale;
$newx = max(1, $oldx * $scale);
$newy = max(1, $oldy * $scale);
}
else if (isset($size['maxw'])) {
// Else if just maximum width
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment