-
Notifications
You must be signed in to change notification settings - Fork 129
Ensure the -scaled
image remains in the original uploaded format
#143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
This was referenced Feb 1, 2022
felixarntz
reviewed
Feb 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just two comments.
mitogh
reviewed
Feb 1, 2022
Additionally if we are going with this route once this is merged we should be able to close: |
Co-authored-by: Crisoforo Gaspar Hernández <hello@crisoforo.com>
Thinking we should generate both, see #142 (comment) |
c0eba71
to
98e1003
Compare
98e1003
to
b223e89
Compare
adamsilverstein
commented
Feb 2, 2022
felixarntz
reviewed
Feb 2, 2022
4e551c8
to
7a2bbe4
Compare
This was referenced Feb 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Plugin] Modern Image Formats
Issues for the Modern Image Formats plugin (formerly WebP Uploads)
[Type] Bug
An existing feature is broken
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.
Summary
When uploading very large images (over the
big_image_size_threshold
filter threshold), WordPress creates a scaled version of the image with the word-scaled
appended to the file name. It stores a reference to the original image in the image metaoriginal_image
field, see this make post for more details.WordPress subsequently uses the "scaled" image as if it were the original in most use cases (only going back to the true original image when editing the image). This causes the mime type shown in the media library for a large jpeg upload to show as image/webp because the scaled image is a WebP.
To fix that, in this PR I skip the
-scaled
image, leaving it in the original format of the uploaded image.This matches the behavior of uploading a smaller image that isn't over the
big_image_size_threshold
, improving consistency.Fixes #67
Relevant technical choices
scaled
image, which WordPress largely treats as the "original" would remain in the mime type of the uploadChecklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.