Automatic conversion of HEIC images to JPEG in WordPress 6.7

In WordPress 6.7, HEIC image uploads will be automatically converted to JPEG on the server when possible.

This allows you to view HEIC images in WP Adminadmin (and super admin) and use them in posts
and pages regardless of whether a visitor’s browser supports HEIC. Browser support for HEIC is low while the occurrence of HEIC images is common as they are the default storage format used by Apple devices.

 
The original HEIC image can be downloaded via a link on the attachment page.

Screenshot of an attachment in WordPress with 'Original image' field circled

Conversion is only done if the server has a version of Imagick that supports HEIC. You can see whether a server supports HEIC in Tools → Site Health → Info → Media Handling → ImageMagick supported file formats.

Screenshot of the 'ImageMagick supported file formats' field in WordPress

If conversion is not possible, a warning is displayed to the user encouraging them to manually convert the image to JPEG. This was the default behaviour prior to WordPress 6.7.

Screenshot of an error message in WordPress informing the user that the image cannot be displayed in a browser

Automatic conversion of HEIC images to JPEG can be disabled using the image_editor_output_format filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output..

add_filter( 'image_editor_output_format', function( $output_format ) {
    unset( $output_format['image/heic'] );
    return $output_format;
} );

#6-7 #core-media #dev-note #dev-notes #dev-notes-6-7