Permalink
Browse files

Fix so that portrait photos are correctly resized as well as landscap…

…e ones
  • Loading branch information...
1 parent 4406933 commit f2b9275c937dd6d2d6b31eb51c918fb05e5201f4 @evdb evdb committed Jul 6, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/image-proxy.js
View
@@ -72,15 +72,15 @@ module.exports = function () {
var image = gm( tempImageFile );
if( req.param('resize') ) {
- var newWidth = req.param('width');
- var newHeight = req.param('height');
+ var newWidth = req.param('width') || '';
+ var newHeight = req.param('height') || '';
if( !newHeight && !newWidth) {
res.send('need one of height and/or width to resize', 404);
return;
}
- image = image.resize(newWidth, newHeight);
+ image = image.resize(newWidth + 'x' + newHeight);
}
if ( req.param('grayscale')) {

0 comments on commit f2b9275

Please sign in to comment.