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. |
Would you like to work on a separate PR for this @b1ink0? |
Thanks @adamsilverstein. On trunk the server still converts the main file on upload, so with this PR the client path already ends with So I'd add the fix to #16119 and WordPress/gutenberg#87135 since they land together. Does that work for you? |
…tisite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This change failed Since #66681, a sub-size sideload is allowed in the image's output format even when the network's "Upload file types" leave it out. That check only counted a format different from the attachment's MIME type. In the test, The check now also allows the attachment's own format, which is the format the server saves its sub-sizes in. Fixed in 6e37303. |
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.On multisite, the sub-size sideload check from #66681 now also allows the attachment's own format, since a main file the server already converted no longer reports a different output format.
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.