Commit c72fe953 authored by fuyunnan's avatar fuyunnan

Merge branch 'store-auto-stock' into test

parents ec895278 fd25633d
......@@ -176,9 +176,23 @@ class Drawer
if ($imgInfo && end($imgInfo) == "image/webp") {
$filename = trim(pathinfo($filePath, PATHINFO_FILENAME));
$im = imagecreatefromwebp($filePath); // 加载 WebP 文件
imagejpeg($im, $savePath . $filename . '.jpeg', 100); // 以 100% 的质量转换成 jpeg 格式
switch ($ext){
case 'jpg':
$toNewFileName = $savePath . $filename . '.jpg';
break;
case 'png':
$toNewFileName = $savePath . $filename . '.png';
break;
case 'jpeg':
$toNewFileName = $savePath . $filename . '.jpeg';
break;
default:
$toNewFileName = $savePath . $filename . '.jpeg';
break;
}
imagejpeg($im, $toNewFileName, 30);//转化图片比例
imagedestroy($im);
return $savePath . $filename . '.jpeg';
return $toNewFileName;
}
return $savePath . "$filename.$ext";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment