2013-02-18 46 views
6

從int8array獲取EXIF信息的最佳方法是什麼?它有我的圖像數據。 我知道這個問題太簡單,但我真的堅持int8Array的EXIF

我想使用這個庫: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 2013-02-18 08:36:13

+0

我想寫我自己的功能,儘可能簡化。 – Jacob 2013-02-18 08:38:56

+0

這腳本不是很簡單嗎? – Bergi 2013-02-18 08:54:02

回答

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>