django-image-cropping icon indicating copy to clipboard operation
django-image-cropping copied to clipboard

Django Cropping - Duplicates in DB and File Storage

Open python-force opened this issue 8 years ago • 3 comments

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

python-force avatar Oct 17 '17 20:10 python-force

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

ykh avatar Jan 05 '19 11:01 ykh

Is it has been done?

Kryzhanivskyi avatar Apr 03 '20 12:04 Kryzhanivskyi

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

MRigal avatar May 07 '20 07:05 MRigal