jeffklassen / path-exif-mapper

Maps an image path to its exif data
0 stars 0 forks source link

exif data in wrong parameter #1

Open sebagnz opened 7 years ago

sebagnz commented 7 years ago

After a few intents, i figured that exif data is not coming in the second parameter of the callback function, its coming on a third one : had to do it like this

pathExifMapper("./images/image01.jpg", function (path, exifData, exifDataComingHere) {

console.log({
    path: path,
    exifData: exifData,
    data:exifDataComingHere
});

and got this result:

{ path: null,
exifData: './images/IMG_0583.JPG',
data:
{ image:
{ Make: 'Apple',
Model: 'iPhone 4',
Orientation: 6,
XResolution: 72,
YResolution: 72,
ResolutionUnit: 2,
Software: '7.1.1',
ModifyDate: '2014:06:08 01:58:12',
YCbCrPositioning: 1,
ExifOffset: 204,
GPSInfo: 1036 },
thumbnail:
{ Compression: 6,
XResolution: 72,
YResolution: 72,
ResolutionUnit: 2,
ThumbnailOffset: 1332,
ThumbnailLength: 10274 },
exif:
{ ExposureTime: 0.041666666666666664,
FNumber: 2.4,
ExposureProgram: 2,
ISO: 3200,
ExifVersion: <Buffer 30 32 32 31>,
DateTimeOriginal: '2014:06:08 01:58:12',
CreateDate: '2014:06:08 01:58:12',
ComponentsConfiguration: <Buffer 01 02 03 00>,
ShutterSpeedValue: 4.593510324483776,
ApertureValue: 2.5260688216892597,
BrightnessValue: -2.299511461856445,
MeteringMode: 5,
Flash: 32,
FocalLength: 3.85,
MakerNote: <Buffer 41 70 70 6c 65 20 69 4f 53 00 00 01 4d 4d 00 06 00 01 00 09 00 00 00 01 00 00 00 00 00 02 00 07 00 68 00 00 ... >,
SubSecTimeOriginal: '031',
SubSecTimeDigitized: '031',
FlashpixVersion: <Buffer 30 31 30 30>,
ColorSpace: 1,
ExifImageWidth: 640,
ExifImageHeight: 480,
SensingMethod: 2,
SceneType: <Buffer 01>,
ExposureMode: 0,
WhiteBalance: 0,
FocalLengthIn35mmFormat: 35,
SceneCaptureType: 0,
LensInfo: [Object],
LensMake: 'Apple',
LensModel: 'iPhone 4 front camera 3.85mm f/2.4' },
gps:
{ GPSLatitudeRef: 'S',
GPSLatitude: [Object],
GPSLongitudeRef: 'W',
GPSLongitude: [Object],
GPSAltitudeRef: 0,
GPSAltitude: 22.306129476584022,
GPSTimeStamp: [Object],
GPSImgDirectionRef: 'T',
GPSImgDirection: 83.66244725738396 },
interoperability: {},
makernote: { error: 'Unable to extract Makernote information as it is in an unsupported or unrecognized format.' } } }

sebagnz commented 7 years ago

Maybe the first parameter in callback is "Error", if you are Respecting the original format:

new ExifImage({ image : 'image01.jpg' }, function (err, exifData)