Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXIF from int8Array

What would be the best approach to get EXIF info from int8array which has my image data. I know the question is too simplified but I am really stuck

I was thinking about using this library: https://github.com/vjeux/jDataView Or modifying this library: http://blog.nihilogic.dk/2008/05/reading-exif-data-with-javascript.html

like image 205
Jacob Avatar asked Feb 18 '13 07:02

Jacob


Video Answer


1 Answers

You would have to make minor modifications to this script, because it creates its own byte array, but this does exactly what you want:

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>
like image 175
Zach Riggle Avatar answered Oct 14 '22 21:10

Zach Riggle