Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
apply aspectRatio fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bayareawebpro committed May 27, 2021
1 parent e2f1cb2 commit 12bb8c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ public/hot
composer.lock
package-lock.json
/webpack.mix.js
.idea
1 change: 1 addition & 0 deletions src/MediaStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ protected function resize(UploadedFile $file): array
$image = Image::make($file->getRealPath());
if ($image->width() > $maxWidth || $image->height() > $maxHeight) {
$image->fit($maxWidth, $maxHeight, function (Constraint $constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
}
Expand Down

0 comments on commit 12bb8c0

Please sign in to comment.