Skip to content

Commit

Permalink
Added custom crop options
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkow committed Sep 25, 2011
1 parent d855acf commit 455fb1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imagemagick.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ exports.crop = function (options, callback) {
resizeTo = (dSrc < dDst) ? ''+t.opt.width+'x' : 'x'+t.opt.height; resizeTo = (dSrc < dDst) ? ''+t.opt.width+'x' : 'x'+t.opt.height;
args = args.concat([ args = args.concat([
'-resize', resizeTo, '-resize', resizeTo,
'-gravity', 'Center', '-gravity', t.opt.gravity,
'-crop', ''+t.opt.width + 'x' + t.opt.height + '+0+0', '-crop', ''+t.opt.width + 'x' + t.opt.height + '+' + t.opt.top + '+' + t.opt.left,
'+repage' '+repage'
]); ]);
ignoreArg = false; ignoreArg = false;
Expand All @@ -327,6 +327,9 @@ exports.resizeArgs = function(options) {
colorspace: null, colorspace: null,
width: 0, width: 0,
height: 0, height: 0,
gravity: 'NorthWest',
top: 0,
left: 0,
strip: true, strip: true,
filter: 'Lagrange', filter: 'Lagrange',
sharpening: 0.2, sharpening: 0.2,
Expand Down

0 comments on commit 455fb1d

Please sign in to comment.