From 8fdbd72505d223737ce9ddf06403c5d9f599873a Mon Sep 17 00:00:00 2001 From: macbre Date: Fri, 25 Jun 2021 11:09:22 +0100 Subject: [PATCH] ImageGD: imagecreatetruecolor returns false on errors --- classes/utils/ImageGD.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/utils/ImageGD.class.php b/classes/utils/ImageGD.class.php index 06a97edf..2a9819d4 100644 --- a/classes/utils/ImageGD.class.php +++ b/classes/utils/ImageGD.class.php @@ -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; } @@ -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; }