[wp-trac] [WordPress Trac] #54648: Improve filter to enable setting quality for each subsize image
WordPress Trac
noreply at wordpress.org
Wed Jan 19 16:06:41 UTC 2022
#54648: Improve filter to enable setting quality for each subsize image
----------------------------------------+------------------------------
Reporter: Mte90 | Owner: adamsilverstein
Type: enhancement | Status: accepted
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: performance
----------------------------------------+------------------------------
Comment (by adamsilverstein):
> As example if the size is 100x100 how I know what is the size name?
Maybe I want to apply it just for thumbnail and I don't care of the size
in pixel at all.
I did consider this, however at the point where we apply the
`wp_editor_set_quality` filter, we don't have the size "name" - only the
dimensions.
In addition, it is possible that more than one size "name" matches the
size dimensions, so we can't really guess for you. This article includes a
code snippet that would let you look up the name if you need that:
https://wordpress.stackexchange.com/questions/243446/get-images-size-name-
from-its-dimension
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54648#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list