]> git.mxchange.org Git - friendica.git/commitdiff
Don't calculate the blurhash on images without a size
authorMichael <heluecht@pirati.ca>
Tue, 20 Dec 2022 22:32:24 +0000 (22:32 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 20 Dec 2022 22:32:24 +0000 (22:32 +0000)
src/Object/Image.php

index 7069f7a47f561aacf53e399ea2ebe829b6ff47c9..1d2832f20a9a075ab6f2df3b8c08395eedd60866 100644 (file)
@@ -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 = [];