Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #33642, comment 36


Ignore:
Timestamp:
02/24/2016 05:05:31 AM (8 years ago)
Author:
joemcgill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33642, comment 36

    initial v1  
    11[attachment:33642.4.patch] renames the `_resize()` method from [attachment:33642.3.patch] to `thumbnail_image()`.
    22
    3 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.
     3I've added feature detection for `getimagedepth()`, `setimagedepth()`, `setinterlacescheme()`, and `unsharpmaskimage()` to in the `test()` method and a conditional check for the `Imagick::getImageAlphaChannel()` method before using it since it's not available on older versions ImageMagick and the functionality is not a requirement for the editor to work.
    44
    55This version no longer sets an sRGB colorspace, since retaining colors is one of the benefits of using ImageMagick over GD.
    66
    7 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.
     7I've kept the 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) handle optimizing images for web (even PNG24s). However, this patch checks to see if the bit depth is greater than 8 before applying the bit depth limit so we don't increase the bit depth of grayscale images that are only using 2–4 bits per channel.
    88
    99I'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.