From 7525d80d03770dcba0fa1d48da8da9ede2d17c11 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 18 Sep 2024 04:06:57 +0000 Subject: [PATCH] Issue 14419: Avoid fatal errors with animated WebP images and GDlib --- src/Object/Image.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Object/Image.php b/src/Object/Image.php index c971efc81a..256de2f284 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -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) {