Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be81664

Browse files
authored
Fix PHP8
Fix for PHP8 - type of imageCreateFromString seems to be object now in PHP 8 (instead of resource)
1 parent 18f7ed0 commit be81664

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Core/ImageWorkshopLayer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function __construct($image, array $exif = array())
156156
throw new ImageWorkshopLayerException('PHPImageWorkshop requires the GD extension to be loaded.', static::ERROR_GD_NOT_INSTALLED);
157157
}
158158

159-
if (gettype($image) != 'resource' && gettype($image) != '\resource') {
159+
if (!in_array(gettype($image),array('object','resource','\resource'))) {
160160
throw new ImageWorkshopLayerException('You must give a php image var to initialize a layer.', static::ERROR_PHP_IMAGE_VAR_NOT_USED);
161161
}
162162

0 commit comments

Comments
 (0)