diff --git a/libraries/src/Image/Image.php b/libraries/src/Image/Image.php index 2ce0229f317ce..3342ed1158767 100644 --- a/libraries/src/Image/Image.php +++ b/libraries/src/Image/Image.php @@ -1055,9 +1055,8 @@ protected function prepareDimensions($width, $height, $scaleMethod) } else { $ratio = min($rx, $ry); } - - $dimensions->width = (int) round($this->getWidth() / $ratio); - $dimensions->height = (int) round($this->getHeight() / $ratio); + $dimensions->width = max(1, (int) round($this->getWidth() / $ratio)); + $dimensions->height = max(1, (int) round($this->getHeight() / $ratio)); break; default: