Merge pull request #14443 from annando/webp-animated

Issue 14419: Avoid fatal errors with animated WebP images and GDlib
This commit is contained in:
Tobias Diekershoff 2024-09-18 06:56:38 +02:00 committed by GitHub
commit 30aac5f1b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -213,6 +213,12 @@ class Image
}
$this->valid = false;
if (($this->originType == IMAGETYPE_WEBP) && $this->isAnimatedWebP(substr($data, 0, 90))) {
DI::logger()->notice('Animated WebP images are unsupported by GDlib. Please install Imagick.', ['file' => $this->filename]);
return false;
}
try {
$this->image = @imagecreatefromstring($data);
if ($this->image !== false) {