Update PNGImage.as
Throw error message for unsupported PNG transparency mode instead of failing silently.
More details can also be found under this issue #186
Yes, it would be nice to have a fix. This is a major limitation of AlivePDF. A few notes on the topic:
- patches suggested earlier in issues don't add transparency support. They remove the alpha channel, rather than carrying it to the PDF. Depending on the PNG, this may give weird results. Years ago somebody wrote real PNG alpha support, but the links to it have disappeared.
- the warning I added is for PNG simple transparency. This is not for PNG alpha transparency, which is much more common. Without the warning, the code will crash without any message (for alpha PNG at least there is a message).
I don't have the bandwidth to do the project of adding PNG transparency now unfortunately...
We may have some available resource available in the coming days and we will look how to add the alpha lyer support for PNG. @teuf22 Are you still using AlivePDF in production?
This is used in production, but being phased out. I have a few PNGs testcases I can contribute, if this helps.
@teuf22 It would be nice if you can provide those PNG tastcases, it will help us for sure. Thanks.