[wp-trac] [WordPress Trac] #25721: Consolidate a couple of filters to the WP_Image_Editor base class

WordPress Trac noreply at wordpress.org
Tue Nov 26 19:31:07 UTC 2013


#25721: Consolidate a couple of filters to the WP_Image_Editor base class
------------------------------------+------------------------
 Reporter:  markoheijnen            |       Owner:
     Type:  enhancement             |      Status:  reviewing
 Priority:  normal                  |   Milestone:  3.8
Component:  Media                   |     Version:  3.5
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------------

Comment (by DH-Shredder):

 Just wanted to update with progress -- I'm still working on the above.

 It looks like, indeed, the values accepted by both existing editors are
 integers, which means that set_quality accepts one fewer value than
 jpeg_quality, and we can't just do maths to create the appropriate
 equivalent percentage.

 Of note, also, GD creates size-identical images between 0 and 1.

 There are a few options here.
 - Consolidate filter still, and pass only 1-100 back to editors
 - Consolidate filter still, but change set_quality's signature to 0-100,
 and crush 0 within Imagick (this seems less desirable only because the
 meaning of 0 is questionable, when it refers to a quality percentage).
 - Do not consolidate filter, crush within set_quality, and handle
 jpeg_quality appropriately within each editor

 Clearly, if they were defined as floats, this would be easier to
 translate; it's just a bit weirder when we're talking about ints.

 For now, I'm going with the first option, since GD outputs (from all of my
 tests so far) the same image with 0 and 1, minus a header change noting
 the change in quality.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25721#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list