jimp-dev/pngjs3

pngjs3.js:6925 typeError: Cannot read property 'interlace' of undefined

kevzettler opened this issue · 0 comments

index.js:16 TypeError: Cannot read property 'interlace' of undefined
    at parse (pngjs3.js:6925)
    at Object.read (pngjs3.js:7280)

Throws from:
https://github.com/gforge/pngjs3/blob/master/lib/parser/parser-sync.js#L69

I'm not sure what metadata is supposed to be. Maybe this should guard

if(metadata && metatdata.interlaced)

I'm loading a png as an arraybuffer using webpack arraybuffer-loader. Passes an ArrayBuffer to the sync method.

import { PNG } from 'pngjs';
import arrayBuffer from './static/peppers.png';
const pepperPng = PNG.sync.read(arrayBuffer);