diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index f413387233..ee12b401d9 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -503,6 +503,10 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { $size_data['crop'] = false; } + if ( ( $this->size['width'] == $size_data['width'] ) && ( $this->size['height'] == $size_data['height'] ) ) { + return new WP_Error( 'image_subsize_create_error', __( 'The image already has the requested size.' ) ); + } + $resized = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] ); if ( is_wp_error( $resized ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 61c5672171..27efe79cec 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55277'; +$wp_version = '6.2-alpha-55278'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.