Changeset 59379 for trunk/src/wp-admin/includes/image.php
- Timestamp:
- 11/10/2024 09:40:00 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/image.php
r59366 r59379 342 342 if ( $scale_down ) { 343 343 $saved = $editor->save( $editor->generate_filename( 'scaled' ) ); 344 } elseif ( $convert ) { 345 /* 346 * Generate a new file name for the converted image. 347 * 348 * As the image file name will be unique due to the changed file extension, 349 * it does not need a suffix to be unique. However, the generate_filename method 350 * does not allow for an empty suffix, so the "-converted" suffix is required to 351 * be added and subsequently removed. 352 */ 353 $converted_file_name = $editor->generate_filename( 'converted' ); 354 $converted_file_name = preg_replace( '/(-converted\.)([a-z0-9]+)$/i', '.$2', $converted_file_name ); 355 $saved = $editor->save( $converted_file_name ); 344 356 } else { 345 357 $saved = $editor->save();
Note: See TracChangeset
for help on using the changeset viewer.