mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-21 23:52:31 -05:00
Be a bit more explicit about the saveImage aspect ratio preservation (even though in theory intervention/image handles that)
This commit is contained in:
parent
dcf86efa0f
commit
345e315272
1 changed files with 4 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue