foliojs / png.js

A (animated) PNG decoder in JavaScript for the HTML5 canvas element and Node.js
http://devongovett.github.com/png.js
MIT License
489 stars 92 forks source link

Node.js/palette conversion: fixed palette size when transparency is missing. #7

Closed eddyb closed 7 years ago

eddyb commented 11 years ago

I was testing my code on a non-transparent indexed PNG and some colors were all zeros. After some debugging, I found that the palette was c*3 bytes long instead of c*4 (as it is RGBA, not just RGB), and that its length depended on the transparency map (which didn't exist in my case).

devongovett commented 11 years ago

Sorry I haven't responded sooner. Is there a broken image you could send me to test this with? Thanks!

eddyb commented 11 years ago

Cannot remember which image failed (this was a batch operation with images extracted from CSS), but I think it's from deviantart.com. If you really need it, I could try looking for it again. It could be http://st.deviantart.net/minish/main/v7footer/gradient.png or http://st.deviantart.net/minish/main/v7footer/slider_bg.png

For that same batch processing thing, I've also implemented interlacing support, see #8

ccd0 commented 9 years ago

This image from 4chan is decoded correctly after the fix but not before: 1433596309931

eddyb commented 7 years ago

Closing old PRs of mine.