npm.io
0.2.0 • Published 9 years ago

img-exif

Licence
MIT
Version
0.2.0
Deps
0
Vulns
0
Weekly
0
Stars
1

<img-exif>

This vanilla web component simply takes a src attribute like the standard img element and renders it in it's correct orientation using any embedded EXIF data.

Note: This component only works for same-origin images or images with cross-origin headers!

img-exif has no dependencies (but may require a polyfill).

Install

Install img-exif with your preferred node package manager.

$ yarn add img-exif

or

$ npm install --save img-exif

You will need to include any polyfills for browsers that do not support the Web Components v1 spec. See https://github.com/webcomponents/webcomponentsjs.

Usage

Import the HTML file in the <head> after installing.

<link rel="import" href="./node_modules/img-exif/img-exif.html">

Use the tag on your page.

<img-exif src="./your-image.jpg"></img-exif>

Options

Attribute Type Default Description
src url Same as <img src="">

Limitations

  • No option to use height= or width= attributes. Use CSS width: and height: properties instead.

History

For changelog, see releases.

License

MIT License