Image Module Bug
dont at emailme.com
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 bob.com> wrote in message
news:gpaLc.241120$rCA1.188380 at news01.bloor.is.net.cable.rogers.com...
> 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.
More information about the Python-list