Image Module Bug

Peter dont at
Thu Jul 22 05:10:30 CEST 2004

I found a good way of doing this.

In my interface, I use "s#" instead of "s" to read a string along with its
length.  This allows me to pass NULL characters.

"Jim Bob" <jim at> wrote in message
news:gpaLc.241120$rCA1.188380 at
> Hi,
> I've got a problem with loading images using the Image Module.  When I
> images and then try to pass them to my C++ module using tostring() I get
> 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
> channel is 0 in transparent places.
> Thanks,
> Peter

More information about the Python-list mailing list