From c77348a006abf08339558e2384dfc6dee80bf4aa Mon Sep 17 00:00:00 2001 From: arthur791004 Date: Thu, 4 Jul 2024 15:53:19 +0900 Subject: [PATCH] MU WPCOM: Support HEIF/HEIC on simple sites (#38188) * MU WPCOM: Support HEIF/HEIC on simple sites * changelog --- .../jetpack-mu-wpcom/changelog/mu-wpcom-heif-support | 4 ++++ .../src/features/media/heif-support.php | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-heif-support diff --git a/projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-heif-support b/projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-heif-support new file mode 100644 index 0000000000000..fc8bb626b2f63 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/mu-wpcom-heif-support @@ -0,0 +1,4 @@ +Significance: minor +Type: added + +MU WPCOM: Allow simple sites to upload the heif images diff --git a/projects/packages/jetpack-mu-wpcom/src/features/media/heif-support.php b/projects/packages/jetpack-mu-wpcom/src/features/media/heif-support.php index 76b071b9085fc..78cfbc548cbce 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/media/heif-support.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/media/heif-support.php @@ -174,11 +174,12 @@ function jetpack_wpcom_add_heif_mimes_to_supported_upload_types( $mimes ) { if ( ! class_exists( 'Photon_OpenCV' ) ) { return $mimes; } - // Only need to modify 'upload_mimes' on Atomic. - if ( defined( 'IS_ATOMIC' ) && IS_ATOMIC ) { - $mimes['heif'] = 'image/heif'; - $mimes['heic'] = 'image/heic'; - } + + $mimes['heif'] = 'image/heif'; + + // HEIC is supported by default, so maybe we don't need it anymore. + // See https://github.com/WordPress/wordpress-develop/blob/80b7747ef165dd5ed0150003a8c2f957f097609e/src/wp-includes/functions.php#L3416. + $mimes['heic'] = 'image/heic'; return $mimes; } add_filter( 'upload_mimes', 'jetpack_wpcom_add_heif_mimes_to_supported_upload_types' );