Imagemagick with nodejs not working

I am trying to resize an image using the node-imagemagick library, but it does not work.

The code I use to resize

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

It gives an error

 Error: Command failed: Invalid Parameter - -set at ChildProcess.<anonymous> (E:\NodeJsDevelopment\node_modules\imagemagick\imagemagick.js:64:15) at ChildProcess.EventEmitter.emit (events.js:91:17) at Process._handle.onexit (child_process.js:674:10) 
+6
source share
2 answers

In windows you also need to install imagemagick exe. The imagemagick nodejs library is just a wrapper for imagemagick exe. Thus, it will not work until imagemagick exe is started, and the conversion and identification of the executable are in the way.

+13
source

You just did not install ImageMagick on your system. If you are using a Linux distribution, you can:

 sudo apt-get install ImageMagick 
0
source

Source: https://habr.com/ru/post/921576/


All Articles