<script src="jquery.exif.js"></script> ~略~ <input type="file" id="file1" />
$('#file1').change(function() {
// アップロードファイルからExif情報を抜出す。
$(this).fileExif(function(exif) {
console.log(exif);
});
});
サンプル1
<script src="jquery.exif.js"></script>
function test(){
// サーバー上の画像ファイルから、Ajaxを利用してバイトデータを取得する
var xhr = new XMLHttpRequest();
xhr.open('GET', 'img/test4.jpg', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
// 画像ファイルのバイトデータを取得する
var arrayBuffer = this.response;
// バイトデータとコンテンツタイプからBlobを生成する
var blob = new Blob([arrayBuffer], {type: "image/jpeg"});
// BlobからExif情報を取得する
$.fileExif(blob,function(exif){
console.log(exif);
});
};
xhr.send();
}
サンプル2

Exif出力