2.1.2 • Published 1 year ago

reset-image-orientation v2.1.2

Weekly downloads
178
License
MIT
Repository
github
Last release
1 year ago

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

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.0

5 years ago