Check that getimagesize was initialised

This commit is contained in:
Mike Macgirvin 2022-09-12 18:38:54 +10:00
parent 9b0ca686ed
commit 5c89f664e5

View file

@ -27,7 +27,10 @@ class Resizer
private function constructDimension($max)
{
if ($this->getimagesize[0] > $max || $this->getimagesize[1] > $max) {
if (!isset($this->getimagesize)) {
return false;
}
if (is_array($this->getimagesize) && ($this->getimagesize[0] > $max || $this->getimagesize[1] > $max)) {
return photo_calculate_scale(array_merge($this->getimagesize, ['max' => $max]));
}
return false;