Skip to content

Commit 9af669d

Browse files
authored
Merge pull request #35 from Chen-Zhitong/sikoay
Sikoay
2 parents 9279b4c + b6bb4cf commit 9af669d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Crop.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ class Crop extends File
2828

2929
protected function preview()
3030
{
31-
return $this->objectUrl($this->value());
31+
if(!is_null($this->value()))
32+
return $this->objectUrl($this->value());
3233
}
3334

3435
/**
@@ -69,7 +70,7 @@ public function prepare($base64)
6970
} else if (preg_match('/data:image\/.*?;base64/is',$base64)) {
7071
//检查是否是base64编码
7172
//base64转图片缓存 返回的是绝对路径
72-
$image = $this->base64_image_content($base64,public_path('uploads/base64img_cache'));
73+
$image = $this->base64_image_content($base64,storage_path('app/public/images/base64img_cache'));
7374
if ($image !== false) {
7475
$image = new UploadedFile($image['path'],$image['filename']);
7576
$this->name = $this->getStoreName($image);

0 commit comments

Comments
 (0)