matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.26k stars 276 forks source link

--force flag for generateimages management command #466

Open ozren1983 opened 6 years ago

ozren1983 commented 6 years ago

Today I've ran into an issue where generated images accidentally got deleted from disk, but cache (memcached) still kept info that generated images were created, so generateimages management command didn't generate new images. I know I can clear cache in that case, but didn't feel like messing with memcached since we are using it to store some other data. I ended up overriding generateimages command and adding image_file.generate(force=True).

I think that adding --force flag to generateimages might be useful for such scenarios. It looks like a simple change where generateimages --force would call image_file.generate(force=True), otherwise it would call image_file.generate().

If you agree I'll submit a pull request.

vstoykov commented 6 years ago

Looks nice. I'm waiting for your PR.

ArtemBernatskyy commented 6 years ago

+1