Giter VIP home page Giter VIP logo

exif's Introduction

Exif

JavaScript Exif reader (only available in the browser).

Install

npm install @fengyuanchen/exif
<script src="/path/to/exif.js"></script>

Usage

Four available usages:

  • new Exif(HTMLImageElement, options)
  • new Exif(HTMLImageElement.src, options)
  • new Exif(File, options)
  • new Exif(Blob, options)

Example:

<img id="image" src="image.jpg">
var image = document.getElementById('image');
var exif = new Exif(image, {
  done: function(tags) {
    console.log(tags);
  }
});

Options

You may set cropper options with new Exif(image, options).

exif

  • Type: Boolean
  • Default: true

Read Exif tags.

gps

  • Type: Boolean
  • Default: true

Read GPS tags.

interoperability

  • Type: Boolean
  • Default: true

Read interoperability tags.

ignored

  • Type: Array or Boolean
  • Default: ['MakerNote', 'UserComment']

Assign the ignored tags. Set false to disable it.

done

  • Type: Function
  • Default: null

Read success callback.

new Exif(image, {
  done: function(tags) {
    console.log(tags);
  }
});

fail

  • Type: Function
  • Default: null

Read error callback.

new Exif(image, {
  fail: function(message) {
    console.log(message);
  }
});

No conflict

If you have to use other global function with the same namespace, just call the Exif.noConflict static method to revert to it.

<script src="other-exif.js"></script>
<script src="exif.js"></script>
<script>
  Exif.noConflict();
  // Code that uses other `Exif` can follow here.
</script>

Browser support

  • Chrome (latest 2)
  • Firefox (latest 2)
  • Internet Explorer 10+
  • Opera (latest 2)
  • Safari (latest 2)

License

MIT © Fengyuan Chen

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.