WordPress.org

Make WordPress Core

Ticket #36534: 36534.2.diff

File 36534.2.diff, 1.2 KB (added by joemcgill, 3 years ago)

Use FILTER_BOX during resizing

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

    diff --git src/wp-includes/class-wp-image-editor-imagick.php src/wp-includes/class-wp-image-editor-imagick.php
    index 3d92d39..bd61e1c 100644
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    286286         * @param bool   $strip_meta  Optional. Strip all profiles, excluding color profiles, from the image. Default true.
    287287         * @return bool|WP_Error
    288288         */
    289         protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIANGLE', $strip_meta = true ) {
     289        protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_BOX', $strip_meta = true ) {
    290290                $allowed_filters = array(
    291291                        'FILTER_POINT',
    292292                        'FILTER_BOX',
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    312312                if ( in_array( $filter_name, $allowed_filters ) && defined( 'Imagick::' . $filter_name ) ) {
    313313                        $filter = constant( 'Imagick::' . $filter_name );
    314314                } else {
    315                         $filter = defined( 'Imagick::FILTER_TRIANGLE' ) ? Imagick::FILTER_TRIANGLE : false;
     315                        $filter = defined( 'Imagick::FILTER_BOX' ) ? Imagick::FILTER_TRIANGLE : false;
    316316                }
    317317
    318318                /**