Merge pull request #12494 from annando/blurhash-fix
Don't calculate the blurhash on images without a size
This commit is contained in:
commit
31e8574006
|
@ -734,15 +734,19 @@ class Image
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$width = $image->getWidth();
|
$width = $image->getWidth();
|
||||||
$height = $image->getHeight();
|
$height = $image->getHeight();
|
||||||
|
|
||||||
if (max($width, $height) > 90) {
|
if (max($width, $height) > 90) {
|
||||||
$image->scaleDown(90);
|
$image->scaleDown(90);
|
||||||
$width = $image->getWidth();
|
$width = $image->getWidth();
|
||||||
$height = $image->getHeight();
|
$height = $image->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($width) || empty($height)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
$pixels = [];
|
$pixels = [];
|
||||||
for ($y = 0; $y < $height; ++$y) {
|
for ($y = 0; $y < $height; ++$y) {
|
||||||
$row = [];
|
$row = [];
|
||||||
|
|
Loading…
Reference in a new issue