-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Transforms don't get deleted on remote volumes #341
Comments
@khalwat is this issue something you would consider as a bug? It would be wonderful if you could give me a short feedback. Otherwise I would have to find other ways of fixing this issue with my own event handlers. |
i think it is likely a bug. I'll be looking into it! |
We've tried to reproduce this, but are unable to -- could it perhaps be something specific to Digital Ocean Spaces? ImageOptimize doesn't actually do anything any different here than regular old Craft transforms. So I'd expect the same behavior if you did a Craft transform in your templates, and then deleted the original image. |
Hi @khalwat, thanks for the feedback. I'll verify if the bug also exists using craft transforms. I'll get back to you. |
@khalwat, I've tested with an ordinary craft transform and the generated assets don't get deleted on digital ocean. Could you point me in the right direction how I would be able to solve this issue, maybe with my own plugin? I guess there's an event I could listen for? |
@khalwat I tested this once more with a local volume and found the same behaviour:
Did this work at your end? |
I will give it a whirl, but I've not encountered this before, no. |
Could this potentially be related to the issues in #329? Specifically, the issue there was caused by the format not being set when the image format is "auto". |
Yes, I think it's related or at least has a similar cause. If the format is empty the cleanup function never actually deletes transform files, @curtismorte empty($activeImageVariantCreators[$fileFormat]) is always false in that case. |
@JensvdHeydt nice sleuthing! Sorry for being slow to respond, on a holiday, but let me roll out a fix. |
Addressed in: d71a87a & 9061074 Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop as 1.6.48”, Then do a Craft CMS 4: ….. You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop-v4 as 4.0.2”, Then do a |
@khalwat thanks! I'll give it a spin. |
@khalwat Just tested it on a local and remote volume. Both worked. Great work and never mind those "slow" responses on a holiday! |
Hi @khalwat, |
@JensvdHeydt Just addressed that now Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop as 1.6.48”, Then do a Craft CMS 4: ….. You can try it now by setting your semver in your "nystudio107/craft-imageoptimize": "dev-develop-v4 as 4.0.2”, Then do a |
@JensvdHeydt lmk if that fix does it for you, and I will close this out and cut a release. |
@khalwat Just tested it with a remote volume. Works like it should! Thanks again. |
Describe the bug
I'm using DigitalOcean Spaces Volume v1.1.3 and when I delete an asset some directories and files don't get removed from the remote volume. It seems to be the webp variants that image optimize creates and their respective directories. The original file gets deleted by craft. There's a comment in the executed funtion in Optimize.php, line 397: "// Only do this for local Craft transforms". Maybe that's the issue?
To reproduce
Steps to reproduce the behaviour:
Expected behaviour
Remote volume should not be ignored when deleting transform variant files.
Screenshots
Versions
The text was updated successfully, but these errors were encountered: