libpng delegate no longer found

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

libpng delegate no longer found

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: libpng delegate no longer found

Post 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
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: libpng delegate no longer found

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: libpng delegate no longer found

Post by fmw42 »

What do you get from

Code: Select all

convert -version
What is your platform?
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: libpng delegate no longer found

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: libpng delegate no longer found

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: libpng delegate no longer found

Post 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.
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: libpng delegate no longer found

Post 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.
uman
Posts: 1
Joined: 2015-12-17T16:17:54-07:00
Authentication code: 1151

Re: libpng delegate no longer found

Post 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.
Post Reply