浏览代码

Fix image resizing logic

Daniel Supernault 7 年之前
父节点
当前提交
e94d9534b1
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/Util/Media/Image.php

+ 2 - 2
app/Util/Media/Image.php

@@ -106,8 +106,8 @@ class Image {
 
     try {
       $img = Intervention::make($file);
-      $img->fit($aspect['width'], $aspect['height'], function ($constraint) {
-        $constraint->upsize();
+      $img->resize($aspect['width'], $aspect['height'], function ($constraint) {
+        $constraint->aspectRatio();
       });
       $converted = $this->convertPngToJpeg($path, $thumbnail, $img->extension);
       $newPath = storage_path('app/'.$converted['path']);