Skip to content

Commit

Permalink
Fix bug that made height x width to be sometimes inverted when one wa…
Browse files Browse the repository at this point in the history
…s zero
  • Loading branch information
thiagoarrais committed May 2, 2011
1 parent 72553e2 commit 6e98009
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imagemagick.js
Expand Up @@ -299,10 +299,10 @@ exports.resizeArgs = function(options) {
args.push('-strip');
}
if (opt.width || opt.height) {
if (opt.height === 0) opt.height = opt.width;
else if (opt.width === 0) opt.width = opt.height;
args.push('-resize');
args.push(String(opt.width)+'x'+String(opt.height));
if (opt.height === 0) args.push(String(opt.width));
else if (opt.width === 0) args.push('x'+String(opt.height));
else args.push(String(opt.width)+'x'+String(opt.height));
}
opt.format = opt.format.toLowerCase();
var isJPEG = (opt.format === 'jpg' || opt.format === 'jpeg');
Expand Down

0 comments on commit 6e98009

Please sign in to comment.