WordPress.org

Make WordPress Core

Ticket #22663: 22663.update_size.diff

File 22663.update_size.diff, 614 bytes (added by DH-Shredder, 2 years ago)
  • wp-includes/class-wp-image-editor-imagick.php

    diff --git wp-includes/class-wp-image-editor-imagick.php wp-includes/class-wp-image-editor-imagick.php
    index 03485b5..bd49fdd 100644
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    197197                if ( ! $height ) 
    198198                        $height = $size['height']; 
    199199 
     200                try { 
     201                        $this->image->setImagePage( $width, $height, 0, 0 ); 
     202                } 
     203                catch ( Exception $e ) { 
     204                        return new WP_Error( 'image_update_size_error', __('Could not update image size') ); 
     205                } 
     206 
    200207                return parent::update_size( $width, $height ); 
    201208        } 
    202209