diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index b2664264e9..ca96e47ce1 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -287,11 +287,6 @@ function wp_create_image_subsizes( $file, $attachment_id ) { if ( true === $rotated && ! empty( $image_meta['image_meta']['orientation'] ) ) { $image_meta['image_meta']['orientation'] = 1; } - - // Initial save of the new metadata when the original image was scaled. - // At this point the file was uploaded and moved to the uploads directory - // but the image sub-sizes haven't been created yet and the `sizes` array is empty. - wp_update_attachment_metadata( $attachment_id, $image_meta ); } else { // TODO: log errors. } @@ -322,18 +317,17 @@ function wp_create_image_subsizes( $file, $attachment_id ) { if ( ! empty( $image_meta['image_meta']['orientation'] ) ) { $image_meta['image_meta']['orientation'] = 1; } - - // Initial save of the new metadata when the original image was rotated. - wp_update_attachment_metadata( $attachment_id, $image_meta ); } else { // TODO: log errors. } } - } else { - // Initial save of the new metadata when the image was not scaled or rotated. - wp_update_attachment_metadata( $attachment_id, $image_meta ); } + // Initial save of the new metadata. + // At this point the file was uploaded and moved to the uploads directory + // but the image sub-sizes haven't been created yet and the `sizes` array is empty. + wp_update_attachment_metadata( $attachment_id, $image_meta ); + $new_sizes = wp_get_registered_image_subsizes(); /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 1a4410ccb6..52b8b0ae38 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-alpha-46650'; +$wp_version = '5.4-alpha-46651'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.