[Image-SIG] fromstring() question...

David Jeske jeske@egroups.net
Mon, 22 Mar 1999 23:23:11 -0800

I'm having trouble figuring out what I'm supposed to do to get fromstring() to work.

What I _want_ to do is: hand fromstring() a string which _is_ the
contents of an image file, plus the encoder type (derived from the
mime type), and have it pass back the PIL Image it retrieved as a
result of decoding that string.

For example:

# tiff_file_string contains the contents of a tiff file

img = PIL.Image.fromstring(tiff_file_string ,decoder_name = "TIFF") 
gif_file_string = img.tostring(encoder_name = "gif")

I don't understand what exactly I'm supposed to pass to the other
arguments to fromstring(). I don't know the size of the image yet,
PIL's TIFF decoder is supposed to figure that out for me.

I also couldn't find reference to what I'm supposed to pass into the
final *args argument for the different decoder types.

David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@egroups.net