JPEG and EXIF Data Manipulation in Javascript | Getaround Tech
Getting image metadata (EXIF) using Node.js
exif-parser is a parser for image metadata in the exif format, the most popular metadata format for jpeg and tiff images. It is written in pure javascript and has no external dependencies. It can also get the size of jpeg images and the size of the jpeg thumbnail embedded in the exif data. It can also extract the embedded thumbnail image.
exif - npm (MIT license)
gomfunkel/node-exif: A node.js library to extract Exif metadata from images.
convert to js promise to be able to use with async/await
import exif from 'exif'
export async function getExifAsync(imgPath) { return new Promise(function(resolve, reject) {
new exif.ExifImage({ image : imgPath }, function (error, exifData) {
if (error) {
reject(error)
} else {
resolve(exifData)
}
});
})
}
const exifData = await getExifAsync(imgPath)
console.log(exifData)
here is another library that also provides assess to "thumbnail" image that is embedded into the EXIF
the "popularity winner", but not useful for reading EXIF
Getting image metadata (EXIF) using Node.js
No comments:
Post a Comment