You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Only use smaller file size based on opt-in since it is not part of the core feature scope #286
Follow-up to #186: While this enhancement certainly makes sense here, we need to consider that the WebP by default implementation for WordPress core as of now is not going to select the smaller file size, as that implementation doesn't even store file sizes for the generated images.
Due to this, I would advise we make this enhancement opt-in at this point, since otherwise it would explicitly behave differently from the core implementation, which to a degree would defeat the primary purpose of this plugin which is testing future core features. It may be that we eventually decide to add this to the core implementation, at which point we could change it to be enabled by default here as well, but right now this is clearly different behavior, so I think we should keep this piece as opt-in.
I suggest we add a filter to enable it, e.g. webp_uploads_prefer_smaller_file.
as that implementation doesn't even store file sizes for the generated images.
Note that the current core implementation/patch does include file size (via the new wp_filesize) data. Still I would be in favor of a filter to control the behavior.
This might be important behavior to include especially after confirming that (especially full sized) WebP versions of JPEG uploads might be larger than the original.
Activity
adamsilverstein commentedon Apr 8, 2022
Note that the current core implementation/patch does include file size (via the new
wp_filesize) data. Still I would be in favor of a filter to control the behavior.This might be important behavior to include especially after confirming that (especially full sized) WebP versions of JPEG uploads might be larger than the original.