Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle gm().size error.

When invalid image file uploaded, error occurs when gm try to
get the image size.
  • Loading branch information...
commit 36edc4fdfdb1befef46720cb9cb1ee366b2d05c5 1 parent 027e834
@noraesae authored
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;
Please sign in to comment.
Something went wrong with that request. Please try again.