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-admin/includes/media.php

    r57181 r57524  
    21992199    }
    22002200
     2201    // Check if AVIF images can be edited.
     2202    if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/avif' ) ) ) {
     2203        $plupload_init['avif_upload_error'] = true;
     2204    }
     2205
    22012206    /**
    22022207     * Filters the default Plupload settings.
Note: See TracChangeset for help on using the changeset viewer.