From d0fd6e7036eafe2d1f7750ab9626bc964c6b3daf Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sun, 22 Nov 2020 02:24:37 +0700 Subject: [PATCH] PHP 8: Add support for GdImage resource objects In [PHP 8.0, `gd` resources are changed to `\GdImage` class objects](https://php.watch/versions/8.0/gdimage). This changes the `\Intervention\Image\AbstractDecoder::isGdResource` method to accept `\GdImage` objects as well as `gd` resources. --- src/Intervention/Image/AbstractDecoder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Intervention/Image/AbstractDecoder.php b/src/Intervention/Image/AbstractDecoder.php index de770c32..8e68a3d9 100644 --- a/src/Intervention/Image/AbstractDecoder.php +++ b/src/Intervention/Image/AbstractDecoder.php @@ -140,6 +140,10 @@ abstract class AbstractDecoder return (get_resource_type($this->data) == 'gd'); } + if ($this->data instanceof \GdImage) { + return true; + } + return false; }