分离首页和详情页面
This commit is contained in:
@@ -18,7 +18,7 @@ class ImageService
|
||||
public function processImage($imageFile, $pid = 1)
|
||||
{
|
||||
// 1. 保存原始图片
|
||||
$originalPath = $this->storeOriginalImage($imageFile);
|
||||
$originalPath = $this->storeOriginalImage(file_get_contents($imageFile));
|
||||
|
||||
// 2. 无损压缩图片
|
||||
$compressedPath = $this->compressToWebp($originalPath);
|
||||
@@ -46,9 +46,8 @@ class ImageService
|
||||
*/
|
||||
protected function storeOriginalImage($imageFile)
|
||||
{
|
||||
$path = 'images/original/' . Str::random(40) . '.' . $imageFile->getClientOriginalExtension();
|
||||
dd([$imageFile, $path]);
|
||||
Storage::put($path, file_get_contents($imageFile));
|
||||
$path = 'images/original/cc_'. date('Ymdhis') . Str::random(40) . '.' . $imageFile->getClientOriginalExtension();
|
||||
Storage::put($path, $imageFile);
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user