[wp-trac] [WordPress Trac] #33642: Improve default Imagick compression settings
WordPress Trac
noreply at wordpress.org
Wed Feb 24 04:59:31 UTC 2016
#33642: Improve default Imagick compression settings
-------------------------+------------------------
Reporter: joemcgill | Owner: joemcgill
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.5
Component: Media | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------------
Comment (by joemcgill):
[attachment:33642.4.patch] renames the `_resize()` method from
[attachment:33642.3.patch] to `thumbnail_image()`.
I've added feature detection for `getimagedepth()`, `setimagedepth()`,
`setinterlacescheme()`, and `unsharpmaskimage()` to in the `test()` method
and conditionally checks for the `getImageAlphaChannel()` Imagick method
before applying it since it's not available on older versions ImageMagick
and the functionality is not a requirement for the editor to work.
This version no longer sets an sRGB colorspace, since retaining colors is
one of the benefits of using ImageMagick over GD.
I've limit to 8bits on resized files since this is only being applied to
our resized images and seems to be the default way a few image editors
(including Photoshop) handles optimizing images for web (even PNG24s).
However, this version checks to see if the bit depth is greater than 8
before applying the new bit depth so we don't add bits to a grayscale
image that is only using 2–4 bits per channel.
I've also added a new filter, `image_strip_meta` to override the stripping
of image profiles and properties from resized images. This filter will
only apply to sites using Imagick since GD always strips
profiles/properties from images when resizing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33642#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list