Page 1 of 1

libpng delegate no longer found

Posted: 2015-12-15T11:08:37-07:00
by axelrose
Hi all,

I try to compile 6.9.2-8 but can no longer bind the libpng delegate. "./configure --with-png=yes" ends up with the report

Code: Select all

  PNG               --with-png=yes              no
Up to 6.8.9-10 everything works well though. The same compiled libpng is recognized. I tried libpng 1.6.18, 1.6.19 and 1.6.20, just didn't dare to check 1.7beta yet.

The configure shell code from 6.8.9-10/configure and 6.9.2-8/configure looks very different when checking for the PNG delegate library.

So my question: did I miss some important change for using libpng or is it just a local incident.


Thanks for your time,
Axel.

Re: libpng delegate no longer found

Posted: 2015-12-15T12:22:07-07:00
by fmw42
To help the developers, please specify what platform and how you installed IM (from binary or from source). Where did you get the installation module?

What do you get from

Code: Select all

convert -version

Re: libpng delegate no longer found

Posted: 2015-12-15T12:33:27-07:00
by axelrose
I compiled from source using ImageMagick-6.9.2-8.tar.gz and libpng-1.6.19.tar.gz

roughly like this:

Code: Select all

mkdir /tmp/install
cd libpng-1.6.19
./configure CFLAGS=-O3 --prefix=/tmp/install --enable-shared --disable-dependency-tracking
make check && make install
cd ../ImageMagick-6.9.2-8
./configure LDFLAGS=-L/tmp/install/lib CFLAGS=-O3 --prefix=/tmp/install --enable-shared --disable-dependency-tracking --with-png=yes
make check
PNG is a usable delegate for me with this procedure and IM 6.8.* but not with 6.9

Re: libpng delegate no longer found

Posted: 2015-12-15T12:45:46-07:00
by fmw42
What do you get from

Code: Select all

convert -version
What is your platform?

Re: libpng delegate no longer found

Posted: 2015-12-15T13:46:59-07:00
by axelrose
MacOS X 10.11.2

I cannot build 6.9.2-8 so cannot report "convert -version"

My latest 6.8.9-10 build though gives:

Code: Select all

Version: ImageMagick 6.8.9-10 Q16 x86_64 2015-11-11 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC OpenCL
Delegates: jng jpeg lcms png tiff webp xml zlib

Re: libpng delegate no longer found

Posted: 2015-12-15T14:51:54-07:00
by magick
Modern releases of ImageMagick uses libpng.pc to find and configure the PNG delegate library. Make sure libpng.pc is in your configure path. You can set a custom path with the PKG_CONFIG_PATH environment variable. If that fails, review config.log. It will tell you exactly why the PNG delegate failed to validate.

Re: libpng delegate no longer found

Posted: 2015-12-15T15:14:23-07:00
by fmw42
I am on Mac OSX snow leopard. I had to install pkgconfig and then set it s path in my .profile file.

Code: Select all

cat .profile

# MacPorts Installer addition on 2011-11-30_at_14:35:14: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

export PATH="${PATH}:/Users/fred/Applications/ImageMagick-Scripts/bin:/Users/fred/Applications/ImageMagick-Scripts/bin/Instagrams"
export DISPLAY=:0
export GDFONTPATH=/Library/fonts/
export TMPDIR=/tmp
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig
I use MacPorts to install most of my delegates (but not pkgconf) and then install IM from source. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202

But you could just install IM from binary or from MacPorts.

Re: libpng delegate no longer found

Posted: 2015-12-16T07:15:49-07:00
by axelrose
Thank you very much for both valuable hints.

After having "pkg-config" installed in my $PATH the problem went away. libpng was found and PNG is now a valid delegate! :)

But I also had to set PKG_CONFIG_PATH to /tmp/install/lib/pkgconfig to avoid the use of a local and outdated /opt/X11/lib/libpng15
PKG_CONFIG_LIBDIR is even more rigorous and useful to me.


BTW
> review config.log. It will tell you exactly why the PNG delegate failed to validate.

This is what I am told:

configure:30964: checking for PNG
configure:31023: result: no
configure:31033: result:
configure:31281: result: -------------------------------------------------------------
configure:31283: checking for TIFF

So perhaps it would help others if the messages report a possibly missing "pkg-config" tool.


Cheers, Axel.

Re: libpng delegate no longer found

Posted: 2015-12-17T16:32:11-07:00
by uman
Hi,

After having the same issue, I wanted to give out some feedback.

When running configure, we have under "some influential environment variable" quite a few of ***_LIBS and ***_CFLAGS (even ***_PKG), but looking at the configure.ac and configure file, it looks like you are ignoring those value by setting them to an empty string.

Either I'm using the tools in a wrong way, or you shouldn't list the ***_LIBS and ***_CFLAGS under the influential environment variable.