Skip to content Skip to sidebar Skip to footer

Gm Conversion Issue In Node.js

I am converting an image from jpg to png, but it is giving the error. Below is the code and error. gm('E:/image1.jpg').write('E:/image2.png', function(err){ if (err){

Solution 1:

Probably graphicsmagick / imagemagick is not installed correctly, download GraphicsMagick or download ImageMagick, if your are using Ubuntu, these commands are useful.

sudo add-apt-repository ppa:dhor/myway
sudo apt-getupdate
sudo apt-get install graphicsmagick
sudo apt-get install imagemagick

Solution 2:

Try brew install graphicsmagick. Does that resolve the error you saw?

Solution 3:

I had the same problem on windows! Maybe my answer will help someone!

If you use gm on windows you should download windows binaries here and add gm.exe to your windows environment PATH variable. After that you have to restart your PC. Then install corresponding node package with npm install gm and it will work! ;)

Solution 4:

I have got it resolved by installing graphicsmagick and imagemagick and its path in environment variable will be automatically set out. Then I have to restart the windows to reflect the changes and now I can successfully converts and image.

Solution 5:

When installing ImageMagick from https://imagemagick.org/script/download.php, be sure to check the option to "Install legacy utilities (convert)".

Post a Comment for "Gm Conversion Issue In Node.js"