From fc4cb8277e226da6bbad48d27f3eee0a862eb99e Mon Sep 17 00:00:00 2001 From: naftali100 Date: Mon, 7 Dec 2020 17:32:22 +0200 Subject: [PATCH] compatibility with php8 --- php_image_magician.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php_image_magician.php b/php_image_magician.php index a582cbb..6907332 100755 --- a/php_image_magician.php +++ b/php_image_magician.php @@ -2425,7 +2425,7 @@ public function saveImage($savePath, $imageQuality="100") { // *** Perform a check or two. - if (!is_resource($this->imageResized)) { if ($this->debug) { die('saveImage: This is not a resource.'); }else{ die(); }} + if (!is_resource($this->imageResized) || !(is_object($this->imageResized) && $this->imageResized instanceOf \GdImage)) { if ($this->debug) { die('saveImage: This is not GdImage.'); }else{ die(); }} $fileInfoArray = pathInfo($savePath); clearstatcache(); if (!is_writable($fileInfoArray['dirname'])) { if ($this->debug) { die('The path is not writable. Please check your permissions.'); }else{ die(); }}