浏览代码

Update Image util

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

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

@@ -15,7 +15,7 @@ class Image
     public $orientation;
     public $acceptedMimes = [
         'image/png',
-        'image/jpeg',
+        'image/jpeg'
     ];
 
     public function __construct()
@@ -114,9 +114,11 @@ class Image
             if($thumbnail) {
                 $img->crop($aspect['width'], $aspect['height']);
             } else {
+                $metadata = $img->exif();
                 $img->resize($aspect['width'], $aspect['height'], function ($constraint) {
                     $constraint->aspectRatio();
                 });
+                $media->metadata = json_encode($metadata);
             }
             $converted = $this->setBaseName($path, $thumbnail, $img->extension);
             $newPath = storage_path('app/'.$converted['path']);