Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

exif-auto-rotate

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exif-auto-rotate

`exif-auto-rotate` is a module that helps you for applying the right orientation to JPEG images, based on its EXIF tag. It applies the right orientation to a JPEG image. Resets to orientation 1 from all orientation codes. It returns of new image's base64

  • 0.3.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
952
decreased by-19.39%
Maintainers
1
Weekly downloads
 
Created
Source

Exif Auto Rotate

All Contributors

Build Status

exif-auto-rotate is a module that helps you for applying the right orientation to JPEG images, based on its EXIF tag.

  • Resets to orientation 1 from all orientation codes. It returns of new image's base64 URI or Blob.
  • The URI can be used as the source of an <Image> component.

Setup

Install the package:

npm i exif-auto-rotate

or

yarn add exif-auto-rotate

Usage

import Rotator from 'exif-auto-rotate';

// sync
Rotator.createRotatedImage(
  file, // the file of the new image that can now be uploaded.
  outputType  // the output type of the new image.
  responseUriFunc,  // the callBack function of the new image URI
);

// async
Rotator.createRotatedImageAsync(
  file, // the file of the new image that can now be uploaded.
  outputType  // the output type of the new image.
);

Examples

// sync
Rotator.createRotatedImage(file, "base64", (uri) => {
  console.log(uri);
});

// async
try {
  const file = event.target.files[0];
  const uri = Rotator.createRotatedImageAsync(file, "base64");
  console.log(uri);
} catch (err) {
  console.log(err);
}
OptionDescriptionTypeRequired
filePath of image fileobjectYes
outputTypeCan be either base64 or blob.(Default type is base64)stringNo
responseUriFuncCallback function of URI. Returns URI of rotated image's base64 or Blob format. ex: uri => {console.log(uri)});functionYes (sync only)

License

MIT

Contributors

Contributions of any kind welcome!


Pablo Suarez

🚧 💻

Stephan Bijzitter

🚧 💻

Keywords

FAQs

Package last updated on 07 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc