[wp-trac] [WordPress Trac] #28154: Add get_quality() method for WP_Image_Editor class
WordPress Trac
noreply at wordpress.org
Sun Jun 8 20:10:09 UTC 2014
#28154: Add get_quality() method for WP_Image_Editor class
----------------------------------------+------------------------------
Reporter: alexvorn2 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+------------------------------
Changes (by markoheijnen):
* keywords: reporter-feedback dev-feedback 2nd-opinion => has-patch needs-
unit-tests
Comment:
We don't know what the original image quality is so your use case will not
apply. The bad assumption here would be that the software knows what to do
with it.
In the current patch I moved some code around. Reason for this is when we
add get_quality() people would be also starting to use set_quality() more.
The problem is that when someone uses on of our filters, the filter would
always win. Now the default quality value would only be used when no one
had set the quality before.
It also abstracts $this->quality away that it's only used in
WP_Image_Editor. For now the property stays protected due backwards
compatibility. I was thinking about a __get() method which sets the value
when $this->quality is false.
I will check if we have unit tests for this and add them in case we don't
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28154#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list