Be a bit more explicit about the saveImage aspect ratio preservation (even though in theory intervention/image handles that)

This commit is contained in:
Kevin MacMartin 2022-07-19 15:20:29 -04:00
parent dcf86efa0f
commit 345e315272

View file

@ -246,15 +246,18 @@ class DashboardModel extends Model
$new_height = ($new_width / $width) * $height;
if ($new_height > $max_height) {
$new_width = ($max_height / $height) * $width;
$new_height = $max_height;
$new_width = ($new_height / $height) * $width;
}
}
} else if ($max_width > 0) {
if ($width > $max_width) {
$new_width = $max_width;
$new_height = ($new_width / $width) * $height;
}
} else if ($height > $max_height) {
$new_height = $max_height;
$new_width = ($new_height / $height) * $width;
}
if (!is_null($new_width) || !is_null($new_height)) {