WordPress.org

Make WordPress Core

Ticket #40415: 40415.diff

File 40415.diff, 1.1 KB (added by ajoah, 22 months ago)

Change default imagick filter + add a WP filter

  • src/wp-includes/class-wp-image-editor-imagick.php

     
    289289         * @param bool   $strip_meta  Optional. Strip all profiles, excluding color profiles, from the image. Default true.
    290290         * @return bool|WP_Error
    291291         */
    292         protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIANGLE', $strip_meta = true ) {
     292        protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_HAMMING', $strip_meta = true ) {
    293293                $allowed_filters = array(
    294294                        'FILTER_POINT',
    295295                        'FILTER_BOX',
     
    309309                );
    310310
    311311                /**
     312                 * Filters to choose another resizing filter
     313                 *
     314                 * @param string $filter_name Filter name. Default 'FILTER_HAMMING';
     315                 */
     316                $filter_name = apply_filters( 'imagick_resize_filter', $filter_name );
     317
     318                /**
    312319                 * Set the filter value if '$filter_name' name is in our whitelist and the related
    313320                 * Imagick constant is defined or fall back to our default filter.
    314321                 */