From 331f0d038aaab56f86c202696a9fea2586fcf919 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 5 Nov 2019 20:56:25 +0000 Subject: [PATCH] Media: Remove the variable number (from the big image threshold value) when generating file names for scaled images. This makes it easier to "calculate" the full size file name from the name of an intermediate size image. Props ianmjones, azaozz. Merges [46658] to the 5.3 branch. Fixes #48453. git-svn-id: https://develop.svn.wordpress.org/branches/5.3@46659 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/image.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 475f2867b2..4f6a38ebf7 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -271,9 +271,9 @@ function wp_create_image_subsizes( $file, $attachment_id ) { } if ( ! is_wp_error( $resized ) ) { - // Append the threshold size to the image file name. It will look like "my-image-scaled-2560.jpg". + // Append "-scaled" to the image file name. It will look like "my_image-scaled.jpg". // This doesn't affect the sub-sizes names as they are generated from the original image (for best quality). - $saved = $editor->save( $editor->generate_filename( 'scaled-' . $threshold ) ); + $saved = $editor->save( $editor->generate_filename( 'scaled' ) ); if ( ! is_wp_error( $saved ) ) { $image_meta = _wp_image_meta_replace_original( $saved, $file, $image_meta, $attachment_id );