From c5f8f45391b182232067a9759f696b407266c609 Mon Sep 17 00:00:00 2001 From: Daniel Hudson Date: Thu, 29 Jul 2021 13:23:17 +0100 Subject: [PATCH 1/2] Add PHP8 GDImage object support --- src/Intervention/Image/Gd/Commands/ResetCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Intervention/Image/Gd/Commands/ResetCommand.php b/src/Intervention/Image/Gd/Commands/ResetCommand.php index 12c41bf6..16f1aef0 100644 --- a/src/Intervention/Image/Gd/Commands/ResetCommand.php +++ b/src/Intervention/Image/Gd/Commands/ResetCommand.php @@ -16,8 +16,9 @@ class ResetCommand extends AbstractCommand public function execute($image) { $backupName = $this->argument(0)->value(); - - if (is_resource($backup = $image->getBackup($backupName))) { + $backup = $image->getBackup($backupName) + + if (is_resource($backup) || $backup instanceof \GdImage) { // destroy current resource imagedestroy($image->getCore()); From aeda35ffb92e8433a0f0c878c947f87e14b09bb9 Mon Sep 17 00:00:00 2001 From: Daniel Hudson Date: Thu, 29 Jul 2021 13:37:48 +0100 Subject: [PATCH 2/2] Missing semi-colon. --- src/Intervention/Image/Gd/Commands/ResetCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Intervention/Image/Gd/Commands/ResetCommand.php b/src/Intervention/Image/Gd/Commands/ResetCommand.php index 16f1aef0..a68b75ea 100644 --- a/src/Intervention/Image/Gd/Commands/ResetCommand.php +++ b/src/Intervention/Image/Gd/Commands/ResetCommand.php @@ -16,7 +16,7 @@ class ResetCommand extends AbstractCommand public function execute($image) { $backupName = $this->argument(0)->value(); - $backup = $image->getBackup($backupName) + $backup = $image->getBackup($backupName); if (is_resource($backup) || $backup instanceof \GdImage) {