8000 GitHub - fyvfyv/reset-image-orientation: Reset uploaded image orientation based on EXIF
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fyvfyv/reset-image-orientation

Repository files navigation

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-orientation';

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

About

Reset uploaded image orientation based on EXIF

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0