mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-26 15:54:43 +00:00
We now seek to the begining of the file in spec._create to prevent PIL errors when multiple specs have pre_cache=True
This commit is contained in:
parent
f9e02d250e
commit
0dc198f355
1 changed files with 5 additions and 2 deletions
|
|
@ -47,8 +47,11 @@ class Accessor(object):
|
|||
def _create(self):
|
||||
if self._exists():
|
||||
return
|
||||
self._img = self.spec.process(Image.open(self._obj._imgfield.file),
|
||||
self._obj)
|
||||
# process the original image file
|
||||
fp = self._obj._imgfield.file.file
|
||||
fp.seek(0)
|
||||
self._img = self.spec.process(Image.open(fp), self._obj)
|
||||
# save the new image to the cache
|
||||
content = ContentFile(self._get_imgfile().read())
|
||||
self._obj._imgfield.storage.save(self._path(), content)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue