Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to resize an image with node-imagemagick library, but it is not working.

the code i am using to resize is

im.resize({
      srcPath: __dirname+'originalimage.jpg',
      dstPath: __dirname+'resized.jpg',
      width: 50
    }, function(err, stdout, stderr){
      if (err) throw err;

    });

It throws the error

Error: Command failed: Invalid Parameter - -set

    at ChildProcess.<anonymous> (E:NodeJsDevelopment
ode_modulesimagemagickimagemagick.js:64:15)
    at ChildProcess.EventEmitter.emit (events.js:91:17)
    at Process._handle.onexit (child_process.js:674:10)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
710 views
Welcome To Ask or Share your Answers For Others

1 Answer

On windows you also need to install the imagemagick exe. The nodejs imagemagick library is just a wrapper for imagemagick exe. So it will not work untill the imagemagick exe is intalled and convert and identify executable are in path.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...