Skip to content

Commit 22a1d1a

Browse files
committed
fix image upload resizing bug
1 parent fbf066d commit 22a1d1a

File tree

1 file changed

+4
-2
lines changed
  • src/Darryldecode/Backend/Components/MediaManager/Services

1 file changed

+4
-2
lines changed

src/Darryldecode/Backend/Components/MediaManager/Services/Image.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ public static function createThumbnail($imagePath, $width = null, $height = null
2626
$manager = new ImageManager();
2727

2828
$manager->make($imagePath)
29-
->resize($width, $height)
30-
->save($target);
29+
->resize($width, $height, function ($constraint) {
30+
$constraint->aspectRatio();
31+
$constraint->upsize();
32+
})->save($target);
3133

3234
return true;
3335
}

0 commit comments

Comments
 (0)