Make WordPress Core


Ignore:
Timestamp:
11/06/2024 12:45:48 AM (3 months ago)
Author:
peterwilsoncc
Message:

Media: Fix uploading of .heic images.

  • Adds support for all HEIC/HEIF mime types: image/heic, image/heif, image/heic-sequence, and image/heif-sequence.
  • Introduces wp_is_heic_image_mime_type().

This backport includes a subsequent fix of a typo.

Reviewed by peterwilsoncc.
Merges [59315,59358] to the 6.7 branch.

Props swissspidy, adamsilverstein, debarghyabanerjee, ironprogrammer, peterwilsoncc, apermo, azaozz, mosne.
Fixes #62272.

Location:
branches/6.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.7

  • branches/6.7/src/wp-includes/class-wp-image-editor-imagick.php

    r59247 r59360  
    272272         * are properly sized without affecting previous `getImageGeometry` behavior.
    273273         */
    274         if ( ( ! $width || ! $height ) && ( 'image/avif' === $this->mime_type || 'image/heic' === $this->mime_type ) ) {
     274        if ( ( ! $width || ! $height ) && ( 'image/avif' === $this->mime_type || wp_is_heic_image_mime_type( $this->mime_type ) ) ) {
    275275            $size   = wp_getimagesize( $this->file );
    276276            $width  = $size[0];
Note: See TracChangeset for help on using the changeset viewer.