Starting the ImageMagick process on a Windows server with the error "specified module not found."

I use ImageMagick to convert PDF files to PNG. Starting a process from my web API project works locally as long as I start Visual Studio as an administrator. When you move the solution to the server, the ImageMagick process fails with the following error

convert.exe: cannot load module `C: \ Program Files \ ImageMagick-6.9.0-Q16 \ modules \ coders \ IM_MOD_RL_PNG_.dll ': the specified module was not found.

I have both ghostscript and ImageMagick, as they should be on the server. What could be the reason for this? I can check if the module really exists on the server.

+7
c # imagemagick imagemagick-convert
source share
6 answers

The solution to this problem in my situation was to set the environment variable for ImageMagick directly in the code where I called the process.

System.Environment.SetEnvironmentVariable("Path", @"C:\Program Files\ImageMagick-6.9.0-Q16"); 

Obviously, even if the environment variable is set on the server, it may not find it due to the difference in runtime.

+7
source share

In my case, after a new installation of Imagemagick, I got a simillar error (I can’t load the module). What helped was simple:

Reboot system

Probably because the PATH system variable or something like this should take effect.

+3
source share

In my case, I was able to solve this problem using a portable version, so she does not need to find anything, since all this is built into exe.

+2
source share

If you just installed ImageMagick and are trying to start it from the command line, you will need to open a new command prompt window with the updated% PATH% environment variable.

You can try something with SETX, but opening a new command prompt window seems a lot easier.

0
source share

Restart Visual Studio or any IDE (even your prompts, close and reopen them).

The system path is not updated, it causes this error in my situation.

0
source share

Can imagemagick find libpng? Is it really installed? Are you calling ImageMagick convert.exe or Windows convert.exe?

 convert.exe -version 

should show png in the delegate list? What do you find from this team?

0
source share

All Articles