Skip to content

Commit

Permalink
Merge pull request #35 from Chen-Zhitong/sikoay
Browse files Browse the repository at this point in the history
Sikoay
  • Loading branch information
EVA09 authored Jul 14, 2020
2 parents 9279b4c + b6bb4cf commit 9af669d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Crop.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class Crop extends File

protected function preview()
{
return $this->objectUrl($this->value());
if(!is_null($this->value()))
return $this->objectUrl($this->value());
}

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

0 comments on commit 9af669d

Please sign in to comment.