Media: Allow HEIC/HEIF sequence uploads when the server lacks editor support - #13042
Draft
adamsilverstein wants to merge 1 commit into
Draft
Media: Allow HEIC/HEIF sequence uploads when the server lacks editor support#13042adamsilverstein wants to merge 1 commit into
adamsilverstein wants to merge 1 commit into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
adamsilverstein
force-pushed
the
add/heic-sequence-upload-bypass
branch
from
August 13, 2026 17:53
847635b to
7e7f1c1
Compare
…support. Extends the HEIC/HEIF upload bypass to the multi-frame '-sequence' variants (Apple Live Photos, Android bursts), which were previously rejected with a 'rest_upload_image_type_not_supported' error. Rejecting them is inconsistent with the rest of the pipeline: wp_check_filetype_and_ext() renames a '.heics' upload to '.heic' and records it as 'image/heic', so a file this check turns away is one the very next step would have treated as an ordinary still. Uses the existing wp_is_heic_image_mime_type() helper, which already covers all four mime types, in place of the hardcoded still-only list. See related Gutenberg work: WordPress/gutenberg#79647. Fixes #65873. See #64915.
adamsilverstein
force-pushed
the
add/heic-sequence-upload-bypass
branch
from
August 13, 2026 17:58
7e7f1c1 to
f2ad243
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket: https://core.trac.wordpress.org/ticket/65873
What
Extends the HEIC/HEIF upload bypass added in #64915 to the multi-frame
-sequencevariants:image/heic-sequenceandimage/heif-sequence, which is what Apple Live Photos and Android bursts are.Today those are rejected with
rest_upload_image_type_not_supportedwhen the server's image editor cannot handle them, which is most servers.Why
The original exclusion was correct when it was written - the comment says the sequence variants are skipped because "neither the server nor the browser fallback can process them yet". The browser half of that has changed: WordPress/gutenberg#79647 demuxes a sequence and decodes its first frame in the browser, uploading that still in its place, so a capable browser never reaches this check at all.
More to the point, rejecting them is inconsistent with what the rest of the pipeline does with the same bytes.
wp_check_filetype_and_ext()renames a.heicsupload to.heicand rewrites its type toimage/heic, verified against a real 120-frame sequence:So a file this permissions check turns away is one the very next step would have relabelled as an ordinary still HEIC - a mime type the same check already allows. The bytes are stored unchanged either way; only the label differs.
Approach
Uses the existing
wp_is_heic_image_mime_type()helper, which already returns true for all four mime types, in place of the hardcoded still-only array. This is what #64915 originally proposed before it was narrowed. Net 7 lines removed from the source.Testing instructions
add_filter( 'wp_image_editors', '__return_empty_array' );.heicsfile (or any file sent asimage/heic-sequence) throughPOST /wp/v2/media.rest_upload_image_type_not_supported; after it, the attachment is created.The existing unit test asserting the old behavior is removed, and the sequence mime types are folded into the data provider for the bypass test so one case covers all four:
AI Use
Claude Code wrote this patch and the description. I will review and test.