image-js / fast-png

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

Extract resolution information #5

Closed lpatiny closed 7 years ago

lpatiny commented 7 years ago

jpeg and tiff converter are able to extrat EXIF information and I guess resolution as well.

Would be nice if all the libraries are able to provide the Resolution and put it somewhere at the same place so that we can directly get it from image-js

Resolution seems to be stored in the pHYs

https://www.w3.org/TR/PNG/#11pHYs

targos commented 7 years ago

done. the resolution is stored in png.resolution. It's an array with two elements (xResolution and yResolution). Unit is either unknown or in pixels per meter.