简体   繁体   中英

How to get EXIF data of an image (JPG, JPEG, PNG) in node js?

I am trying to retrieve EXIF data of an image from which I want to extract GPS related information ie, Latitude and logitude. So far I have tried atleast 4-5 EXIF packages available in npm/node - exif, exif-parser, node-exif, exifr, exif-js and other 2-3 but didn't get any solid results. Most of them only supported one file type (only JPG or only PNG). I got my best results with eixfr - I was able to extract data of the first image(regardless of extension),but after that when I tried it with the second image it crashed (happened everytime).

So is there any npm package with which I can retrieve EXIF data of multiple images with different extensions (atleast PNG, JPG , JPEG)?

By using node-exif Package in NodeJs We can get all related data:-

Please refer the link for get the full usage [1]: https://www.npmjs.com/package/exif

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM