Image Module Bug

Jim Bob jim at bob.com
Tue Jul 20 10:57:16 EDT 2004


Hi,

I've got a problem with loading images using the Image Module.  When I load
images and then try to pass them to my C++ module using tostring() I get the
following error:

TypeError: argument 1 must be string without null bytes, not str

After tearing my hair out I figured out that it was because there was full
black (0) in my image which was screwing up the NULL string terminator.

Here's my question.  How can I get around this?  Can I pass the raw image
data in another format?  Can I use the encoder options on the tostring()
method?  Anyone have any ideas?

This is also a problem when I am trying to do RGBA format because the alpha
channel is 0 in transparent places.

Thanks,
Peter





More information about the Python-list mailing list