Open eddyb opened 11 years ago
@devongovett any way we can get this support for interlaced PNGs merged in? I need to support interlaced PNGs when using pdfkit
. I verified that the above go works well, but I'm not familiar enough with CoffeeScript to easily translate this and create a PR.
Hi, I wrote my own PNG parser, which supports interlacing: https://github.com/photopea/UPNG.js .
Is it possible to merge this in?
@kartikluke Why don't you just use UPNG.js instead? It is very small and our custom ZLIB decoder is even faster than pako.js (ZLIB library itself).
@photopea What is the equivalent in UPNG of:
You can also call PNG.load if you want to load the PNG (but not decode the pixels) synchronously. If you already have the PNG data in a buffer, simply use new PNG(buffer).
If you have a file in an ArrayBuffer, just call UPNG.decode(arrayBuffer).
You can learn how to use UPNG.js at its github page. I would probably not do anything else, if I had to explain how to use UPNG.js to each one of thousands of UPNG users :D
I wonder that people still use libraries, which have not been maintained by the author for seven years, even though there seem to be things that need maintenance (interlacing support).
The implementation in original post works only for some file types.
See https://github.com/blikblum/pdfkit-interlaced-png example. When replacing the png.js by a patched version only images/interlaced-rgb-alpha-8bit.png is correctly rendered
Any hints on how to fix it is appreciated
Guys, just switch to UPNG.js, it has more GitHub stars, if that is what you are looking for :D
The implementation in original post works only for some file types.
In fact the implementation is correct. Just need some code in pdfkit side
I wanted to make sure this works, so I didn't try to fiddle with png-node.coffee, I modified the .js output.