This commit is contained in:
barisusakli
2016-05-01 12:44:43 +03:00
parent e9d548d057
commit fea18a050f
2 changed files with 47 additions and 27 deletions

View File

@@ -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);