3

After wasting a lot of time until finally finding a solution, I decided to share this with the community.

The problem:

convert
dyld: Library not loaded: /usr/local/opt/little-cms2/lib/liblcms2.2.dylib
  Referenced from: /usr/local/bin/convert
  Reason: image not found
Abort trap: 6

This kept happening even after updating ImageMagick:

brew upgrade imagemagick

so what's the solution?

3

Looking at the error, we identify the missing file:

/usr/local/opt/little-cms2/lib/liblcms2.2.dylib

The first step is to make sure that the library is actually existing:

find /usr -name '*liblcms*'
find: /usr/sbin/authserver: Permission denied
/usr/local/lib/liblcms.1.0.19.dylib
/usr/local/lib/liblcms.1.dylib
/usr/local/lib/liblcms.a
/usr/local/lib/liblcms.dylib
/usr/local/Cellar/little-cms/1.19_1/lib/liblcms.1.0.19.dylib
/usr/local/Cellar/little-cms/1.19_1/lib/liblcms.1.dylib
/usr/local/Cellar/little-cms/1.19_1/lib/liblcms.a
/usr/local/Cellar/little-cms/1.19_1/lib/liblcms.dylib
/usr/local/Cellar/little-cms2/2.9/lib/liblcms2.dylib
/usr/local/Cellar/little-cms2/2.9/lib/liblcms2.a
/usr/local/Cellar/little-cms2/2.9/lib/liblcms2.2.dylib

So we can see that it does exist as /usr/local/Cellar/little-cms2/2.9/lib/liblcms2.2.dylib.

We need to create a symbolic link that will make convert find the missing file. It is possible that the brew installation script was missing to do that.

The way to create a symlink goes like this:

ln -s <exisiting file> <pointer to create>

So the final solution is simply this:

ln -s /usr/local/Cellar/little-cms2/2.9 /usr/local/opt/little-cms2

Let's verify:

convert
Version: ImageMagick 7.0.10-0 Q16 x86_64 2020-04-04 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1) 
Delegates (built-in): bzlib freetype gslib heic jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp xml zlib
Usage: convert [options ...] file [ [options ...] file ...] [options ...] file
...


Mission completed :)

1
  • 3
    Awesome! I know the system won’t let you select your own answer for a while, but please mark the check when you get a chance. Thanks for the solid Q and A – bmike Apr 10 '20 at 16:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .