Delete source image after variations created
Closed this issue · 1 comments
I was thinking of an argument for deleting the main uploaded image after creating a standard sized
sometimes we use just standard sizes and don't need the uploaded image with a huge size in the media folder, then it would be great if there is an option like this to remove the original image after processing
class MyModel(models.Model):
image = StdImageField(
upload_to='path/to/files',
variations={'thumbnail': (100, 75)},
delete_orphans=True,
blank=True,
delete_original=True,
)
Hi @sandnima,
Thank you for reaching out. We keep the original by default because it's best to generate new variations from the original source, rather than a compressed copy. A simple example would be a design update. Maybe you need an image at a different ration, you can simply create new variations and render them. However, that does only work, if you keep the original.
To prevent users from learning this lesson the hard way, we keep the source image by default. That being said, you can probably create a subclass that ditches the original, but I would advise against it, for the reasons above.
I hope this answered your question.
Best,
Joe