#32171 closed defect (bug) (fixed)
Images not removed upon restore when IMAGE_EDIT_OVERWRITE true
Reported by: | bradt | Owned by: | kirasong |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.2.1 |
Component: | Media | Keywords: | has-patch needs-testing has-unit-tests |
Focuses: | administration | Cc: |
Description
With IMAGE_EDIT_OVERWRITE set to true, image edit files are removed when the original image is restored. But in certain cases, leftover image edit files remain.
Steps to reproduce:
- Add
define( 'IMAGE_EDIT_OVERWRITE', true );
to your wp-config.php - Upload an image
- Crop it and save
- Crop it and save again
You'll notice that the second crop overwrote the 150x150 intermediate image, created some new intermedia images, and left some intermediate images from the first crop behind. Now if you restore the original image, the images created by the second crop are removed, but the leftover images from the first crop remain.
It should probably remove the images from the first crop when you do the second crop.
Attachments (4)
Change History (17)
This ticket was mentioned in Slack in #feature-respimg by joemcgill. View the logs.
9 years ago
#4
@
8 years ago
- Keywords needs-unit-tests removed
- Milestone changed from Awaiting Review to 4.6
- Owner set to chriscct7
- Status changed from new to reviewing
#5
@
8 years ago
Since the $meta is being pulled via a helper function from a piece of post_meta, I've added checks to ensure that expected indices exist, as plugins could if they wanted to change the expected results.
This looks good otherwise.
@
8 years ago
Adds some checks for safety when trying to access indices of an array coming from post_meta
#7
@
8 years ago
- Version changed from 4.2 to 4.2.1
Ignore these. Me and nacin are testing a bug in trac at wceu.
This ticket was mentioned in Slack in #core-images by joemcgill. View the logs.
8 years ago
#10
@
8 years ago
- Owner changed from chriscct7 to mikeschroder
I'll handle the last review for commit.
#11
@
8 years ago
In 32171.3.diff:
Small clean up; use existing stored dirname
, rather than extracting for each size.
I was able to reproduce this quite easily. A little more background on this, it appears to only occur when the aspect ratio of the crops are not the same (hence the 150x150 thumbnail getting overwritten but nothing else is). When that happens, the scaled images will have multiple copies for a specific limiting dimension.
Keep the related ticket #32302 in mind when approaching a solution.