Changeset 57524 for trunk/src/wp-includes/functions.php
- Timestamp:
- 02/02/2024 05:46:50 PM (2 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r57509 r57524 3118 3118 'image/tiff' => 'tif', 3119 3119 'image/webp' => 'webp', 3120 'image/avif' => 'avif', 3120 3121 ) 3121 3122 ); … … 3296 3297 * @since 4.7.1 3297 3298 * @since 5.8.0 Added support for WebP images. 3299 * @since 6.5.0 Added support for AVIF images. 3298 3300 * 3299 3301 * @param string $file Full path to the file. … … 3350 3352 $mime = 'image/webp'; 3351 3353 } 3354 3355 /** 3356 * Add AVIF fallback detection when image library doesn't support AVIF. 3357 * 3358 * Detection based on section 4.3.1 File-type box definition of the ISO/IEC 14496-12 3359 * specification and the AV1-AVIF spec, see https://aomediacodec.github.io/av1-avif/v1.1.0.html#brands. 3360 */ 3361 3362 // Divide the header string into 4 byte groups. 3363 $magic = str_split( $magic, 8 ); 3364 3365 if ( 3366 isset( $magic[1] ) && 3367 isset( $magic[2] ) && 3368 'ftyp' === hex2bin( $magic[1] ) && 3369 ( 'avif' === hex2bin( $magic[2] ) || 'avis' === hex2bin( $magic[2] ) ) 3370 ) { 3371 $mime = 'image/avif'; 3372 } 3352 3373 } catch ( Exception $e ) { 3353 3374 $mime = false; … … 3389 3410 'tiff|tif' => 'image/tiff', 3390 3411 'webp' => 'image/webp', 3412 'avif' => 'image/avif', 3391 3413 'ico' => 'image/x-icon', 3392 3414 'heic' => 'image/heic', … … 3510 3532 'ext2type', 3511 3533 array( 3512 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'webp' ),3534 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'webp', 'avif' ), 3513 3535 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'flac', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), 3514 3536 'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
Note: See TracChangeset
for help on using the changeset viewer.