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:
Justin Driscoll 2009-02-02 09:54:07 -05:00
parent f9e02d250e
commit 0dc198f355

View file

@ -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)