I am running graphicsMagick along with node on windows. I want to resize image and reduce quality. Below is my code. Unforutnately the image is neither resized nor reduced in Quality although I dont have any error. Below is my code.
var gm = require('gm'),
graphicsMagick = gm.subClass({imageMagick: true});
//resizing image with graphicsMagick and storing in the same path
graphicsMagick(fullPathFileName)
.resize(null, 150)
.noProfile()
.quality(70)
.write(fullPathFileName, function (err) {
if (!err) console.log('Image resized');
});
Further imageMagick is installed.
Although, I should agree that when I used imageMagick directly in node by requiring image magic, I got the error described in link imagemagick with nodejs not working so instead of imageMagick I required graphicsMagick, now there is no error but nothing happening on file too.
code that generated error while requiring imageMagick was -->
var im = require('imagemagick');
im.resize({
srcPath: fullPathFileName,
dstPath: fullPathFileName,
height: 150,
quality: 0.8,
format: 'png' }, function (err, stdout, stderr) {
if (err) throw err;
console.log('resized image to fit 150px height');
});
I uploaded the app to heroku and still graphicsMagick doesn't resize image and no errors, what's happening?
Regards, Chidan