[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()

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)

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