diff --git a/app/common/library/Download.php b/app/common/library/Download.php index f10bc61d..ec5bbbc1 100644 --- a/app/common/library/Download.php +++ b/app/common/library/Download.php @@ -36,7 +36,14 @@ 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; } diff --git a/app/common/service/qrcode/Goods.php b/app/common/service/qrcode/Goods.php index 72afc705..5ee3cc66 100644 --- a/app/common/service/qrcode/Goods.php +++ b/app/common/service/qrcode/Goods.php @@ -96,6 +96,7 @@ class Goods extends BaseQRcode $fontPath = Grafika::fontsDir() . '/' . 'st-heiti-light.ttc'; // 打开海报背景图 $editor->open($backdropImage, $backdrop); + // 打开商品图片 $editor->open($goodsImage, $goodsUrl); // 重设商品图片宽高