revisitors / readimage

Read a (jpg, png, gif) image into a standard binary format in memory.
MIT License
14 stars 5 forks source link

3-channel pngs are not accepted #1

Closed kirbysayshi closed 9 years ago

kirbysayshi commented 9 years ago

As the error message says... file an issue!

Ran into this while using a mac screenshot, which apparently are by default saved with only 3 channels. Is it simply a matter of taking the parsed data, and expanding the pixel data to include a 255 every 4th slot?

brycebaril commented 9 years ago

This is starting to hit me as well, it looks like the best way is to clone this behavior: https://github.com/darkskyapp/pngparse/blob/master/index.js#L14-L51

calling that function would also work, but would be slower than just doing the conversion.

brycebaril commented 9 years ago

Fixed and pushed as 1.1.0

kirbysayshi commented 9 years ago

Cool, I'll try to give this a look this weekend.