X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/af50974463450c98503e763a7836a50e260461a9..ac7339a398e6df50f722bc9616291ce5447d8e5e:/wp-includes/class-wp-image-editor-imagick.php diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 843b85c5..a70bebda 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -190,6 +190,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * * @param int $width * @param int $height + * + * @return true|WP_Error */ protected function update_size( $width = null, $height = null ) { $size = null; @@ -299,8 +301,9 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { } $resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] ); + $duplicate = ( ( $orig_size['width'] == $size_data['width'] ) && ( $orig_size['height'] == $size_data['height'] ) ); - if( ! is_wp_error( $resize_result ) ) { + if ( ! is_wp_error( $resize_result ) && ! $duplicate ) { $resized = $this->_save( $this->image ); $this->image->clear(); @@ -327,7 +330,6 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { * @since 3.5.0 * @access public * - * @param string|int $src The source file or Attachment ID. * @param int $src_x The start x position to crop from. * @param int $src_y The start y position to crop from. * @param int $src_w The width to crop.