- Timestamp:
- 08/28/2020 04:43:31 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r48799 r48905 914 914 915 915 /** 916 * Determines whether the value is an acceptable type for GD image functions.917 *918 * In PHP 8.0, the GD extension uses GdImage objects for its data structures.919 * This function checks if the passed value is either a resource of type `gd`920 * or a GdImage object instance. Any other type will return false.921 *922 * @since 5.6.0923 *924 * @param resource|GdImage|false $image A value to check the type for.925 * @return bool True if $image is either a GD image resource or GdImage instance,926 * false otherwise.927 */928 function is_gd_image( $image ) {929 if ( is_resource( $image ) && 'gd' === get_resource_type( $image )930 || is_object( $image ) && $image instanceof GdImage931 ) {932 return true;933 }934 935 return false;936 }937 938 /**939 916 * Load an image resource for editing. 940 917 * -
trunk/src/wp-includes/media.php
r48855 r48905 3460 3460 3461 3461 /** 3462 * Determines whether the value is an acceptable type for GD image functions. 3463 * 3464 * In PHP 8.0, the GD extension uses GdImage objects for its data structures. 3465 * This function checks if the passed value is either a resource of type `gd` 3466 * or a GdImage object instance. Any other type will return false. 3467 * 3468 * @since 5.6.0 3469 * 3470 * @param resource|GdImage|false $image A value to check the type for. 3471 * @return bool True if $image is either a GD image resource or GdImage instance, 3472 * false otherwise. 3473 */ 3474 function is_gd_image( $image ) { 3475 if ( is_resource( $image ) && 'gd' === get_resource_type( $image ) 3476 || is_object( $image ) && $image instanceof GdImage 3477 ) { 3478 return true; 3479 } 3480 3481 return false; 3482 } 3483 3484 /** 3462 3485 * Create new GD image resource with transparency support 3463 3486 *
Note: See TracChangeset
for help on using the changeset viewer.