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

Add tEXt chunk support #4

Closed jbuck closed 12 years ago

jbuck commented 12 years ago

This patch adds support for the tEXt chunk in PNG images. I used it to validate Open Badges; I did a write up on my blog: http://jbuckley.ca/2012/01/validating-open-badges/

devongovett commented 12 years ago

This is very cool, thanks for the pull request! It might be nice for applications like this to only decode the text chunks and not the actual pixel data if they don't need it someday as well... :) I'll merge this later today. Thanks again!

jbuck commented 12 years ago

Hmmm, that would definitely speed things up. Maybe only decode the pixel data when render() is called, or a canvas is passed to the callback? Certainly something to consider

devongovett commented 12 years ago

Merged, added to CoffeeScript version and simplified slightly. Thanks again!