Update app/Util/Media/Image.php

Co-authored-by: Daniel Mason <daniel@m2.nz>
This commit is contained in:
daniel 2022-01-05 18:36:02 -07:00 committed by GitHub
parent 27b715cb35
commit c43f9ab7a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -159,7 +159,10 @@ class Image
$media->metadata = json_encode($meta);
}
if ( ($ratio['width_original'] > $aspect['width']) || ($ratio['height_original'] > $aspect['height']) ) {
if (
($ratio['width_original'] > $aspect['width'])
|| ($ratio['height_original'] > $aspect['height'])
) {
$img->resize($aspect['width'], $aspect['height'], function ($constraint) {
$constraint->aspectRatio();
});