From c424187b6e94003095eb623c1ee7159ab5122eaa Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 21 Oct 2019 21:41:09 +0000 Subject: [PATCH] Media/Upload: When the users upload big images and WordPress creates a scaled image to use as the largest size, append `scaled-` to the file names of the scaled images to make them easier to recognize. Props kraftbj, azaozz. Fixes #48304. git-svn-id: https://develop.svn.wordpress.org/trunk@46565 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 53d9043402..d58bdc88f6 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -263,9 +263,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-2560.jpg". + // Append the threshold size to the image file name. It will look like "my-image-scaled-2560.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( $threshold ) ); + $saved = $editor->save( $editor->generate_filename( 'scaled-' . $threshold ) ); if ( ! is_wp_error( $saved ) ) { $image_meta = _wp_image_meta_replace_original( $saved, $file, $image_meta, $attachment_id );