Changeset 50810 for trunk/src/wp-admin/includes/image.php
- Timestamp:
- 05/04/2021 02:43:36 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r50552 r50810 517 517 case 'image/png': 518 518 $ext = '.png'; 519 break; 520 case 'image/webp': 521 $ext = '.webp'; 519 522 break; 520 523 } … … 914 917 */ 915 918 function file_is_displayable_image( $path ) { 916 $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO );919 $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO, IMAGETYPE_WEBP ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound 917 920 918 921 $info = wp_getimagesize( $path ); … … 963 966 case 'image/gif': 964 967 $image = imagecreatefromgif( $filepath ); 968 break; 969 case 'image/webp': 970 $image = false; 971 if ( function_exists( 'imagecreatefromwebp' ) ) { 972 $image = imagecreatefromwebp( $filepath ); 973 } 965 974 break; 966 975 default:
Note: See TracChangeset
for help on using the changeset viewer.