Repository navigation
Conversation
…upload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
Client side media processing has the same problem through a different path. The |
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. |
When an
image_editor_output_formatfilter converts JPEG to WebP, an uploadedphoto.jpgis saved asphoto.webp, orphoto-scaled.webpfor big images, but the attachment's MIME type staysimage/jpeg. HEIC uploads converted to JPEG keepimage/heicthe same way._wp_image_meta_replace_original()switches the attachment to the new file but did not update its MIME type. It now does when the new file has a different format.The MIME type comes from the
mime-typethe image editor returns when it saves the new image. The post is only updated when it changes.The existing JPEG to WebP and HEIC to JPEG tests now also check the attachment's MIME type.
Trac ticket: https://core.trac.wordpress.org/ticket/53665
Testing Instructions
-scaled.webpand "File type:" showsimage/webp..webpand "File type:" showsimage/webp.Before (large image)

After (large image)

Before (small image)

After (small image)

Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Tracing the upload flow and drafts of the fix and tests. I reviewed, edited and tested the final changes.