@ -36,6 +36,13 @@ class Download
$result = $this->curl($url);
empty($result) && throwError('获取到的图片内容为空 url: ' . $url);
$this->fwrite($savePath, $result);
//特殊处理一下文件格式为webp的图片
$mime = mime_content_type($savePath);
if ($mime=='image/webp') {
$im = imagecreatefromwebp($savePath);
imagepng($im, $savePath);
}
return $savePath;
@ -96,6 +96,7 @@ class Goods extends BaseQRcode
$fontPath = Grafika::fontsDir() . '/' . 'st-heiti-light.ttc';
// 打开海报背景图
$editor->open($backdropImage, $backdrop);
// 打开商品图片
$editor->open($goodsImage, $goodsUrl);
// 重设商品图片宽高