gomfunkel / node-exif

A node.js library to extract Exif metadata from images.
MIT License
581 stars 104 forks source link

add filename to call back function #55

Open gemal opened 8 years ago

gemal commented 8 years ago

wouldn't it be possible to change: new ExifImage({ image : 'myImage.jpg' }, function (error, exifData) { into new ExifImage({ image : 'myImage.jpg' }, function (error, exifData, filename) {

so I inside the callback function can see which file is haveing the exifData

oeuillot commented 8 years ago

Hello @gemal , The third parameter is already used and will contain the path ! (if you specify the path) I don't understand your problem :-p

Regards

PaulThompson commented 8 years ago

This is an omission from the documentation - from the source it appears the callback is already calling out with 1 or 3 arguments: callback(error); or callback(null, exifData, ops.image);

In fact this caused a bug for me because bluebird 2.x promisify reinterprets multiple callback arguments into an array.