Browse files

add auto-orient option

  • Loading branch information...
1 parent 53284c0 commit 97a8b4e1e6cc5c02119321efb67eb092396d7bf0 @madhums committed Nov 6, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/imager.js
View
3 lib/imager.js
@@ -131,6 +131,7 @@ Imager.prototype.resizeFile = function (file, preset, fname, cb) {
, dest = '/tmp/' + remoteFile
gm(file['path'])
+ .autoOrient()
.resize(preset.size.split('x')[0], preset.size.split('x')[1])
.write(dest, function(err) {
if (err) return cb(err)
@@ -150,6 +151,7 @@ Imager.prototype.cropFile = function (file, preset, fname, cb) {
, dest = '/tmp/' + remoteFile
gm(file['path'])
+ .autoOrient()
.crop(preset.size.split('x')[0], preset.size.split('x')[1])
.write(dest, function(err) {
if (err) return cb(err)
@@ -169,6 +171,7 @@ Imager.prototype.resizeAndCropFile = function (file, preset, fname, cb) {
, dest = '/tmp/' + remoteFile
gm(file['path'])
+ .autoOrient()
.resize(preset.type.resize.split('x')[0], preset.type.resize.split('x')[1])
.gravity('Center')
.crop(preset.type.crop.split('x')[0], preset.type.crop.split('x')[1])

0 comments on commit 97a8b4e

Please sign in to comment.