Socket
Socket
Sign inDemoInstall

exif-rotate-js

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exif-rotate-js

When you use input file, you can get base64 string as array without worrying about `orientation` of exif.


Version published
Weekly downloads
1.3K
decreased by-20.83%
Maintainers
1
Weekly downloads
 
Created
Source

exif-rotate-js ・ CircleCI

When you use input file, you can get base64 string as array without worrying about orientation of exif.

Usage

$ npm install exif-rotate-js

getBase64Strings(files, {maxSize})

return

return is string of base64 array like ["data:image/jpeg;base64,/9j/4AAQS..."]

files

files is input target files. User can select multiple files.

maxSize

default: 720

maxSize is canvas max size. When image's width is greater than height, maxSize applies to width. And vice versa.

Example

import { getBase64Strings } from 'exif-rotate-js/lib';

const elem = document.getElementById('fileImage');

if (elem) {
  elem.onchange = async e => {
    if (!e.target) return;
    const data = await getBase64Strings(e.target.files, { maxSize: 1024 });
    console.log(data); // ["data:image/jpeg;base64,/9j/4AAQS..."] as type of Array
  };
}

FAQs

Package last updated on 05 Aug 2020

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