exif-js / exif-js

JavaScript library for reading EXIF image metadata
MIT License
4.85k stars 1.27k forks source link

exif.getData throws an error in node runtime. #65

Open deepakvenkat opened 8 years ago

deepakvenkat commented 8 years ago

I'm trying to run the following :

var exif = require('exif-js');
var fs = require('fs');
var imageBuffer = fs.readFileSync('hatching_orig.jpg');
exif.getData(imageBuffer, function() {
  console.log(exif.pretty(imageBuffer));
});

in node v4.4.7 and getting the following error:

 if ((img instanceof Image || img instanceof HTMLImageElement) && !img.complete) return false;
                            ^
ReferenceError: Image is not defined
RonaldAM commented 5 years ago

any solution to this?