jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 130 forks source link

Django Cropping - Duplicates in DB and File Storage #122

Open python-force opened 6 years ago

python-force commented 6 years ago

Why is Django Cropping when you change in Admin the resizing rectangle creating new files and also in DB. Basically, if you keep changing that rectangle your DB is getting bigger and file storage is filling up with files which are not used anymore.

Here is an example Old Value of Cropping: 50, 0, 1205, 833 New Value of Cropping: 0, 0, 1155, 833

Now in my file storage have files that are not used anymore. Images with "50, 0, 1205, 833" will be sitting there forever and also in DB look at the screenshots.

It should be done:

If images exist delete them and create new with "0, 0, 1155, 833" cropping and also in DB the values should be changed for the same image source "50, 0, 1205, 833" to "0, 0, 1155, 833".

If cropping value can change in the Admin for the image and there is no other filed for old value then table easy_thumbnails_thumbnail can do that also rewriting the data not make duplicates.

django-cropping django-cropping2 django-cropping3

ykh commented 5 years ago

It's a clear issue! Any solution or workaround?

Kryzhanivskyi commented 4 years ago

Is it has been done?

MRigal commented 4 years ago

No it hasn't been done until now. Feel free to send a PR. Consider handling also #119 which is a similar case.