mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
dont ignore error
This commit is contained in:
10
src/image.js
10
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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user