diff --git src/wp-admin/includes/image-edit.php src/wp-admin/includes/image-edit.php
index 4015f30..a00fba1 100644
|
|
|
function wp_save_image( $post_id ) {
|
| 797 | 797 | $success = $delete = $nocrop = true; |
| 798 | 798 | } |
| 799 | 799 | |
| | 800 | /* |
| | 801 | * We need to remove any existing resized image files because |
| | 802 | * a new crop could generate different image file sizes and so |
| | 803 | * different file names, and so the new resized images won't |
| | 804 | * necessarily overwrite the existing resized image files |
| | 805 | * https://core.trac.wordpress.org/ticket/32171 |
| | 806 | */ |
| | 807 | if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { |
| | 808 | foreach ( $meta['sizes'] as $size ) { |
| | 809 | if ( preg_match('/-e[0-9]{13}-/', $size['file'] ) ) { |
| | 810 | $delete_file = path_join( dirname( $new_path ), $size['file'] ); |
| | 811 | wp_delete_file( $delete_file ); |
| | 812 | } |
| | 813 | } |
| | 814 | } |
| | 815 | |
| 800 | 816 | if ( isset( $sizes ) ) { |
| 801 | 817 | $_sizes = array(); |
| 802 | 818 | |