[wp-trac] [WordPress Trac] #49042: After WordPress automatically scales your uploaded images down, it loses track of the original images
WordPress Trac
noreply at wordpress.org
Thu Dec 19 17:02:29 UTC 2019
#49042: After WordPress automatically scales your uploaded images down, it loses
track of the original images
-------------------------------+------------------------------
Reporter: pikamander2 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upload | Version: 5.3
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by azaozz):
* keywords: => reporter-feedback
Comment:
> The best solution here, I think, would be to store the name of the
original file somewhere (if it's not already being stored) and delete it
too when somebody deletes the scaled image.
This is exactly how it works :) The name of the original image is stored
in the image meta, and the image is deleted with the attachment post and
the rest of the image sub-sizes:
https://core.trac.wordpress.org/browser/tags/5.3.2/src/wp-
includes/post.php#L5691.
Unfortunately that's not easy to debug. If you have FTP access to your
site, perhaps try uploading a (large) image 2-3 times and monitor the
uploads directory. Then delete the attachments one by one and see if some
files are left behind. If you have access to the database, can also check
what's saved in the image meta (in the `*_postmeta` table, look for the
latest `_wp_attachment_metadata` meta key after you upload the image).
If not, I'll try to make a quick plugin to expose some of that somewhere
in the admin :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49042#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list