Skip to content
Browse files

Handle gm().size error.

When invalid image file uploaded, error occurs when gm try to
get the image size.
  • Loading branch information...
1 parent 027e834 commit 36edc4fdfdb1befef46720cb9cb1ee366b2d05c5 @noraesae committed Nov 27, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 server/handlers.js
View
4 server/handlers.js
@@ -62,6 +62,10 @@ function Handlers(web) {
var createThumbnailAndMinified = function() {
// get size
gm(original).size(function(err, size) {
+ if(err) {
+ response('resize_error:'+err);
+ return;
+ }
picture.width = size.width;
picture.height = size.height;

0 comments on commit 36edc4f

Please sign in to comment.
Something went wrong with that request. Please try again.