Skip to content

Commit

Permalink
Merge fc800fd into 88dbd3d
Browse files Browse the repository at this point in the history
  • Loading branch information
lardissone committed May 30, 2015
2 parents 88dbd3d + fc800fd commit 1706bc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ PostSchema.plugin(crate, {
blur: '5x10'
```
You can add the `auto-orient` parameter by just adding it to the transforms object as: `autoOrient: true`. Note: it doesn't cares about the parameter value, if it's present it means it's active.
For more information on available transforms, see the [GraphicsMagick website](http://www.graphicsmagick.org/convert.html).
### Changing the destination format
Expand Down
7 changes: 6 additions & 1 deletion lib/ImageMagick.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ ImageMagick.prototype._setUpTransform = function(attachment, transform, outputFi
tasks.push(function(callback) {
async.waterfall([function(callback) {
var args = self._setUpConvertArgs(transform)
var processor = gm(attachment.path).options({imageMagick: self._options.imageMagick}).command('convert')
var processor = gm(attachment.path);
if(args.indexOf('-autoOrient') > -1) {
args.splice(args.indexOf('-autoOrient'), 2);
processor = processor.autoOrient();
}
processor = processor.options({imageMagick: self._options.imageMagick}).command('convert')
processor.out.apply(processor, args).write(outputFile, callback)
}, function(error) {
var callback = arguments[arguments.length - 1]
Expand Down

0 comments on commit 1706bc3

Please sign in to comment.