Location of pictures #79
Replies: 2 comments 1 reply
-
Hi @KosuzuMotoori, Thank you for reaching. Interesting question… I think I need a little more information to understand your use case better. But I will give a bit more detailed information about some things, even if they don't fully answer your question yet. The file structure right now is not changeable via a setting. However, you can overwrite the name or path property, with a custom implementation: django-pictures/pictures/models.py Lines 57 to 66 in 2eed428 Regarding deletion. You can delete all sizes at once via django-pictures/pictures/models.py Lines 105 to 110 in 2eed428 Since larger file storage like S3 are key-value stores and operate via API, I am not really sure if there is much gained from a differently prefixed location. All that aside, if you want to just delete orphaned files, consider using I hope some of those remarks already helped you! Best, |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. I don't use cloud services, and if the original files are separate from the dynamically generated ones, it makes backup a little easier. This is important if there are a lot of pictures, in my case tens of gigabytes. 4-6 versions of the same image in different sizes increase the size of the backup significantly. At the moment I'm using django-imagekit. It stores thumbnails files in a separate cache directory and I think it's handy. Do you have any plans to implement management commands to regenerate and delete all thumbnails? |
Beta Was this translation helpful? Give feedback.
-
Is it possible to save the thumbnails in a different directory than the original images? All the original images in one directory and all their thumbnails of different sizes in a separate directory for example "cache"?
/media/pictures/album/photo_001.jpg
/media/cache/album/photo_001/1800w.jpeg
/media/cache/album/photo_001/900w.jpeg
/media/cache/album/photo_001/300w.jpeg
That way it would be easier to delete all dynamically created photos and generate new ones.
Beta Was this translation helpful? Give feedback.
All reactions