2013-02-18 3 views
6

私の画像データを持つint8arrayからEXIF情報を取得する最良の方法は何でしょうか? 私は質問があまりにも単純化している知っているが、私は本当にEXIF from int8Array

を立ち往生しています私はこのライブラリを使用して考えていた:https://github.com/vjeux/jDataView またはこのライブラリを修正する:http://blog.nihilogic.dk/2008/05/reading-exif-data-with-javascript.html

+1

http://blog.nihilogic.dk/2008/05/r eading-exif-data-with-javascript.html? – Bergi

+0

可能な限り簡素化された独自の関数を記述したいと思います。 – Jacob

+0

このスクリプトは単純ではありませんか? – Bergi

答えて

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>