reset-image-orientation
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

reset-image-orientation

Reset uploaded image orientation based on EXIF

Installation

npm install reset-image-orientation

Javascript example

var resetOrientation = require('reset-image-orientation');

var input = document.querySelector('input[type="file"]');
var img = document.querySelector('img');

input.addEventListener('change', function(e) {
    e.preventDefault();

    var file = e.target.files[0];

    resetOrientation.default()(file, function(base64) => {
        img.src = base64;
    });
});

Typescript example

import resetOrientation from 'reset-image-orintation';

const input = document.querySelector('input[type="file"]');
const img = document.querySelector('img');

input.addEventListener('change', function(e: Event) {
    e.preventDefault();

    var file = e.target.files[0];

    resetOrientation(file, function(base64: string) => {
        img.src = base64;
    });
});

License

MIT

Package Sidebar

Install

npm i reset-image-orientation

Weekly Downloads

19

Version

2.1.2

License

MIT

Unpacked Size

9.63 kB

Total Files

6

Last publish

Collaborators

  • fyvfyv