Permalink
Browse files

Merge pull request #8 from thiagoarrais/aspect

Fix bug when width/height are zero
  • Loading branch information...
2 parents ed0d06f + 6e98009 commit bec49536d025583f71bce598d23d4dfef2fb49df @rsms committed May 17, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 imagemagick.js
View
@@ -332,10 +332,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');

0 comments on commit bec4953

Please sign in to comment.