From 3b1d5669737f6224ae2b68e70ffb9d8be16ba902 Mon Sep 17 00:00:00 2001 From: Wisp X <1591788658@qq.com> Date: Fri, 18 Mar 2022 09:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E5=8D=B0=E5=90=88=E6=88=90=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=20gif=E3=80=81ico=20=E6=A0=BC=E5=BC=8F=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 289cf3aa..02336cdf 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -154,8 +154,8 @@ class Controller extends BaseController $contents = Cache::get($cacheKey); } else { $contents = $image->filesystem()->read($image->pathname); - // 是否启用了水印功能,跳过gif图片 - if ($image->group?->configs->get(GroupConfigKey::IsEnableWatermark) && $image->mimetype !== 'image/gif') { + // 是否启用了水印功能,跳过gif和ico图片 + if ($image->group?->configs->get(GroupConfigKey::IsEnableWatermark) && ! in_array($image->extension, ['ico', 'gif'])) { $configs = $image->group?->configs->get(GroupConfigKey::WatermarkConfigs); $contents = $service->stickWatermark($contents, collect($configs))->encode()->getEncoded(); }