简体   繁体   English

如何在节点 js 中获取图像(JPG、JPEG、PNG)的 EXIF 数据?

[英]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.我正在尝试检索要从中提取 GPS 相关信息(即纬度和对数)的图像的 EXIF 数据。 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.到目前为止,我已经尝试了 npm/node 中可用的至少 4-5 个 EXIF 包——exif、exif-parser、node-exif、exifr、exif-js 和其他 2-3 个,但没有得到任何可靠的结果。 Most of them only supported one file type (only JPG or only PNG).其中大多数仅支持一种文件类型(仅 JPG 或仅 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).我用 eixfr 得到了最好的结果——我能够提取第一张图像的数据(无论扩展名如何),但是之后当我用第二张图像尝试它时它崩溃了(每次都发生)。

So is there any npm package with which I can retrieve EXIF data of multiple images with different extensions (atleast PNG, JPG , JPEG)?那么是否有任何 npm 包可以用来检索具有不同扩展名(至少 PNG、JPG、JPEG)的多个图像的 EXIF 数据?

By using node-exif Package in NodeJs We can get all related data:-通过在 NodeJs 中使用node-exif包,我们可以获得所有相关数据:-

Please refer the link for get the full usage [1]: https://www.npmjs.com/package/exif请参阅链接以获取完整用法 [1]: https ://www.npmjs.com/package/exif

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将Emoji表情符号转换为Node.js中的PNG或JPG-如何? - Emoji to PNG or JPG in Node.js - how to? 将image/jpeg、image/png等文件转换为multipart/form-data格式节点js - Convert image/jpeg, image/png, etc. files to multipart/form-data format node js 如何从 React 应用程序将 Png 或 Jpeg 图像作为二进制文件发送到 node.js 服务器? - How to send a Png or Jpeg image as binary to node.js server from react app? JS / Jquery,匹配找不到PNG =匹配('/ gif | jpg | jpeg | png /') - JS/Jquery, Match not finding the PNG = match('/gif|jpg|jpeg|png/') 如何使用 node.js 从 rgb 值的 Uint8Array 数组生成 png 或 jpg 图像? - How to generate a png or jpg image from a Uint8Array array of rgb values with node.js? 将 EXIF 数据写入图像流 Node.js - Write EXIF data to image stream Node.js 将Image jpg,png,jpeg…保存在CloudBoost后端的一列中作为服务 - Save Image jpg, png, jpeg… in a column in CloudBoost backend as a service node.js在JPEG中创建/修改Exif - node.js create / modify Exif inside the JPEG 如何优化画布图像并获取jpg而不是png - How to optimize canvas image and get jpg instead of png 响应正文中接收到的以下图像数据的格式是什么,以及如何使用Node.js将其保存为jpeg文件 - What is format of below image data recieved in response body and how to save it as jpeg file using Node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM