The gm is giving the gm().write() expects a callback function
error. The write function comes from fs
so I also promisified it. Still it does not work.
var gm = bluebird.promisifyAll(require("gm"));
var fs = bluebird.promisifyAll(require("fs"));
gm(filePath).resize(null, 128).write(file)
.then(function() {
console.log("Done");
})
.catch(function(err) {
console.log(err);
});
How to use promise with gm
?