水印跳过 gif 动图

This commit is contained in:
Wisp X
2022-01-19 13:09:24 +08:00
parent d56e605e35
commit 046d642a87
2 changed files with 3 additions and 2 deletions
@@ -108,8 +108,8 @@ class ImageController extends Controller
} catch (FilesystemException $e) {
abort(404);
}
// 是否启用了水印功能 TODO 跳过gif
if ($image->group->configs->get(GroupConfigKey::IsEnableWatermark)) {
// 是否启用了水印功能跳过gif图片
if ($image->group->configs->get(GroupConfigKey::IsEnableWatermark) && $image->mimetype !== 'image/gif') {
// TODO 缓存水印文件
$configs = $image->group->configs->get(GroupConfigKey::WatermarkConfigs);
$contents = (string)$service->stickWatermark($contents, collect($configs))->encode();