From 36101a4d0b53d16f553316cc78cba8fedb0ee040 Mon Sep 17 00:00:00 2001 From: Joe Palala <147453875+joparara@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:13:18 +0800 Subject: [PATCH] Update SimpleImage.php for compatiblity with php8 above --- src/Classes/SimpleImage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Classes/SimpleImage.php b/src/Classes/SimpleImage.php index e51a660..3206558 100644 --- a/src/Classes/SimpleImage.php +++ b/src/Classes/SimpleImage.php @@ -38,7 +38,7 @@ public function __construct($image = null) { // Destroys the image resource // public function __destruct() { - if($this->image !== null && get_resource_type($this->image) === 'gd') { + if(is_object($this->image) && $this->image instanceof \GDImage) { imagedestroy($this->image); } } @@ -1797,4 +1797,4 @@ public static function normalizeColor($color) { throw new \Exception("Invalid color value: $color", self::ERR_INVALID_COLOR); } -} \ No newline at end of file +}