close
The Wayback Machine - https://web.archive.org/web/20220720233235/https://github.com/WordPress/performance/pull/287
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

@felixarntz felixarntz commented Apr 8, 2022

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 [Focus] Images [Module] WebP Uploads labels Apr 8, 2022
@felixarntz felixarntz added this to the 1.0.0 milestone Apr 8, 2022
@felixarntz felixarntz requested review from jjgrainger and mitogh Apr 8, 2022
mitogh
mitogh approved these changes Apr 8, 2022
Copy link
Member

@adamsilverstein adamsilverstein left a comment

left some small feedback points

@adamsilverstein adamsilverstein self-requested a review Apr 14, 2022
@felixarntz felixarntz merged commit faa8156 into trunk Apr 14, 2022
5 checks passed
@felixarntz felixarntz deleted the enhancement/smaller-image-file-optin branch Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Images [Module] WebP Uploads [Type] Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants