Solved ImageMagick not working (unable to load module)

Hi there,

I installed graphics/ImageMagick7-nox11 with pkg and I’m unable to have it working.

The command convert input.png output.jpg fails with the error:
convert: unable to load module '/usr/local/lib/ImageMagick-7.0.3//modules-Q16HDRI/coders/': file not found [USER=37853]error[/USER]/module.c/OpenModule/1279.
convert: no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/508.
convert: no images defined `output.jpg' @ error/convert.c/ConvertImageCommand/3253.

At first I thought the error was due by the double / in the path, so I tried with:
export MAGICK_CODER_MODULE_PATH=/usr/local/lib/ImageMagick-7.0.3/modules-Q16HDRI/coders

Without success: the path is now correct, yet the error remains. A check with
ls -lsa /usr/local/lib/ImageMagick-7.0.3/modules-Q16HDRI/coders/
-rwxr-xr-x  1 root  wheel   915B Mar 18 13:11 /usr/local/lib/ImageMagick-7.0.3/modules-Q16HDRI/coders/

I also checked the permissions of all intermediate folders. Everything looks fine.

  • FreeBSD 11.0-STABLE r313553 without X11;
  • Version: ImageMagick 7.0.3-7 Q16 amd64
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib fftw fontconfig fpx freetype jbig jng jp2 jpeg lcms lqr ltdl lzma png tiff webp wmf xml zlib

As reference:
ldd /usr/local/bin/convert
/usr/local/bin/convert: => /usr/local/lib/ (0x800822000) => /usr/local/lib/ (0x800bee000) => /usr/local/lib/ (0x800f08000) => /usr/local/lib/ (0x801111000) => /usr/local/lib/ (0x801370000) => /usr/local/lib/ (0x80157f000) => /usr/local/lib/ (0x801887000) => /usr/local/lib/ (0x801a91000) => /usr/local/lib/ (0x801e12000) => /usr/local/lib/ (0x802058000) => /usr/lib/ (0x802300000) => /usr/lib/ (0x802529000) => /lib/ (0x80273c000) => /lib/ (0x802953000) => /lib/ (0x802b7d000) => /lib/ (0x802da4000) => /usr/local/lib/ (0x803158000) => /usr/local/lib/ (0x803453000) => /usr/local/lib/ (0x8036c9000)

Please notice I also tried graphics/ImageMagick-nox11 (the previous version) and it has the very same issue.

Has anyone had a similar issue? Any ideas on how to fix this?

Thank you very much for your support.

Best Regards,

It looks like the type of error you get when mixing packages and ports. Have you done so on this machine? (Used ports for something)?

if so, you might want to see if building it from ports helps.
Yes, I mostly installed everything from pkg, except a few packages I needed from port (for custom options).

Indeed, I rebuilt the entire box (is a FreeBSD virtual machine) for other reasons and now everything is working fine.

Thanks a lot for your suggestion.