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.
Fixes #48453 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@46658 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2019-11-05 20:51:12 +00:00
parent 4a729f0498
commit 63d4dcd10a

View File

@ -276,9 +276,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 );