@@ 35-37 (lines=3) @@ | ||
32 | */ |
|
33 | public static function getResizeDimmensions($oldWidth, $oldHeight, $newWidth, $newHeight, $cover = false) |
|
34 | { |
|
35 | if (empty($newHeight)) { |
|
36 | return [(int) $newWidth, (int) ceil(($newWidth / $oldWidth) * $oldHeight)]; |
|
37 | } |
|
38 | ||
39 | if (empty($newWidth)) { |
|
40 | return [(int) ceil(($newHeight / $oldHeight) * $oldWidth), (int) $newHeight]; |
|
@@ 39-41 (lines=3) @@ | ||
36 | return [(int) $newWidth, (int) ceil(($newWidth / $oldWidth) * $oldHeight)]; |
|
37 | } |
|
38 | ||
39 | if (empty($newWidth)) { |
|
40 | return [(int) ceil(($newHeight / $oldHeight) * $oldWidth), (int) $newHeight]; |
|
41 | } |
|
42 | ||
43 | $scaleWidth = $newWidth / $oldWidth; |
|
44 | $scaleHeight = $newHeight / $oldHeight; |