react-fix-image-orientation

0.1.4 • Public • Published

react-fix-image-orientation

img element wrapper component for React that understands EXIF orientation information and corrects it using CSS transforms.

Example

Installation

npm install --save react-fix-image-orientation
# or 
yarn add react-fix-image-orientation

Usage

Instead of using an img element, use this component instead:

import React from 'react';
import Img from 'react-fix-image-orientation'
 
const MyComponent = () =>
  <Img
    src="https://github.com/recurser/exif-orientation-examples/blob/master/Portrait_8.jpg?raw=true"
    alt="A waterfall"
  />

All properties will be cleanly passed to the img element including style and onLoad that this component uses under the hood. However, keep in mind that you should be aware that width/height and other dimension manipulations may not work as expected.

Development

yarn is preferred to work with this project.

Dev server

Just start a server with yarn start.

Package Sidebar

Install

npm i react-fix-image-orientation

Weekly Downloads

224

Version

0.1.4

License

MIT

Unpacked Size

1.89 MB

Total Files

14

Last publish

Collaborators

  • yogakurniawan