Socket
Socket
Sign inDemoInstall

exif-orientation

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    exif-orientation

Returns the exif orientation is scale / rotation from a file object


Version published
Weekly downloads
619
increased by11.53%
Maintainers
1
Install size
1.36 MB
Created
Weekly downloads
 

Readme

Source

exif-orientation

stable

Returns the exif orientation in scale / rotation from a file object

Install

npm install exif-orientation --save

Example

The following example reacts to the onChange event of a file upload html input

var findOrientation = require('exif-orientation');

fileUpload.addEventListener('change',function(e) {
  var file = e.target.files[0];
  findOrientation(file,function(err,orientation) {
    if (!err) {
      console.log(orientation); // displays {scale: {x: 1, y: 1}, rotation: 90}
    }
  });
});

Usage

NPM

findOrientation(file,callback)

file A file object from a file upload html input
callback A function to be called once the orientation data is found or an error occured. The callback is passed 2 arguments (err,orientation). If err is undefined, orientation will contain the orientation data, otherwise err will be an Error object with the message of the error.

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Last updated on 14 Sep 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc