Image Module Bug
Larry Bates
lbates at swamisoft.com
Tue Jul 20 12:14:28 EDT 2004
You should be able to use the struct module to pack your
data into a binary structure, then pass that to the C++
module. I do this in quite a few programs I have that
need to pass this type of data to C, C++ routines.
HTH,
Larry Bates
Syscon, Inc.
"Jim Bob" <jim at bob.com> wrote in message
news:gpaLc.241120$rCA1.188380 at news01.bloor.is.net.cable.rogers.com...
> 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