-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regenerate thumbnail duplication webp file #575
Comments
@james58899 When you ran into this bug, did you have the checkbox to generate both WebP and JPEG (under |
I didn't enable it, only generate thumbnails in webp format. |
@james58899 thanks for reporting the issue. I replicate the issue when I regenerate the image using the plugin. The above PR resolves the issue with the full-size image. I find one more bug when I regenerate images multiple times. |
@mukeshpanchal27 Actual issue is with replacing original image with custom mime type version here in this line: https://github.com/WordPress/performance/blob/trunk/modules/images/webp-uploads/load.php#L136 So it creates 2 issues there.
|
Adding @adamsilverstein I added this to Images and the Needs Triage label. Please advise on next steps. |
@james58899 - I assume you are using this plugin. With this plugin, unless you enable the "Delete thumbnail files" option, the old files are left in place when doing a regenerate command. Unless this box is checked WordPress creates new files and will generate new filenames as needed. Closing this as "works for me" because this looks like the expected behavior to me. If I have missed something, please feel free to re-open this issue. |
@adamsilverstein The issue is Regenerating the thumbnail should not change the information of the original image, nor should it infinitely generate new webp files. |
I will give this a test. The file naming probably isn't a concern as long as the file meta is right.
|
@james58899 I am still unable to reproduce the issue, have you tested with the latest version of the plugin? is your original upload a jpeg? do you have a.custom filter applied to generate both jpeg and webp? |
@adamsilverstein Yes, the issue still exists, please reopen the issue. Enable Performance LabSettingsThe picture was just uploadedEverything works fine when the image is just uploaded. First time regenerate thumbnailAfter the thumbnail is regenerated for the first time, the original image is replaced with webp, and a new webp file is generated. Second time regenerate thumbnailAfter the thumbnails are regenerated a second time, the original images are replaced again, and a bunch of new webp thumbnails are generated. Click Delete permanentlyA lot of files are left in the folder without being deleted. Disable Performance LabThe picture was just uploadedFirst time regenerate thumbnailSecond time regenerate thumbnailSame as first time. Click Delete permanentlyAll files have been deleted. |
I can confirm your findings. Initially, I couldn't reproduce issue, until I disabled |
@adamsilverstein I'm going to reopen the issue as i still replicate the issue. Steps to reproduce
|
Excellent, thank you @mukeshpanchal27 and @james58899 for the detailed steps to reproduce. I will retest and see what the best solution is. It looks like in an attempt to avoid name collisions we are inadvertently creating extra names. I'm curious (and will test) - if you delete the original image, are you left with stray images that aren't deletes? |
Bug Description
If using the Regenerate Thumbnails plugin regenerate thumbnail cause file duplication.
Steps to reproduce
Screenshots
Before regenerate:
After regenerate:
Additional Context
The text was updated successfully, but these errors were encountered: