UNPKG

auto-rotate

Version:

Auto rotate JPEG images based on their EXIF Orientation tag. Promise based API.

11 lines (7 loc) 255 B
var rotator = require('./index.js'); rotator.autoRotateFile('rotated.jpg', 'fixed.jpg') .then(function(rotated) { console.log(rotated ? 'Image rotated' : 'No rotation was needed'); }).catch(function(err) { console.error('Got error: '+err); });