es

exif-stripper

A Javascript plugin for stripping off exif data (image metadata) from any jpeg image

Showing:

Popularity

Downloads/wk

18

GitHub Stars

4

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

1

License

WTFPL

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial