[wp-trac] [WordPress Trac] #57781: Exclude sized variant from SRCSET if larger in file size than the original image
WordPress Trac
noreply at wordpress.org
Tue Feb 21 13:01:57 UTC 2023
#57781: Exclude sized variant from SRCSET if larger in file size than the original
image
-------------------------+-----------------------------
Reporter: abitofmind | Owner: adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 6.1.1
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
== Problem
Every here and then some anomalies may occur where a sized image variant,
which is smaller in image dimensions than its original, may nevertheless
be larger in file size than the original. Some examples were shown in
#57238.
== Scope
The goal of #57238 is to improve the rulesets/algorithm that this is less
likely to happen. And continue to improve if new edge cases get reported.
WP Media has no mechanism to alter the outcome of the sized image variants
(e.g. multi pass optimization like rerun with different parameters until
sized version is smaller in file size).
But if that situation nevertheless happens there is still an easy "last
safety net" we can make use of.
== Goal of this very ticket
- The original will always be better in quality (natural law, unless a
sized variant gets improved by artificial intelligence).
- If a sized variant is larger in file size than the original, it makes no
sense to offer it, hence exclude it from the SRCSET.
- Possibly not only the first sized variant may be larger in file size,
but potentially more (was the case in #57238). All those variants shall be
excluded.
== Extra goal
If such an incident is detected on a real world WordPress instance, it
would be ideal if the WordPress dev team could learn from it and
potentially improve the algorithm accordingly.
Ideas:
- In WordPress > Settings > Media
- [√] Allow to send analytical data when image optimizations fails
- In WordPress > Dashboard > Site Health: Hint + action links
- "We detected X images where the smaller sized responsive images were
larger than the original."
- __Show affected images__ and __Report to WordPress team to improve the
image optimizations__.
- For both situations we would need a "show me more" disclaimer text,
which would be like:
> Note: WordPress has clever responsive image algorithms. Still
occasionally there may be a situation where a very optimized original
results in resized images which oddly are larger in file size. With this
check you allow to transmit the URLs of such affected images to the
WordPress development team, so that we can study them and improve
WordPress accordingly. The images will be purely used for analytical
purposes and your image rights remain unaffected. No other data than the
URLs of the images get transmitted.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57781>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list