Why I get ReferrenceError: BinaryFile not defined

I correctly executed the result of this answer , but I get the following error:

ReferenceError: BinaryFile not defined

Here is the code where it is used:

fr.onloadend = function() { console.log(this); exif = EXIF.readFromBinaryFile(new BinaryFile(this.result)); } 

console.log shows that there is data, I just do not understand this error that I get.

Thank you for your help.

+5
source share
2 answers

I used the following which worked very well

 EXIF.getData(img, function() { orientation = EXIF.getTag(this, "Orientation"); }); 

where img is my image object.

Also EXIF.pretty(this) was useful to see what data is in each image.

+1
source

Removing the BinaryFile and changing the way the FileReader ( readAsArrayBuffer ) is readAsArrayBuffer for me.

 fileReader.onload = function (event) { var exif = EXIF.readFromBinaryFile(this.result); console.log(exif); }; fileReader.readAsArrayBuffer(file); 
0
source

Source: https://habr.com/ru/post/1236647/


All Articles