|
|
|
@ -50,9 +50,10 @@ class Upload |
|
|
|
$storage = config('filesystem.disks.public.url'); |
|
|
|
// 获取绝对路径 |
|
|
|
$absolutePath = $rootPath . 'public/' . "{$storage}/" . $path; |
|
|
|
$extension = pathinfo($absolutePath, PATHINFO_EXTENSION); |
|
|
|
|
|
|
|
$image = Image::make($absolutePath); |
|
|
|
$image->encode('jpg',10)->save($absolutePath); |
|
|
|
$image->encode($extension,10)->save($absolutePath); |
|
|
|
|
|
|
|
return $path; |
|
|
|
} |
|
|
|
|