img-exif
v0.2.0
Published
A dependency-free vanilla web component that correctly orients images based on their EXIF data.
Maintainers
Readme
<img-exif>
This vanilla web component simply takes a
srcattribute like the standardimgelement 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-exifhas 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-exifYou 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=orwidth=attributes. Use CSSwidth:andheight:properties instead.
History
For changelog, see releases.
