Skip to content
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

Introduce webp_uploads_prefer_smaller_image_file filter allowing to opt in to preferring the smaller image file #287

Merged
merged 3 commits into from Apr 14, 2022

Conversation

felixarntz
Copy link
Member

Summary

Fixes #286

Relevant technical choices

  • A simpler solution would have been to just remove the add_filter call to the new function, but that would make it much less intuitive for developers, and they would need to use this "generic" filter, and remember the name of our "internal" function.
  • A dedicated filter is much more intuitive and easy to use.
  • I chose webp_uploads_prefer_smaller_image_file for the filter name for now.

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

…preferring the smaller image file regardless of MIME type.
@felixarntz felixarntz added [Type] Enhancement A suggestion for improvement of an existing feature [Focus] Images Issues related to the Images focus area [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) labels Apr 8, 2022
@felixarntz felixarntz added this to the 1.0.0 milestone Apr 8, 2022
Copy link
Member

@adamsilverstein adamsilverstein left a comment

Choose a reason for hiding this comment

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

left some small feedback points

@adamsilverstein adamsilverstein self-requested a review April 14, 2022 16:24
@felixarntz felixarntz merged commit faa8156 into trunk Apr 14, 2022
@felixarntz felixarntz deleted the enhancement/smaller-image-file-optin branch April 14, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Images Issues related to the Images focus area [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only use smaller file size based on opt-in since it is not part of the core feature scope
3 participants