From: Michael Date: Tue, 20 Dec 2022 22:32:24 +0000 (+0000) Subject: Don't calculate the blurhash on images without a size X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e6f0e3c23eb29a878242fadc38a648a16b70261e;p=friendica.git Don't calculate the blurhash on images without a size --- diff --git a/src/Object/Image.php b/src/Object/Image.php index 7069f7a47f..1d2832f20a 100644 --- a/src/Object/Image.php +++ b/src/Object/Image.php @@ -734,15 +734,19 @@ class Image return ''; } - $width = $image->getWidth(); + $width = $image->getWidth(); $height = $image->getHeight(); if (max($width, $height) > 90) { $image->scaleDown(90); - $width = $image->getWidth(); + $width = $image->getWidth(); $height = $image->getHeight(); } + if (empty($width) || empty($height)) { + return ''; + } + $pixels = []; for ($y = 0; $y < $height; ++$y) { $row = [];