Skip to content

Commit 97a6d85

Browse files
committed
Skip potentially animated GIF images when replacing them with WebP
1 parent 4897568 commit 97a6d85

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

wcfsetup/install/files/lib/system/file/command/ReplaceWithWebpVariant.class.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public function __invoke(): File
2525
return $this->file;
2626
}
2727

28+
// We cannot reliably detect if a GIF is animated without ImageMagick
29+
// and the generated WebP variant will always be static.
30+
if ($this->file->mimeType === 'image/gif') {
31+
return $this->file;
32+
}
33+
2834
$command = new ReplaceFileSource(
2935
$this->file,
3036
$pathnameWebp,

0 commit comments

Comments
 (0)