Skip to content

Commit

Permalink
Merge 2515715 into c6bfbc5
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderdlm committed Dec 4, 2019
2 parents c6bfbc5 + 2515715 commit e1151e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ForkCMS/Utility/Thumbnails.php
Expand Up @@ -86,6 +86,9 @@ private function generateThumbnail(array $folder, string $forSourceFile): void
if ($box->getWidth() < $width) {
$height = ($box->getHeight() / $box->getWidth()) * $width;
$image = $image->resize(new Box($width, $height));
} elseif ($box->getHeight() < $height) {
$width *= ($box->getWidth() / $box->getHeight());
$image = $image->resize(new Box($width, $height));
} else {
$image = $image->thumbnail(new Box($width, $height), ImageInterface::THUMBNAIL_OUTBOUND);
}
Expand Down

0 comments on commit e1151e5

Please sign in to comment.