From: Michael Date: Wed, 18 Sep 2024 04:06:57 +0000 (+0000) Subject: Issue 14419: Avoid fatal errors with animated WebP images and GDlib X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7525d80d03770dcba0fa1d48da8da9ede2d17c11;p=friendica.git Issue 14419: Avoid fatal errors with animated WebP images and GDlib --- 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) {