| @@ 1285-1302 (lines=18) @@ | ||
| 1282 | if ($this->maxWidth >= $this->maxHeight) |
|
| 1283 | { |
|
| 1284 | // and determine the longest original dimension |
|
| 1285 | if ($width > $height) |
|
| 1286 | { |
|
| 1287 | $newDimensions = $this->calcHeight($width, $height); |
|
| 1288 | ||
| 1289 | if ($newDimensions['newWidth'] < $this->maxWidth) |
|
| 1290 | { |
|
| 1291 | $newDimensions = $this->calcWidth($width, $height); |
|
| 1292 | } |
|
| 1293 | } |
|
| 1294 | elseif ($height >= $width) |
|
| 1295 | { |
|
| 1296 | $newDimensions = $this->calcWidth($width, $height); |
|
| 1297 | ||
| 1298 | if ($newDimensions['newHeight'] < $this->maxHeight) |
|
| 1299 | { |
|
| 1300 | $newDimensions = $this->calcHeight($width, $height); |
|
| 1301 | } |
|
| 1302 | } |
|
| 1303 | } |
|
| 1304 | elseif ($this->maxHeight > $this->maxWidth) |
|
| 1305 | { |
|
| @@ 1306-1323 (lines=18) @@ | ||
| 1303 | } |
|
| 1304 | elseif ($this->maxHeight > $this->maxWidth) |
|
| 1305 | { |
|
| 1306 | if ($width >= $height) |
|
| 1307 | { |
|
| 1308 | $newDimensions = $this->calcWidth($width, $height); |
|
| 1309 | ||
| 1310 | if ($newDimensions['newHeight'] < $this->maxHeight) |
|
| 1311 | { |
|
| 1312 | $newDimensions = $this->calcHeight($width, $height); |
|
| 1313 | } |
|
| 1314 | } |
|
| 1315 | elseif ($height > $width) |
|
| 1316 | { |
|
| 1317 | $newDimensions = $this->calcHeight($width, $height); |
|
| 1318 | ||
| 1319 | if ($newDimensions['newWidth'] < $this->maxWidth) |
|
| 1320 | { |
|
| 1321 | $newDimensions = $this->calcWidth($width, $height); |
|
| 1322 | } |
|
| 1323 | } |
|
| 1324 | } |
|
| 1325 | ||
| 1326 | $this->newDimensions = $newDimensions; |
|