Mac OS build fails to load libpng15.15.dylib

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mac OS build fails to load libpng15.15.dylib

Post by fmw42 »

I am a little puzzled. You said you install from the IM binary, which I believe installs to /usr/local/bin by default. Yet the error says
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
So it is looking for libpng in /opt and not /usr. That seems odd to me.

(I do not know if this will help, but I install all my delegates from MacPorts and then install IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202)
32d2d7ee
Posts: 11
Joined: 2016-09-19T01:00:08-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by 32d2d7ee »

As of 2016-09-28T02:05:17+09:00, I downloaded the latest binary from https://www.imagemagick.org/download/binaries/ which is 7.0.1.

Is there a 7.0.3 version for the Mac available?

I would be happy to test whether that download PLUS the instructions lead to a working situation.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mac OS build fails to load libpng15.15.dylib

Post by fmw42 »

mannett
Posts: 3
Joined: 2016-11-25T11:13:47-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by mannett »

I too am having this problem:

iMac:vt Mike$ magick logo: logo.gif
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
Referenced from: /Users/Mike/ImageMagick-7.0.3/bin/magick
Reason: image not found
Trace/BPT trap: 5

I'm on OSX 10.11.6 and trying to install 7.0.3

environment is:

$ export
declare -x Apple_PubSub_Socket_Render="/private/tmp/com.apple.launchd.O6qr3hiTjM/Render"
declare -x DYLD_LIBRARY_PATH="/Users/Mike/ImageMagick-7.0.3/lib/"
declare -x HOME="/Users/Mike"
declare -x LANG="en_GB.UTF-8"
declare -x LOGNAME="Mike"
declare -x MAGICK_HOME="/Users/Mike/ImageMagick-7.0.3"
declare -x OLDPWD="/Users/Mike/Documents"
declare -x PATH="/Users/Mike/ImageMagick-7.0.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/share/dotnet"
declare -x PWD="/Users/Mike/Documents/vt"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_AUTH_SOCK="/private/tmp/com.apple.launchd.57p0n6zvu3/Listeners"
declare -x TERM="xterm-256color"
declare -x TERM_PROGRAM="Apple_Terminal"
declare -x TERM_PROGRAM_VERSION="361.1"
declare -x TERM_SESSION_ID="E3D1B844-8502-486E-8E61-EF2AD17752F3"
declare -x TMPDIR="/var/folders/pr/3p2h9w1d5hn4xryrhkcq7r8r0000gt/T/"
declare -x USER="Mike"
declare -x XPC_FLAGS="0x0"
declare -x XPC_SERVICE_NAME="0"
declare -x __CF_USER_TEXT_ENCODING="0x1FA:0x0:0x0"

I've tried lots of forums, but most appear to be trying to rescue perl/php rather than unix bin install.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mac OS build fails to load libpng15.15.dylib

Post by fmw42 »

What do you get listed from

Code: Select all

convert -version
Does it include libpng or png in the list of delegates?

Or what to you get from

Code: Select all

convert -list format
for the line regarding PNG
mannett
Posts: 3
Joined: 2016-11-25T11:13:47-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by mannett »

$ convert -version
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
Referenced from: /Users/Mike/ImageMagick-7.0.3/bin/convert
Reason: image not found
Trace/BPT trap: 5

and

$ convert -list format
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
Referenced from: /Users/Mike/ImageMagick-7.0.3/bin/convert
Reason: image not found
Trace/BPT trap: 5

For info I don't have a /opt/X11 version, but do have a /usr/X11 version. If I try and use that version I get the
Reason: Incompatible library version: convert requires version 27.0.0 or later, but libpng15.15.dylib provides version 25.0.0
message as per earlier post.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mac OS build fails to load libpng15.15.dylib

Post by fmw42 »

How did you install? From binary or from source? Sounds like your install did not go well or is missing libpng or you have a conflict between two versions of libpng. Or you don't have pkgconfig installed properly. Search the forum for discussions about pkgconfig and Mac OSX install. I seem to remember something about that. I have this in my .profile file

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig


Have you done that so IM knows where it resides?



Or try my method below.

I use MacPorts to install all my delegates and then install IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202
mannett
Posts: 3
Joined: 2016-11-25T11:13:47-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by mannett »

I installed from binary. I wonder if this download may have been built against an earlier OS version. I thought I read somewhere that apple regressed the library from version 27 to 25 in one of their upgrades. I can't vouch for that being true.... anyway....

Tried a build from source and it appears to work.
baloneygenerator
Posts: 3
Joined: 2016-12-08T11:37:18-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by baloneygenerator »

I had the same issue. Mac OS X Sierra 10.12.1.
Download from here: https://www.imagemagick.org/download/bi ... 6.0.tar.gz
Followed the instructions here: http://www.imagemagick.org/script/binary-releases.php
Result:
  • $ convert -version
    dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
Download from here: https://www.imagemagick.org/download/ImageMagick.tar.gz
Followed the instructions here: http://www.imagemagick.org/script/install-source.php
Everything worked OK.

Update: Everything didn't work OK. The delegates for jpeg, png and tiff were not compiled in. I followed the instructions here: viewtopic.php?f=1&t=10442.
That didn't help either, so I installed it with homebrew, which did work.
Last edited by baloneygenerator on 2016-12-08T15:05:16-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mac OS build fails to load libpng15.15.dylib

Post by fmw42 »

the binary download page at http://www.imagemagick.org/script/binar ... php#macosx says:

ImageMagick-x86_64-apple-darwin15.6.0.tar.gz download download Mac OS X El Capitan
baloneygenerator
Posts: 3
Joined: 2016-12-08T11:37:18-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by baloneygenerator »

Thanks for pointing that out, fmw42. I stand corrected.
sharella
Posts: 1
Joined: 2017-01-10T16:16:54-07:00
Authentication code: 1151

Re: Mac OS build fails to load libpng15.15.dylib

Post by sharella »

I can get over the first problem
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
Referenced from: /usr/local/ImageMagick-7.0.3/bin/convert
Reason: image not found

But then I get into the next one. All steps from beginning in detail:
System: OS-X El Capitan 10.11.6
Download: ImageMagick-x86_64-apple-darwin15.6.0.tar.gz
Verified digest: ok
Followed installation instructions on Download page but installed in /usr/local/mageMagick-7.0.3
(running as a normal user (not anymore root)

Code: Select all

$ export MAGICK_HOME=/usr/local/ImageMagick-7.0.3
$ export PATH=$MAGICK_HOME/bin:$PATH
$ export DYLD_LIBRARY_PATH=$MAGICK_HOME/lib
$ which convert
/usr/local/ImageMagick-7.0.3/bin/convert
Try 1:

Code: Select all

$ convert --version
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
  Referenced from: /usr/local/ImageMagick-7.0.3/bin/convert
  Reason: image not found
Trace/BPT trap: 5
Well X11 is under /usr - so i set:

Code: Select all

$ export DYLD_LIBRARY_PATH=$MAGICK_HOME/lib:/usr/X11/lib
Try 2:

Code: Select all

$ convert --version
dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib
  Referenced from: /usr/local/ImageMagick-7.0.3/bin/convert
  Reason: Incompatible library version: [color=#FF0000]convert requires version [b]27.0.0[/b][/color] or later, but [color=#FF0000]libpng15.15.dylib provides version [b]25.0.0[/b][/color]
Trace/BPT trap: 5
So (a) the binary searches the X11 libs below /opt - should be below /usr.
More importantly, (b), it does not work with the X11 version Apple ships with OS-X 10.11.6.
On the other hand the download is supposed to work with El Capitan (10.11.x) ....
or did i miss something ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mac OS build fails to load libpng15.15.dylib

Post by fmw42 »

Looks to me like you are using an older version of libpng on your system (libpng15?) Did you install it or did it come from the IM binary. I am using libpng @1.6.24_0. What is your exact version of libpng? You can find that from

convert -list format

Also libpng requires zlib. Is that installed? I am using zlib @1.2.8_0
konchog
Posts: 1
Joined: 2017-04-11T03:04:49-07:00
Authentication code: 1151

You are nearly there.

Post by konchog »

In this case, fmw42 is out of his depth. (Sorry, but it's true).

The fact that you see "dyld: Library not loaded: /opt/X11/lib/libpng15.15.dylib" is a GOOD thing.

Now you need to complete the installation.

All you need to do is to install X11, which is no longer installed by default.
You do NOT need to install any other libraries like libPNG or anything.

Download and install X11 from https://www.xquartz.org.

Then you should see something like:
convert -version

Version: ImageMagick 7.0.5-1 Q16 x86_64 2017-03-02 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib freetype lcms png
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: You are nearly there.

Post by fmw42 »

konchog wrote: 2017-04-11T03:11:56-07:00 In this case, fmw42 is out of his depth. (Sorry, but it's true).
Yes, I am not a software person. So I will defer in this case.

Please let us know how you get it resolved.
Post Reply