Variants are not re-generated on overwrite image
See original GitHub issueIssue Description
Thanks for putting efforts into this great package! I found this one most relevant to my requirement, among several django imaging libraries.
The only issue I’m having is variants don’t get regenerated when you replace an existing image.
It works fine locally (django.core.files.storage.FileSystemStorage
), but not on S3 (storages.backends.s3boto3.S3Boto3Storage
). Only main image is replaced, and thumbnail variants remain untouched.
main_image.png
(replaced with new one)main_image.md.png
(untouched, old)main_image.sm.png
(untouched, old)
My workaround was to add random hash to file name so that set of 3 new images are created on S3 bucket, each time you replace. It’s not good enough since old images hold the space.
It would be great if someone can take a quick double check, and fix if easy.
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Remove old variants with Rails ActiveStorage - Stack Overflow
I had some time to dig into ActiveStorage. Turns out, variants are stored with the variants/ prefix, which makes finding them a lot...
Read more >WebP images are not regenerated when using ... - Drupal
Problem/Motivation If I apply a crop for an image, it crops the jpg and webp images fine. But if I change the crop...
Read more >Changing Image Sizes: And regeneration - WordPress.org
I want to change the standard pixel size of “Medium” images to say.. 600×450. I am using webp. To regen the images and...
Read more >Flexible variants - Cloudflare Image Optimization
Flexible variants allow you to create variants with dynamic resizing. This option is not enabled by default. You can enable flexible variants ...
Read more >different images with the same name overwrite each other - Jira
This is a feature, we automatically version the images for you if you upload a file with the same filename. The best way...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mingthegit as much as I agree with the problem, I would caution you a bit regarding the solution. Please keep in mind, that changing the behavior should not be done quietly. Currently, existing variations are not overridden. So if we are to change the behavior, we need to do it in a way, that informs users should the update.
@caspervk I know it’s default behavior in Python, but not in Django storage backends. I don’t know why they chose this path. But I guess it’s to prevent users from errors. I merged it, it’s released in 5.0.1
Thank you so much for your contribution. It is very much appreciated.