Code Monkey home page Code Monkey logo

exifreader's Introduction

ExifReader

ExifReader is a JavaScript library (written in CoffeeScript) that parses image files and extracts the Exif data.

Usage

var exif = new ExifReader();
exif.load(fileBuffer);
var imageDate = exif.getTagDescription('DateTimeOriginal');
var allTags = exif.getAllTags();

Installation

The easiest way is to use Bower:

bower install exifreader

Support

The library makes use of the DataView API which is supported in Chrome 9+, Firefox 15+ and Internet Explorer 10+. If you want to support a browser or Node.js that doesn't have DataView support, you should probably use a wrapper like jDataView by Christopher Chedeau.

Examples

A full HTML example page is located in the examples/html/ directory. The example uses the FileReader API which is supported by the latest versions of all the major browsers.

Also, there is a Node.js example in the example/node/ directory that uses a simple wrapper for the DataView API.

Tips

  • Only load part of the image file since the Exif info segment has a max size. I suggest 128 kB. See the examples folder for a way to do this.
  • After parsing the tags, consider deleting the MakerNote tag if you know you will have a lot of ExifReader instances. It can be really large for some manufacturers. See the examples folder to see how you can do that.

Testing

Testing is done with jasmine-node. Use either the Cakefile or jasmine-node directly:

jasmine-node --coffee spec/

Issues

  • The descriptions for UserComment, GPSProcessingMethod and GPSAreaInformation are missing for other encodings than ASCII.

Changelog

  • September 17, 2014:
    • Lower memory usage by unsetting the file data object after parsing.
    • Add deleteTag method to be able to delete tags that use a lot of memory, e.g. MakerNote.
  • September 9, 2013:
    • Make parsing of APP markers more robust. Fixes problems with some pictures.
  • July 13, 2013:
    • Throw Error instead of just strings.
  • April 23, 2013:
    • Support hybrid JFIF-EXIF image files.
  • April 22, 2013:
  • January 8, 2013:
    • Updated text about browser support.
  • January 19, 2012:
    • Added text descriptions for the tags.
  • January 1, 2012:
    • First release.

exifreader's People

Contributors

mattiasw avatar mattcg avatar readmecritic avatar

Watchers

James Cloos avatar MARCHAL Amaury avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.