Commits

Anonymous committed 9577f88

Include filename in Image.open() IOErrors

Comments (0)

Files changed (1)

imagekit/specs.py

             return            
         fp.seek(0)
         fp = StringIO(fp.read())
-        self._img, self._fmt = self.spec.process(Image.open(fp), self._obj)
+	try:
+            self._img, self._fmt = self.spec.process(Image.open(fp), self._obj)
+	except IOError, e:
+	    raise IOError('%s: %s' % (self._obj._imgfield.name, str(e)))
         # save the new image to the cache
         content = ContentFile(self._get_imgfile().read())
         self._obj._storage.save(self.name, content)