Browse Source

Merge pull request #1499 from jorry2008/patch-3

使用缩略图,且对接OSS bug
Jiang Qinghua 3 năm trước cách đây
mục cha
commit
76ae9e4164
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/Form/Field/ImageField.php

+ 2 - 2
src/Form/Field/ImageField.php

@@ -182,9 +182,9 @@ trait ImageField
             });
 
             if (! is_null($this->storagePermission)) {
-                $this->getStorage()->put("{$this->getDirectory()}/{$path}", $image->encode(), $this->storagePermission);
+                $this->getStorage()->put("{$this->getDirectory()}/{$path}", $image->encode()->stream(), $this->storagePermission);
             } else {
-                $this->getStorage()->put("{$this->getDirectory()}/{$path}", $image->encode());
+                $this->getStorage()->put("{$this->getDirectory()}/{$path}", $image->encode()->stream());
             }
         }