1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
window.onload=getExif;
function gotTag() {
var make = EXIF.getTag(this, "Make");
var model = EXIF.getTag(this, "Model");
var makeAndModel = document.getElementById("makeAndModel");
makeAndModel.innerHTML = `${make} ${model}`;
var long = EXIF.getTag(this, "GPSLongitude");
var lat = EXIF.getTag(this, "GPSLatitude");
var coord = document.getElementById("coordo");
coord.innerHTML = `${long} // ${lat}`;
}
function gotTagAll() {
var allMetaData = EXIF.getAllTags(this);
var allMetaDataSpan = document.getElementById("allMetaDataSpan");
allMetaDataSpan.innerHTML = JSON.stringify(allMetaData, null, "\t");
}
function getExif() {
var img1 = document.getElementById("img1");
EXIF.getData(img1, gotTag);
//var img2 = document.getElementById("img2");
//EXIF.getData(img2, gotTagAll)
}
//var img1 = document.getElementById("img1");
//console.log(EXIF.getTag(img1,"Model")); |
Partager