[wp-trac] [WordPress Trac] #24380: Missing Compression Parameter in WP_Image_Editor_GD

WordPress Trac noreply at wordpress.org
Thu May 1 11:19:32 UTC 2014


#24380: Missing Compression Parameter in WP_Image_Editor_GD
------------------------------------------+-----------------------------
 Reporter:  MuViMoTV                      |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Media                         |     Version:  3.5.1
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch commit 2nd-opinion  |     Focuses:
------------------------------------------+-----------------------------
Changes (by mikemanger):

 * keywords:  has-patch 3.9-early commit => has-patch commit 2nd-opinion


Comment:

 I feel that whilst converting 1-100 to 9-0 is technically correct, it is a
 bit confusing and could have some unwanted results (the default value for
 `quality` is 90 which would give the worst compression, not the best).

 I have updated the GD class to convert quality from 1-100 to 0-9, the code
 (I hope) reads a bit better and as a bonus this better matches how the
 [http://www.imagemagick.org/script/command-line-options.php#quality
 ImageMagick library functions]. The main difference is that if a value of
 1-10 is set then no compression is applied to the image.

 To accompany `jpeg_quality`, I have also added a new filter called
 `png_compression_level` in the main WP_Image_Editor class.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/24380#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list