I am trying to extract EXIF data from a image(jpeg) which has been dragged into the browser or has been selected via a html file input element.
I ma
Have a look at the code of the FxIF firefox extension. It reads exif data using only JavaScript. To read the file contents, you can use the FileReader API of modern browsers.
jQuery-fileExif javascript library reads image exif data before upload.
GitHub link, example jsfiddle from the library.
var someCallback = function(exifObject) {
$('#cameraModel').val(exifObject.Model);
$('#lat').val(exifObject.GPSLatitude);
$('#lng').val(exifObject.GPSLongitude);
// Uncomment the line below to examine the
// EXIF object in console to read other values
//console.log(exifObject);
}
try {
$('#file').change(function() {
$(this).fileExif(someCallback);
});
}
catch (e) {
alert(e);
}
I finally found a client side solution for the problem:
FileReader
and the method .readAsBinaryString
EXIF.readFromBinaryFile(binaryFileObject);
and its done :)