javascriptnode.jsexif-js

bug:ReferenceError: self is not defined exif-js


Am getting an error while finding the exif information of an image (base64 image data):

Exif.getData(path, () => {
    const tag = Exif.getTag(this, 'Orientation');
    console.log(tag);
});

ReferenceError: self is not defined

/usr/local/lib/node_modules/exif-js/exif.js:931
if ((self.Image && img instanceof self.Image)
^

can anyone help


Solution

  • Exif parser works perfectly in server side. https://www.npmjs.com/package/exif-parser