I am trying to use Graphics Magick to resize an image. I have installed the latest GrapchicsMagick and ImageMagick versions. I have installed
npm install gm
npm install im
too. My node.js code is:
var gm = require('gm').subClass({imageMagick: true});
var srcPath = __dirname + '\\' + userId + '.jpg';
var dstPath = __dirname + '\\' + userId + '-thumbnail.jpg';
gm(srcPath)
.resize(100, 100)
.noProfile()
.write(dstPath, function (err) {
if (!err) console.log('Image resized');
else console.log(err);
});
I am getting this error:
Error: Command failed: Invalid Parameter - -resize
I am using Windows 10 and I installed .exe and npm too.