最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Why am I receiving ReferrenceError: BinaryFile is not Defined - Stack Overflow

programmeradmin0浏览0评论

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
Add a ment  | 

2 Answers 2

Reset to default 4

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.

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);
发布评论

评论列表(0)

  1. 暂无评论