npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

exif-rotate-js

1.0.3 • Public • Published

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
  };
}

Keywords

none

install

npm i exif-rotate-js

Downloadsweekly downloads

392

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability