6

从包含我的图像数据的 int8array 获取 EXIF 信息的最佳方法是什么。我知道这个问题太简单了,但我真的被困住了

我正在考虑使用这个库:https ://github.com/vjeux/jDataView 或者修改这个库:http: //blog.nihilogic.dk/2008/05/reading-exif-data-with-javascript.html

4

1 回答 1

1

您必须对该脚本进行少量修改,因为它会创建自己的字节数组,但这正是您想要的:

https://github.com/jseidelin/exif-js

<html>
<head>
<script type="text/javascript" src="../binaryajax.js"></script>
<script type="text/javascript" src="../exif.js"></script>
</head>
<body>

Click the images to read Exif data. The first image tests reading single tags, while the other two simply show all available data.
<br/><br/>
<img src="DSCN0614_small.jpg" id="img1" />
<br/>
<img src="Bush-dog.jpg" id="img2" />
<br/>
<img src="dsc_09827.jpg" id="img3" /><br/>
<script>
document.getElementById("img1").onclick = function() {
    EXIF.getData(this, function() {
        var make = EXIF.getTag(this, "Make"),
            model = EXIF.getTag(this, "Model");
        alert("I was taken by a " + make + " " + model);
    });
}

document.getElementById("img2").onclick = function() {
    EXIF.getData(this, function() {
        alert(EXIF.pretty(this));
    });
}

document.getElementById("img3").onclick = function() {
    EXIF.getData(this, function() {
        alert(EXIF.pretty(this));
    });
}

</script>

</body>
</html>
于 2013-02-26T17:28:30.723 回答