Commits

Anonymous committed 85274a9

Wrapped opened file in StringIO

  • Participants
  • Parent commits d1b1e17

Comments (0)

Files changed (1)

File imagekit/specs.py

 
 """
 import os
+from StringIO import StringIO
 from imagekit.lib import *
 from imagekit.utils import img_to_fobj
 from django.core.files.base import ContentFile
             return
         # process the original image file
         fp = self._obj._imgfield.storage.open(self._obj._imgfield.name)
-        fp = getattr(fp, 'file', fp)
         fp.seek(0)
+        fp = StringIO(fp.read())
         self._img = self.spec.process(Image.open(fp), self._obj)
         # save the new image to the cache
         content = ContentFile(self._get_imgfile().read())