Opened 7 weeks ago
Last modified 6 weeks ago
#61925 new defect (bug)
subsizes with same dimensions are generated multiple times unnecessarily
Reported by: | kkmuffme | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
https://github.com/WordPress/wordpress-develop/blob/6.6/src/wp-admin/includes/image.php#L461
_wp_make_subsizes
will generate the same file with same dimensions multiple times if multiple sizes with the same dimensions/crop are registered.
This unnecessarily slows down the uploads and often is a cause for timeouts too, if there are many sizes registered.
e.g. with WooCommerce where "woocommerce_gallery_thumbnail" might be equal to wp "thumbnail" size.
I checked trac, but couldn't find a related issue, in case there's one please close this one.
Change History (2)
#2
@
6 weeks ago
But for the new image I can only see one image in uploads with dimension 800X600.
Sorry, but obviously. How would you be able to see multiple files with the same name?
It generates the same 800x600 file multiple times.
Your replication is correct except that you incorrectly check the result. Set a breakpoint at the referenced line and you'll see that it recreates the image multiple times for 800x600
Hii @kkmuffme ,
I tried to replicate the issue but was not able to.
These are the steps I followed:
Can you please specify the steps to replicate this?
Thanks.