npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

exiftool.js

v0.3.0

Published

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.

Downloads

37

Readme

exiftool.js

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 we're doing in the latest Coverage report

Usage

With jQuery:

$(this).getExifFromUrl(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.getExifFromLocalFileUsingNodeFs(fs, imgFile, function(err, exif) {
    console.log("Make is : " + exif["Make"]);
});

Coverage

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

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.

To keep this a small module on npm, the test images are stored in a different repository: https://github.com/mattburns/exiftool.js-dev-dependencies They are fetched when installing this npm module if you pass the --dev flag to fetch devDependencies.

It's easy to see how much your changes are improving this thanks to the coverage report above. To regenerate this simply run:

mocha

This will thrash every sample image through exiftool.js, and variants of node-exif then generate the report files to compare the output.

Alternatively, there's a slower version for the paranoid:

node test/test.js clean

This will do the same thing, but also ensure the json output files generated from the perl exiftool are up to date.

Adding more images

If you want to test some of your own image files, copy them into the sampleImages/_Other directory in the repository: https://github.com/mattburns/exiftool.js-dev-dependencies 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