1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 08:14:10 +00:00

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

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();
});