From 830d27caef6fe041b0b82f81b085f2c0825bf2f9 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 18 Aug 2015 15:17:07 -0400 Subject: [PATCH] dont ignore error --- src/image.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/image.js b/src/image.js index 078b2d134d..d35040ff9d 100644 --- a/src/image.js +++ b/src/image.js @@ -18,12 +18,16 @@ image.resizeImage = function(path, extension, width, height, callback) { }); } else { lwip.open(path, function(err, image) { + if (err) { + return callback(err); + } + image.batch() .cover(width, height) .crop(width, height) .writeFile(path, function(err) { - callback(err) - }) + callback(err); + }); }); } }; @@ -41,7 +45,7 @@ image.normalise = function(path, extension, callback) { if (err) { return callback(err); } - image.writeFile(path, 'png', callback) + image.writeFile(path, 'png', callback); }); } };