rotation-css

0.3.2 • Public • Published

RotationCSS

This npm package parses the exif data of a jpeg file and returns a hash that has the necessary CSS to rotate the image correctly.

  import rotationCSS from 'rotation-css';
 
  const inputElement = document.querySelector("input")
  const imageElement = document.querySelector("img")
 
  const reader = new FileReader();
  reader.onload = function(event) {
    imageElement.src = event.target.result;
    imageElement.style = rotationCSS(event.target.result);
  };
  reader.readAsDataURL(inputElement.files[0]);

This package uses code based on Exif.js to extract the actual metadata.

Readme

Keywords

Package Sidebar

Install

npm i rotation-css

Weekly Downloads

8

Version

0.3.2

License

MIT

Unpacked Size

8.44 kB

Total Files

8

Last publish

Collaborators

  • bitboxer