diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 37598b2a5e..371552c28c 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -231,8 +231,9 @@ class WP_Image_Editor_GD extends WP_Image_Editor { } $image = $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( $image ) ) { + if ( ! is_wp_error( $image ) && ! $duplicate ) { $resized = $this->_save( $image ); imagedestroy( $image ); diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 5dc326f021..a70bebdaeb 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -301,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(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 287a5b0d66..81b95148f6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31575'; +$wp_version = '4.2-alpha-31576'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.