Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.
/ scenic Public archive

Commit

Permalink
Handle gm().size error.
Browse files Browse the repository at this point in the history
When invalid image file uploaded, error occurs when gm try to
get the image size.
  • Loading branch information
HyeonJe Jun committed Nov 26, 2012
1 parent 7799c42 commit f679535
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f679535

Please sign in to comment.