Make WordPress Core


Ignore:
Timestamp:
02/02/2024 05:46:50 PM (16 months ago)
Author:
adamsilverstein
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r57302 r57524  
    34653465    $matches    = array();
    34663466    $ext        = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;
    3467     $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'webp' );
     3467    $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'webp', 'avif' );
    34683468
    34693469    // Don't convert smilies that aren't images - they're probably emoji.
Note: See TracChangeset for help on using the changeset viewer.