I'm following the result in this answer exactly but I am receiving the following error:
ReferenceError: BinaryFile is not defined
Here's the code where that is used:
fr.onloadend = function() {
console.log(this);
exif = EXIF.readFromBinaryFile(new BinaryFile(this.result));
}
The console.log
shows that there is data there, I just don't understand this error I'm receiving.
Thank you for your help.
I'm following the result in this answer exactly but I am receiving the following error:
ReferenceError: BinaryFile is not defined
Here's the code where that is used:
fr.onloadend = function() {
console.log(this);
exif = EXIF.readFromBinaryFile(new BinaryFile(this.result));
}
The console.log
shows that there is data there, I just don't understand this error I'm receiving.
Thank you for your help.
Share Improve this question edited May 23, 2017 at 12:32 CommunityBot 11 silver badge asked Nov 23, 2015 at 21:01 VectaVecta 2,3505 gold badges28 silver badges50 bronze badges 2- I'm wondering the same thing – Kevin Jantzer Commented Nov 24, 2015 at 18:34
- github./jseidelin/binaryajax/blob/master/binaryajax.js – Mir Gulam Sarwar Commented Jul 26, 2021 at 5:47
2 Answers
Reset to default 4I 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 helpful to see what data is in each image.
Removing BinaryFile
and changing how FileReader read the file (readAsArrayBuffer
) worked for me.
fileReader.onload = function (event) {
var exif = fileReader.readFromBinaryFile(this.result);
console.log(exif);
};
fileReader.readAsArrayBuffer(file);