Skip to content

Commit

Permalink
ImageGD: imagecreatetruecolor returns false on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Jun 25, 2021
1 parent 92bc56f commit 8fdbd72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions classes/utils/ImageGD.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function scale($width, $height)
$height = round($this->height * $ratio);

// create new image
$thumb = ImageCreateTrueColor($width, $height);
$thumb = imagecreatetruecolor($width, $height);

if (!is_resource($thumb)) {
if ($thumb === false) {
return false;
}

Expand Down Expand Up @@ -98,9 +98,9 @@ public function crop($width, $height)
}

// create new image
$thumb = ImageCreateTrueColor($width, $height);
$thumb = imagecreatetruecolor($width, $height);

if (!is_resource($thumb)) {
if ($thumb === false) {
return false;
}

Expand Down

0 comments on commit 8fdbd72

Please sign in to comment.