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
Add checkbox to Media screen to enable multi MIME type output (WebP and JPEG) #525
#524 changes the default behavior of the WebP Uploads module so that it only generates WebP by default, following the core decision, as that is a safer default.
However, the module still offers the alternative approach of generating both WebP and JPEG files. At a high level, this comes with the following tradeoff:
Pro: Better backward/cross compatibility since any use-case where WebP is not supported can still leverage an equivalent JPEG.
Contra: Large filesystem storage needs, since now every size requires two files, effectively almost doubling storage requirements.
While for a WordPress core implementation this decision would likely not be exposed as a user-facing control, for this plugin it makes more sense. It also would be applicable if WebP became a "canonical plugin".
Once #524 has been implemented, we can proceed with this one. It could work as follows:
A new WordPress setting is registered to control whether to output both WebP and JPEG (e.g. generate_webp_and_jpeg), which could be a simple boolean value.
A UI control (checkbox) for the setting could be added under "Settings > Media" in the "Uploads" section.
Label could be Generate JPEG files in addition to WebP
It would be good to add a brief description below that explains the tradeoffs, e.g. Enabling JPEG in addition to WebP can improve compatibility, but will effectively double the filesystem storage use of your images.
@eugene-manuilov I see you self assigned this, but since #524 requires a lot more attention than we though, it would probably be best to focus on that.
Activity
felixarntz commentedon Sep 12, 2022
@bethanylang Would you mind reviewing the suggested wording for the UI here?
mxbclang commentedon Sep 14, 2022
@felixarntz Language LGTM!
felixarntz commentedon Sep 14, 2022
@eugene-manuilov I see you self assigned this, but since #524 requires a lot more attention than we though, it would probably be best to focus on that.
Maybe someone else could pick up this issue here? While it's technically blocked by #524, I'd say we could already start the PR here, since the only change here that would interfere with #524 should be the logic in
webp_uploads_get_upload_image_mime_transforms()(see https://github.com/WordPress/performance/pull/527/files#diff-1f653bd37f60a6476485a6794f7003a91b3713868c7414588d5835332fe68642R17). Let's get this started, just not merge it prior to completing #524.eugene-manuilov commentedon Sep 14, 2022
Yep, sounds good to me, @felixarntz. Unassigned myself.
mehulkaklotar commentedon Sep 21, 2022
Work done
generate_webp_and_jpeg-> boolean valuewebp_uploads_upload_image_mime_transformsto image/jpeg and image/webp if thegenerate_webp_and_jpegis trueRemaining work(After #524 is merged)