Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I receiving ReferrenceError: BinaryFile is not Defined

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.

like image 339
Vecta Avatar asked Nov 23 '15 21:11

Vecta


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 helpful to see what data is in each image.

like image 190
Vecta Avatar answered Sep 28 '22 03:09

Vecta


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);
like image 38
Kevin Jantzer Avatar answered Sep 28 '22 03:09

Kevin Jantzer