diff --git a/content-controllers/image/resize.php b/content-controllers/image/resize.php index 7bafc75..1135476 100644 --- a/content-controllers/image/resize.php +++ b/content-controllers/image/resize.php @@ -91,14 +91,14 @@ function resize(&$img,$size) if ($height > $width) { $ratio = $maxheight / $height; - $newheight = $maxheight; - $newwidth = $width * $ratio; + $newheight = intval($maxheight); + $newwidth = intval($width * $ratio) ; } else { $ratio = $maxwidth / $width; - $newwidth = $maxwidth; - $newheight = $height * $ratio; + $newwidth = intval($maxwidth) ; + $newheight = intval($height * $ratio); } $newimg = imagecreatetruecolor($newwidth,$newheight);