0

I have already issued the command for npm to install imagemagick. I have installed imagemagick exe on my machine and ran a test of a command to change the image type from jpg to png - and that worked. So in node js I have the following code:

im.resize({
  srcPath: req.files.recipeImage.filename,
  dstPath: beginName+"-small.jpg",
  width:   256
}, function(err, stdout, stderr){
  if (err) throw err;
});

Unfortunately in my project it returns:

Error: Command failed: Invalid Parameter - -set

I saw on another post and on the imagemagick website that it means the exe was not run, but I have the command line working in my control panel on Windows. Is there another step I am missing to get this to work?

user568109
  • 47,225
  • 17
  • 99
  • 123
tcoulson
  • 602
  • 3
  • 10
  • 37
  • What is the content of `req.files.recipeImage.filename` and `beginName` – Mustafa Jun 02 '13 at 19:01
  • Sorry Mustafa, I did not see your comment there, I kept looking for answers and missed the comment on my post. Anyway, I am getting back "tc.jpg" the name of my file for the req.files.recipeImage.filename (and I physically put a file next to index.js to make sure it could find it) and beginName is returned as "tc" which is correct too. – tcoulson Jun 25 '13 at 02:49

1 Answers1

0

See this discussion: imagemagick with nodejs not working

You have to install ImageMagick, choose the correct installation file from the site: Link

After restart Windows and you will see all will work.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109