mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 15:16:59 +00:00
Media: enable AVIF support.
Add support for uploading, editing and saving AVIF images when supported by the server. Add 'image/avif' to supported mime types. Correctly identify AVIF images and sizes even when PHP doesn't support AVIF. Resize uploaded AVIF files (when supported) and use for front end markup. Props adamsilverstein, lukefiretoss, ayeshrajans, navjotjsingh, Tyrannous, jb510, gregbenz, nickpagz, JavierCasares, mukesh27, yguyon, swissspidy. Fixes #51228. git-svn-id: https://develop.svn.wordpress.org/trunk@57524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3336,7 +3336,9 @@ function gd_edit_image_support($mime_type) {
|
||||
return (imagetypes() & IMG_GIF) != 0;
|
||||
case 'image/webp':
|
||||
return (imagetypes() & IMG_WEBP) != 0;
|
||||
}
|
||||
case 'image/avif':
|
||||
return (imagetypes() & IMG_AVIF) != 0;
|
||||
}
|
||||
} else {
|
||||
switch( $mime_type ) {
|
||||
case 'image/jpeg':
|
||||
@@ -3347,6 +3349,8 @@ function gd_edit_image_support($mime_type) {
|
||||
return function_exists('imagecreatefromgif');
|
||||
case 'image/webp':
|
||||
return function_exists('imagecreatefromwebp');
|
||||
case 'image/avif':
|
||||
return function_exists('imagecreatefromavif');
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user