Giter Club home page Giter Club logo

exif-stripper's Introduction

Exif-Stripper

A lightweight JavaScript plugin for stripping off EXIF data (image metadata) from any jpeg image

Installation

npm install exif-stripper

Usage

var exifStripper = require('exif-stripper');

Simply call the .strip function that takes one argument (image url). This will return a promise, once resolved you can use .then to capture the response containing a blob url. The new url will point to the same image with all exif data stripped off.

exifStripper.strip(IMAGE_URL)
  .then( function(response){ alert(response.url) });

Important Note

Because of the browser's same origin policy, the image has to be served from the same source as the website requesting it. OR the image has to be served from a source that has sufficient CORS Permissions. For more infomration about setting up CORS policies, check this article Using CORS


What is EXIF?

Short answer: it is the metadata attached to any photo taken by a digital camera (including smartphones)

Exif stands for (Exchangeable image file format) and can contain a wide range of information, such as (location where image was taken, original orientation, the type of camera used, etc.) For more information, read Description of Exif file format

Why strip off EXIF?

You'll find many opinions about why exif data should be stripped off images. Those opinions mostly revolve around privacy concerns.

My personal motivation for stripping off exif data from images is to avoid images being displayed differently across different operating systems.

For example, iOS takes the exif orientation value into account before displaying an image. On the other side, Android ignores this value altogether. This means that the same image will be displayed differently across different devices, and you will have no easy way of knowing/controlling this.

Read this article EXIF Orientation Handling Is a Ghetto by Dave Perrett where he explains why this is a big problem. And I quote him:

"The problem is that there doesn’t seem to be any consensus on how to handle these orientation tags on the web. Results vary wildly across sites, between different products from the same company, between browsers, and even within a single browser depending on context (yes I’m looking at you Safari). Images with the same orientation value may also be rotated differently on some sites depending on whether they’re landscape or portrait."

This plugin reuses a portion of Musa's awesome answer to the question How to Strip EXIF data from image on SO

exif-stripper's People

Contributors

mshibl avatar cori avatar

Watchers

 avatar James Cloos 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.