[wp-trac] [WordPress Trac] #53668: Thumbnails clobbered as results of image_editor_output_format filter not factored into wp_unique_filename
WordPress Trac
noreply at wordpress.org
Thu Jul 15 14:13:12 UTC 2021
#53668: Thumbnails clobbered as results of image_editor_output_format filter not
factored into wp_unique_filename
--------------------------+-----------------------------
Reporter: ianmjones | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
When two images with same base file name but different extensions are
added to the Media Library within the same month and both have thumbnails
changed to same format by the `image_editor_output_format` filter, their
thumbnails are perpetually confused!
Steps to reproduce:
1. Add following filter to site that converts thumbnails to WebP for both
jpeg and png source files.
{{{
add_filter( 'image_editor_output_format', function( $formats ) {
$formats['image/jpeg'] = 'image/webp';
$formats['image/png'] = 'image/webp';
return $formats;
} );
}}}
2. Add "picture.jpg" and "picture.png" to Media Library within a month.
3. Notice that thumbnails for second upload clobber thumbnails of first,
e.g. "picture-150x150.webp" shared by both images.
4. "Permanently delete" one of the images from the Media Library and all
intersecting thumbnails used by the other Media Library item will
disappear.
See attached screenshots for example.
I think `wp_unique_filename` needs to take into account all thumbnails
that are to be generated for the new upload.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53668>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list