image-js / fast-png

PNG image decoder and encoder written entirely in JavaScript
MIT License
329 stars 17 forks source link

tRNS not handled properly, causing a error during decoding gray scale images. #31

Closed blvd20 closed 1 year ago

blvd20 commented 1 year ago

https://github.com/image-js/fast-png/blob/9563e3dcc66bd402c3a969dfe1027bf897ab9296/src/PngDecoder.ts#L212

At least, there should have a this.skip(length).

targos commented 1 year ago

Can you share an image that causes this issue so we can use it in unit tests?

blvd20 commented 1 year ago

914 @targos

targos commented 1 year ago

Thanks. Fixed in version 6.2.0.

The field is now correctly decoded and its values can be read from img.transparency.