Daniel Supernault 6 年之前
父節點
當前提交
a14532e715
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/Util/Media/Image.php

+ 3 - 1
app/Util/Media/Image.php

@@ -112,7 +112,9 @@ class Image
         try {
             $img = Intervention::make($file)->orientate();
             if($thumbnail) {
-                $img->crop($aspect['width'], $aspect['height']);
+                $img->resize($aspect['width'], $aspect['height'], function ($constraint) {
+                    $constraint->aspectRatio();
+                });
             } else {
                 $metadata = $img->exif();
                 $img->resize($aspect['width'], $aspect['height'], function ($constraint) {