Using a PNG Image File seems not to work. JPEG works fine. PDFKIT Version 0.8.
I found out that most of my PNG files work. But some files doesn't. Pdfkit is endless looping.
@Eisenspalter might be good to adjust the issue name to "Some PNG Image Files cause endless looping". Have you been able to figure out the differences between the working and non-working files?
Please post a broken image so we can test. Thanks!
Attached a png file.
The error is:
Uncaught Error: Invalid filter algorithm: 113
at node_modules/png-js/png-node.js:242:21
at Inflate.onEnd (zlib.js:227:5)
at endReadableNT (_stream_readable.js:934:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

When using an image interlaced with Adam 7 interlacing, I get the error Error: Invalid filter algorithm. If the same image is saved without interlacing, it works.
+1 Just confirmed what @Inufnu figured out with the Adam 7 interlacing.
Is there any chance of a fix to support interlaced pngs?
We've had to resort to using png-js to check for interlacing to skip interlaced files to prevent crashing pdfkit but this still confuses users as why their images don't print.
var PNG = require('png-js')
var testPng = new PNG(new Buffer(body))
if (testPng && testPng.interlaceMethod === 1) {
Related to #926
Most helpful comment
Is there any chance of a fix to support interlaced pngs?
We've had to resort to using png-js to check for interlacing to skip interlaced files to prevent crashing pdfkit but this still confuses users as why their images don't print.