Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 5 months ago

#62268 closed defect (bug) (reported-upstream)

Chrome: Unable to upload HEIC image through post editor

Reported by: ironprogrammer's profile ironprogrammer Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.7
Component: Media Keywords: close
Focuses: Cc:

Description

Using Chrome's built-in upload functionality when inserting an HEIC image with the post editor, files of type HEIC are disabled for selection. However, files can be added through drag-n-drop on the Image block, or added through the media library either with the upload or multi-file feature. This issue occurs regardless of server-side HEIC support (i.e. availability of ImageMagick.)

Originally reported at https://github.com/WordPress/twentytwentyfive/issues/583.

Testing Instructions

Steps to Reproduce

  1. In Chrome, add a new post.
  2. Add an Image block, and select "Upload".
  3. 🐞 Observe that HEIC images cannot be selected for upload.

Expected Results

When testing a patch to validate it works as expected:

When reproducing the bug:

  • ❌ HEIC files are not selectable for upload.

Supplemental Artifacts

https://cldup.com/sKhESRAG3l.thumb.png

Attachments (1)

Monosnap Add New Post ‹ My... Website — WordPress 2024-10-21 16-54-44.jpg (46.4 KB) - added by adamsilverstein 6 months ago.

Download all attachments as: .zip

Change History (12)

#1 @adamsilverstein
6 months ago

Hi @ironprogrammer - thanks for opening this. The fix may require an upstream ticket in Gutenberg.

#2 @adamsilverstein
6 months ago

I was able to reproduce this bug in Chrome. Selecting .heic images works as expected in Firefox and Safari in my testing.

#3 @adamsilverstein
6 months ago

Adding "image/heic" to the accepted types for the upload button fixes the issue for me. I made the change in dev tools then was able to select heics.

This will need to change in Gutenberg.

#4 @swissspidy
6 months ago

@adamsilverstein I think this warrants a bug in Chromium, actually.

I just found https://g-issues.chromium.org/issues/355003187, which is for videos, but it shows how the hardcoded image list hasn't been updated to include `image/heic1: https://source.chromium.org/chromium/chromium/src/+/main:net/base/mime_util.cc;l=669-692;drc=2017cd8a8925f180257662f78eaf9eb93e8e394d

Edit: see also https://g-issues.chromium.org/issues/40860796

Last edited 6 months ago by swissspidy (previous) (diff)

#5 @ironprogrammer
6 months ago

Thank you, @adamsilverstein and @swissspidy 🙌🏻

I've reported this upstream on https://github.com/WordPress/gutenberg/issues/66291. Does a 6.7 fix (or workaround) seem feasible here?

#6 @adamsilverstein
6 months ago

Here is a proposed fix for GB https://github.com/WordPress/gutenberg/pull/66292

@adamsilverstein I think this warrants a bug in Chromium, actually.

yeah, it does feel like a bug. Maybe still worth fixing unless it gets fixed in Chrome quickly. I could add a comment in the PR.

Last edited 6 months ago by adamsilverstein (previous) (diff)

#7 @pbiron
6 months ago

I can confirm that FF works on Windows but that Chrome & Edge don't. Chrome and Edge both being based on Chromium suggests that @swissspidy is correct that the bug is in Chromium.

And also agree that a short term workaround in GB is a good idea until the Chromium bug is fixed.

#8 @swissspidy
6 months ago

Opened a new Chromium issue just in case with a suggested fix: https://g-issues.chromium.org/issues/375118901

#9 @ironprogrammer
6 months ago

  • Milestone 6.7 deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Because this has been reported in GB (comment:5) and added to the 6.7 editor board, as well as reported with Chromium (comment:8, thanks, @swissspidy!), I'm marking this with reported-upstream.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


5 months ago

#11 @mayanktripathi32
5 months ago

  • Keywords close added

The upstream issue:https://issues.chromium.org/issues/375118901 has been marked as resolved and is now supported in Chrome Canary. I successfully tested adding HEIC and HEIF images using the images/* MIME type.

Tested Version: 133.0.6846.0 (Official Build) Canary (arm64).

Note: See TracTickets for help on using tickets.