Image loaded from bitmap is 100% transparent

I've run into something that might be a bug in wxPython. I've searched
for it, but couldn't find any references to this problem. On Windows
Vista 64-bit with Python 64-bit and wxPython 2.8.10.1, I run a script
that reproduces the issue: http://paste.turbogears.org/paste/89178.

The output from the script is as follows:
hasAlpha True
Image is completely transparent
Bitmap data doesn't match loaded image
Now the bitmap data does match

The script has a sample bitmap embedded, as the issue only emerges
with certain images. The bitmap is loaded into an image, and the
alpha channel is full transparent. I expect it shouldn't be.
Subsequently, the bitmap generated from the image is black. According
to ImageMagick and every other program I've used to edit the image,
there's nothing wrong with the image.
Our team used to load these images using an earlier version of
wxPython 2.8.4.0 without problems (apparently using these images,
though that's not confirmed).

This issue isn't urgent, but I did want to report it to see if there's
something I'm doing wrong or to help ensure that this issue is
resolved in the future.

Regards,
Jason

Jason R. Coombs wrote:

I've run into something that might be a bug in wxPython. I've searched
for it, but couldn't find any references to this problem. On Windows
Vista 64-bit with Python 64-bit and wxPython 2.8.10.1, I run a script
that reproduces the issue: http://paste.turbogears.org/paste/89178.

It seems to be platform independent.

The output from the script is as follows:
hasAlpha True
Image is completely transparent
Bitmap data doesn't match loaded image
Now the bitmap data does match

The script has a sample bitmap embedded, as the issue only emerges
with certain images. The bitmap is loaded into an image, and the
alpha channel is full transparent. I expect it shouldn't be.
Subsequently, the bitmap generated from the image is black. According
to ImageMagick and every other program I've used to edit the image,
there's nothing wrong with the image.
Our team used to load these images using an earlier version of
wxPython 2.8.4.0 without problems (apparently using these images,
though that's not confirmed).

This issue isn't urgent, but I did want to report it to see if there's
something I'm doing wrong or to help ensure that this issue is
resolved in the future.

Please open a ticket about this in the wx Trac and be sure to attach the image. It appears to me that there isn't really an alpha channel in the image but wx is acting as if there is. Perhaps the alpha flag is set in the image's header but the data isn't actually there. If this is a common enough situation that other image apps work around the bogus file then I suppose that wx should too.

···

--
Robin Dunn
Software Craftsman

Thanks. http://trac.wxwidgets.org/ticket/10915