Prefer cStringIO.

This commit is contained in:
Bryan Veloso 2011-10-11 01:52:21 +09:00
parent db86d7ed66
commit 5e72d9f5e4

View file

@ -6,11 +6,13 @@ spec found.
"""
import os
from StringIO import StringIO
import cStringIO as StringIO
from django.core.files.base import ContentFile
from imagekit import processors
from imagekit.lib import *
from imagekit.utils import img_to_fobj
from django.core.files.base import ContentFile
class ImageSpec(object):
@ -60,7 +62,7 @@ class Accessor(object):
except IOError:
return
fp.seek(0)
fp = StringIO(fp.read())
fp = StringIO.StringIO(fp.read())
self._img, self._fmt = self.spec.process(Image.open(fp), self._obj)
# save the new image to the cache
content = ContentFile(self._get_imgfile().read())