| @@ 452-458 (lines=7) @@ | ||
| 449 | $newFilePath = $this->getFilePath($newFileName); |
|
| 450 | $success = $image->thumbnail(new Box($newWidth, $newHeight)) |
|
| 451 | ->save($newFilePath); |
|
| 452 | if ($success) { |
|
| 453 | $this->_meta['versions'][$version] = [ |
|
| 454 | 'url' => $newFileName, |
|
| 455 | 'width' => $newWidth, |
|
| 456 | 'height' => $newHeight, |
|
| 457 | ]; |
|
| 458 | } |
|
| 459 | } else { |
|
| 460 | if (($imageWidth / $imageHeight) >= ($maxWidth / $maxHeight)) { |
|
| 461 | $newWidth = round($imageWidth / ($imageHeight / $maxHeight)); |
|
| @@ 477-483 (lines=7) @@ | ||
| 474 | $success = $image->thumbnail(new Box($newWidth, $newHeight), ManipulatorInterface::THUMBNAIL_OUTBOUND) |
|
| 475 | ->crop(new Point($pointX, $pointY), new Box($maxWidth, $maxHeight)) |
|
| 476 | ->save($newFilePath); |
|
| 477 | if ($success) { |
|
| 478 | $this->_meta['versions'][$version] = [ |
|
| 479 | 'url' => $newFileName, |
|
| 480 | 'width' => $maxWidth, |
|
| 481 | 'height' => $maxWidth, |
|
| 482 | ]; |
|
| 483 | } |
|
| 484 | } |
|
| 485 | } |
|
| 486 | ||