reset-image-orientation
v2.1.2
Published
Reset uploaded image orientation based on EXIF
Downloads
565
Maintainers
Readme
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;
});
});