| @@ 1203-1213 (lines=11) @@ | ||
| 1200 | * @param int $width |
|
| 1201 | * @param int $height |
|
| 1202 | */ |
|
| 1203 | protected function calcHeight ($width, $height) |
|
| 1204 | { |
|
| 1205 | $newHeightPercentage = (100 * $this->maxHeight) / $height; |
|
| 1206 | $newWidth = ($width * $newHeightPercentage) / 100; |
|
| 1207 | ||
| 1208 | return array |
|
| 1209 | ( |
|
| 1210 | 'newWidth' => ceil($newWidth), |
|
| 1211 | 'newHeight' => ceil($this->maxHeight) |
|
| 1212 | ); |
|
| 1213 | } |
|
| 1214 | ||
| 1215 | /** |
|
| 1216 | * Calculates a new width and height for the image based on $this->percent and the provided dimensions |
|
| @@ 1222-1232 (lines=11) @@ | ||
| 1219 | * @param int $width |
|
| 1220 | * @param int $height |
|
| 1221 | */ |
|
| 1222 | protected function calcPercent ($width, $height) |
|
| 1223 | { |
|
| 1224 | $newWidth = ($width * $this->percent) / 100; |
|
| 1225 | $newHeight = ($height * $this->percent) / 100; |
|
| 1226 | ||
| 1227 | return array |
|
| 1228 | ( |
|
| 1229 | 'newWidth' => ceil($newWidth), |
|
| 1230 | 'newHeight' => ceil($newHeight) |
|
| 1231 | ); |
|
| 1232 | } |
|
| 1233 | ||
| 1234 | /** |
|
| 1235 | * Calculates the new image dimensions |
|