From 90c23a3fd17ab7e5b6fae2fa70e4bd81ef5e4f28 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sat, 4 Jun 2022 22:49:40 +0800 Subject: [PATCH] =?UTF-8?q?git=20=E5=9B=BE=E7=89=87=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Module/Base.php | 15 +++++++++++---- docker/php/php.conf | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/Module/Base.php b/app/Module/Base.php index aca5b5b84..052b91565 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -2209,7 +2209,7 @@ class Base /** * image64图片保存 - * @param array $param [ image64=带前缀的base64, path=>文件路径, fileName=>文件名称, scale=>[压缩原图宽,高, 压缩方式] ] + * @param array $param [ image64=带前缀的base64, path=>文件路径, fileName=>文件名称, scale=>[压缩原图宽,高, 压缩方式], autoThumb=>false不要自动生成缩略图 ] * @return array [name=>文件名, size=>文件大小(单位KB),file=>绝对地址, path=>相对地址, url=>全路径地址, ext=>文件后缀名] */ public static function image64save($param) @@ -2290,8 +2290,13 @@ class Base } //生成缩略图 $array['thumb'] = $array['path']; - if (Base::imgThumb($array['file'], $array['file'] . "_thumb.jpg", 180, 0)) { - $array['thumb'] .= "_thumb.jpg"; + if ($extension === 'gif' && !isset($param['autoThumb'])) { + $param['autoThumb'] = false; + } + if ($param['autoThumb'] !== false) { + if (Base::imgThumb($array['file'], $array['file'] . "_thumb.jpg", 320, 0)) { + $array['thumb'] .= "_thumb.jpg"; + } } $array['thumb'] = Base::fillUrl($array['thumb']); return Base::retSuccess('success', $array); @@ -2483,7 +2488,9 @@ class Base } //生成缩略图 $array['thumb'] = $array['path']; - if ($param['autoThumb'] === "false") $param['autoThumb'] = false; + if ($extension === 'gif' && !isset($param['autoThumb'])) { + $param['autoThumb'] = false; + } if ($param['autoThumb'] !== false) { if (Base::imgThumb($array['file'], $array['file'] . "_thumb.jpg", 320, 0)) { $array['thumb'] .= "_thumb.jpg"; diff --git a/docker/php/php.conf b/docker/php/php.conf index 14a4861a6..0837cbf54 100644 --- a/docker/php/php.conf +++ b/docker/php/php.conf @@ -2,10 +2,10 @@ directory=/var/www # 生产环境 -command=php bin/laravels start -i +#command=php bin/laravels start -i # 开发环境 -#command=./bin/inotify ./app +command=./bin/inotify ./app numprocs=1 autostart=true