mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15: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 {
|
} else {
|
||||||
lwip.open(path, function(err, image) {
|
lwip.open(path, function(err, image) {
|
||||||
|
if (err) {
|
||||||
|
return callback(err);
|
||||||
|
}
|
||||||
|
|
||||||
image.batch()
|
image.batch()
|
||||||
.cover(width, height)
|
.cover(width, height)
|
||||||
.crop(width, height)
|
.crop(width, height)
|
||||||
.writeFile(path, function(err) {
|
.writeFile(path, function(err) {
|
||||||
callback(err)
|
callback(err);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -41,7 +45,7 @@ image.normalise = function(path, extension, callback) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
image.writeFile(path, 'png', callback)
|
image.writeFile(path, 'png', callback);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user