Make WordPress Core


Ignore:
Timestamp:
02/02/2024 05:46:50 PM (2 years 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/class-wp-theme.php

    r56978 r57524  
    12641264        }
    12651265
    1266         foreach ( array( 'png', 'gif', 'jpg', 'jpeg', 'webp' ) as $ext ) {
     1266        foreach ( array( 'png', 'gif', 'jpg', 'jpeg', 'webp', 'avif' ) as $ext ) {
    12671267            if ( file_exists( $this->get_stylesheet_directory() . "/screenshot.$ext" ) ) {
    12681268                $this->cache_add( 'screenshot', 'screenshot.' . $ext );
Note: See TracChangeset for help on using the changeset viewer.