This simple wrapper for the ExifImage class allows a user to pass a path to a '.jpg' file and a callback that receives both the image path and the extracted Exif Data.
npm i path-exif-mapper
var pathExifMapper = require('path-exif-mapper').PathExifMap;
pathExifMapper("/path/to/image.jpg", function (path, exifData) {
console.log({
path: path,
exifData: exifData
});
});
could return:
{ path: '/path/to/image.jpg',
exifData:
{ image:
{ ModifyDate: '2015:01:01 09:50:14',
GPSInfo: 543,
Model: 'Nexus 5',
YCbCrPositioning: 1,
ResolutionUnit: 2,
YResolution: 72,
ExifOffset: 166,
XResolution: 72,
Make: 'LGE' },
thumbnail:
{ YResolution: 72,
ThumbnailLength: 39170,
ThumbnailOffset: 888,
Compression: 6,
ResolutionUnit: 2,
XResolution: 72 },
//...
interoperability: { InteropIndex: 'R98', InteropVersion: <Buffer 30 31 30 30> },
makernote: {}
}
}