[Image-SIG] tostring
THOGROM.terra.es
thogrom at terra.es
Wed Feb 23 14:28:12 CET 2005
Hello list!
I'm using python to store some images as strings.
image = PIL.Image.open(sname)
self.__simagestr = image.tostring()
os.remove(sname)
Later, I have to store this string on a file:
def savedraw(self, suri):
#suri is a path like "/home/image.jpeg"
data = StringIO.StringIO(self.__simagestr)
im = PIL.Image.open(data)
im.save(data,'JPEG')
But the system shows the next error when execute PIL.Image.open(data)
raise IOError("cannot identify image file")
What is wrong?
Thanks jmd
--
THOGROM.terra.es <thogrom at terra.es>
More information about the Image-SIG
mailing list