Open Eraldo opened 9 years ago
If I manually create a thumbnail from the shell before..
image.save_thumbnail(f.image.get_thumbnail(thumbnail_options={'size':(100,100)}))
Then all of a sudden image.delete_thumbnails()
works.. and deletes all of them!
=> Very strange!
What is going on?
Same here, did you find a solution? As additional informations:
Now i'm using a manage.py commad to wipe dbcache out, using some code like this:
for p in Photo.objects.all():
p.image.delete_thumbnails()
But this code does nothing.
While debugging I saw
ThumbnailerFieldFile.get_source_cache()
returning an empty _source_cache (due to create=False flag) but I do not understand that code.
Django==1.7.7 easy-thumbnails==2.2
THUMBNAIL_CHECK_CACHE_MISS = False
@Eraldo Hi, did you find a solution? I have same problem
this issue happened on my production server(Linux). The reason is due to different _storage_hash _id. when processing delete_thumbnails(), it will try to compare self.storage_hash(source) with its thumbnails.storage_hash: https://github.com/SmileyChris/easy-thumbnails/blob/master/easy_thumbnails/files.py#L704 However the result is negative. You may modified your default storage settings, which would be assigned to in a lazyobject: https://github.com/SmileyChris/easy-thumbnails/blob/714aa5f36894797ca6c980c9bc8cfa52a46156c1/easy_thumbnails/storage.py#L27 Later, when delete_thumbnails() calls get_storage_hash() in utils.py:
storage = storage._wrapped
storage is "buildin.object" not exactly storage name u expected.
I have a model with an image field:
When I am in the shell and do:
I get
0
as a return.. and no file deleted ..no matter if the image has created thumbnails or not. I expected to get2
and removal of the thumbnail files -- with the example image and files listed blow.The image and thumbnails are there and named like:
How can I remove them with image.delete_thumbnails() .. or am I doing something wrong?
Versions: