Merge pull request #12494 from annando/blurhash-fix

Don't calculate the blurhash on images without a size
This commit is contained in:
Hypolite Petovan 2022-12-20 20:19:32 -05:00 committed by GitHub
commit 31e8574006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View 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 = [];