Skip to content

Media: Correct the HEIC upload error message in the Media Library - #12829

Closed
itzmekhokan wants to merge 4 commits into
WordPress:trunkfrom
itzmekhokan:fix/65800-heic-upload-error-message
Closed

Media: Correct the HEIC upload error message in the Media Library#12829
itzmekhokan wants to merge 4 commits into
WordPress:trunkfrom
itzmekhokan:fix/65800-heic-upload-error-message

Conversation

@itzmekhokan

@itzmekhokan itzmekhokan commented Aug 4, 2026

Copy link
Copy Markdown

The Media Library uploader stated that the image "cannot be displayed in a web browser". That is not accurate: HEIC images render fine in Safari and other browsers that support the format.

The message is shown when the server's image editor cannot handle the image/heic mime type, and the same string is sent to every browser. It therefore cannot state whether the visitor's own browser can display the image, only that some browsers cannot.

Reword the first sentence accordingly and keep the existing suggestion to convert to JPEG before uploading.

Trac ticket: https://core.trac.wordpress.org/ticket/65800

Use of AI Tools

N/A


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.


Proposed commit message

Media: Correct the HEIC upload error message.

When a HEIC upload fails, the Media Library reported that "This image cannot be displayed in a web browser." That has not been accurate since [48288] introduced the string: Safari and other browsers render HEIC fine, and because the same message is sent to every browser it cannot describe what the visitor's own browser supports.

The upload fails because the server's image editor cannot process the `image/heic` mime type, so the file is never converted to a web safe format - servers that do support HEIC convert it to JPEG, as of [58849]. Reword the message to name that cause and keep the existing suggestion to convert to JPEG. The `unsupported_image` string is only shown for queued HEIC files, so naming the format explicitly does not affect other uploads; WebP and AVIF continue to use `noneditable_image`.

See related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/81123.

Follow-up to [48288].

Props khokansardar, annezazu.
Fixes #65800.

The Media Library uploader stated that the image "cannot be displayed
in a web browser". That is not accurate: HEIC images render fine in
Safari and other browsers that support the format.

The message is shown when the server's image editor cannot handle the
`image/heic` mime type, and the same string is sent to every browser.
It therefore cannot state whether the visitor's own browser can display
the image, only that some browsers cannot.

Reword the first sentence accordingly and keep the existing suggestion
to convert to JPEG before uploading.

Fixes #65800.
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props khokansardar, adamsilverstein, annezazu.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@t-hamano
t-hamano requested review from adamsilverstein and a lite review from Copilot August 4, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready to approve

The change is a straightforward copy correction with only a minor optional punctuation tweak suggested in review comments.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Updates the Media Library uploader’s HEIC-related warning copy to avoid incorrectly asserting that the image “cannot be displayed in a web browser,” aligning the message with the reality that browser support varies.

Changes:

  • Rewords the first sentence of the unsupported_image Plupload localization string to indicate the image may not display in all browsers.
  • Keeps the existing recommendation to convert the image to JPEG before uploading.
File summaries
File Description
src/wp-includes/script-loader.php Adjusts the Plupload unsupported_image localized error string shown during uploads.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread src/wp-includes/script-loader.php Outdated
Comment thread src/wp-includes/script-loader.php Outdated

@adamsilverstein adamsilverstein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the string to reflect the actual problem.

The message is shown when the server's image editor cannot handle
image/heic, so it should name that cause rather than browser support.

@adamsilverstein adamsilverstein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@annezazu

annezazu commented Aug 4, 2026

Copy link
Copy Markdown

Thanks for working on this! This is fine to commit as it is a marked improvement.

With that said, it doesn't address or match the error message one sees in the block editor. In particular, it doesn't point people to using a different browser or talk about how if they use a different browser, it would work. I would like to see this addressed beyond just correcting the wrong info in the current error message, in line with the PR happening here: WordPress/gutenberg#81130

@adamsilverstein

Copy link
Copy Markdown
Member

Thanks for working on this! This is fine to commit as it is a marked improvement.

Will do!

With that said, it doesn't address or match the error message one sees in the block editor. In particular, it doesn't point people to using a different browser or talk about how if they use a different browser, it would work. I would like to see this addressed beyond just correcting the wrong info in the current error message, in line with the PR happening here: WordPress/gutenberg#81130

Ah good point!

For 7.2 I'm hoping to land client side media uploading in the media library, which would let us leverage the same error messages from WordPress/gutenberg#81130 directly. See:

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 63013
GitHub commit: 5bb4b68

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants