/* TODO
// the files are in different modules
// next step is to add the 3 define lines to any module
// and use any amd loader to support it in the browser again ...
// it is strongly recommended to review this code ("written from the scratch")
// see the in-code comments like TODO, FIXME or NOTE ...
*/
A pure javascript implementation of Phil Harvey's excellent exiftool. This extends work started by Jacob Seidelin and aims to support parsing of all the tags that exiftool is capable of.
See how well this dev fork is doing in the latest Coverage report
With jQuery:
$(this).getExif(url, function(exif) {
console.log("Make is : " + exif["Make"]);
});
Or you can read from a local file (like drag and drop):
var binaryReader = new FileReader();
binaryReader.onloadend = function() {
var exif = $(this).findEXIFinJPEG(binaryReader.result);
console.log("Make is : " + exif["Make"]);
}
binaryReader.readAsBinaryString(file);
Or using node.js (exiftool.js is packaged on npm here):
var exiftool = require('exiftool.js');
var fs = require('fs');
exiftool.getExif(imgFile, function(exif) {
console.log("Make is : " + exif["Make"]);
});
You can view exactly how the results from this library fair verses the perl library against images from 6,000 different camera models here: Coverage report master Coverage report this fork
I see no reason why this library can't match (and exceed!) the parsing capabilities of the orginal perl library but I need your help. Please fork this repo, create pull request and issue, whatever. You can just play with making improvements to the code so that the coverage goes up. It's easy to see how much your changes are improving this thanks to the coverage report above. To regenerate this simply go to the test folder and run:
node reportNode.js
This will thrash every sample image through exiftool.js, and variants of node-exif then generate the report files to compare the output.
If you want to test some of your own image files, copy them into the sampleImages/_Other directory. Then, if you want to check them in, I have a script (c/o Phil Harvey) that will swap the main image with a small blank white square. This keeps the files small but don't rely on it giving you full anonymity because there may still be thumbnail image data in the file or other personal info in the filesname or other exif tags.
The script is called swap_image.pl
but to keep things complicated, I suggest you just run the ant script:
ant