]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-image-editor-imagick.php
WordPress 4.2
[autoinstalls/wordpress.git] / wp-includes / class-wp-image-editor-imagick.php
index 843b85c541076983ca21f65c938c60929acbb5bc..a70bebdaebdacf0e29441f694185ad7eddd2c705 100644 (file)
@@ -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.