Determines whether the value is an acceptable type for GD image functions.
Description
In PHP 8.0, the GD extension uses GdImage objects for its data structures.This function checks if the passed value is either a GdImage object instance or a resource of type gd. Any other type will return false.
Parameters
$imageresource|GdImage|false
A value to check the type for.
Return
bool
True if $image is either a GD image resource or a GdImage instance, false otherwise.
4151functionis_gd_image($image){4152if($imageinstanceofGdImage// @phpstan-ignore class.notFound (Only available with PHP8+.)4153||is_resource($image)&&'gd'===get_resource_type($image)4154){4155returntrue;4156}41574158returnfalse;4159}
History
Introduced in 5.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/media.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.