mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
closes #4590
This commit is contained in:
10
src/image.js
10
src/image.js
@@ -15,7 +15,7 @@ image.resizeImage = function(data, callback) {
|
||||
extension: data.extension,
|
||||
width: data.width,
|
||||
height: data.height
|
||||
}, function(err, data) {
|
||||
}, function(err) {
|
||||
callback(err);
|
||||
});
|
||||
} else {
|
||||
@@ -79,7 +79,7 @@ image.normalise = function(path, extension, callback) {
|
||||
plugins.fireHook('filter:image.normalise', {
|
||||
path: path,
|
||||
extension: extension
|
||||
}, function(err, data) {
|
||||
}, function(err) {
|
||||
callback(err);
|
||||
});
|
||||
} else {
|
||||
@@ -94,6 +94,12 @@ image.normalise = function(path, extension, callback) {
|
||||
}
|
||||
};
|
||||
|
||||
image.load = function(path, callback) {
|
||||
new Jimp(path, function(err, data) {
|
||||
callback(err, data ? data.bitmap : null);
|
||||
});
|
||||
};
|
||||
|
||||
image.convertImageToBase64 = function(path, callback) {
|
||||
fs.readFile(path, function(err, data) {
|
||||
callback(err, data ? data.toString('base64') : null);
|
||||
|
||||
Reference in New Issue
Block a user