Page 1 of 1

Convert not working after install on PowerPC Mac

Posted: 2011-05-17T18:04:54-07:00
by meltemi
I just went through the "painful" process of installing ImageMagick and all it's dependencies on a PowerPC Mac (OS X Server 10.5.8).

Now trying to see if convert will work I run it and it hangs.

$ convert test-image.jpg test-image.png

hangs

read through these forums a bit and tried it with the -debug all flag set and got a ton of output but at the end it looks like this:

Application built with libpng-1.2.26 but running with 1.5.2 `test-image.png'
2011-05-17T17:48:28-07:00 0:02.370 0.880u 6.6.9 Exception convert[357]: png.c/WriteOnePNGImage/8214/Exception
memory allocation failed `test-image.png'
2011-05-17T17:48:28-07:00 0:02.370 0.880u 6.6.9 Coder convert[357]: png.c/WritePNGImage/10721/Coder
exit WritePNGImage()
2011-05-17T17:48:28-07:00 0:02.370 0.880u 6.6.9 Cache convert[357]: cache.c/DestroyPixelCache/1504/Cache
destroy test-image.jpg[0]
2011-05-17T17:48:28-07:00 0:02.380 0.890u 6.6.9 Resource convert[357]: resource.c/RelinquishMagickResource/810/Resource
Memory: 25.17MB/24MiB/2GiB


It hangs right after that last Memory line. Anyone know what is going on? Yes, I downloaded and installed libpng-1.5.2 into /usr/local (or at least that's what I had tried to do) before downloading and installing ImageMagick with these arguments: IMAGEMAGICK_ARGUMENTS="--disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp"

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-17T18:20:35-07:00
by fmw42
did you install from binary or from source?

what happens when you type:

convert -version

what do you get for

convert -list configure

Look on the line DELEGATES and see what is there for png, jpg, etc


how about

convert logo: logo.gif

does that work?

I am running on IM 6.6.9.9 Q16 Mac OSX Tiger PowerPC G4 Mac mini and am not having any problem.

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-17T18:30:44-07:00
by meltemi
I installed from source. wasn't aware of any PowerPC Mac binary.

$ convert -version
Version: ImageMagick 6.6.9-9 2011-05-17 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features:

---------------

$ convert -list configure

Path: /usr/local/share/ImageMagick-6.6.9/configure.xml

Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -g -O2 -Wall -D_THREAD_SAFE -pthread
CODER_PATH /usr/local/lib/ImageMagick-6.6.9/modules-Q8/coders
CONFIGURE ./configure '--prefix=/usr/local' '--disable-static' '--with-modules' '--without-perl' '--without-magick-plus-plus' '--with-quantum-depth=8' '--disable-openmp' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts' 'LDFLAGS=-L/usr/local/lib' 'CPPFLAGS=-I/usr/local/include'
CONFIGURE_PATH /usr/local/etc/ImageMagick/
COPYRIGHT Copyright (C) 1999-2011 ImageMagick Studio LLC
CPPFLAGS -I/usr/local/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -D_THREAD_SAFE -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib freetype jpeg jng lcms2 png tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CPPFLAGS=-I/usr/local/include' 'LDFLAGS=-L/usr/local/lib' --disable-deprecated --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-gs-font-dir=/usr/local/share/ghostscript/fonts --with-perl=no
DOCUMENTATION_PATH /usr/local/share/doc/ImageMagick-6.6.9/
EXEC-PREFIX /usr/local
EXECUTABLE_PATH /usr/local/bin
FEATURES
FILTER_PATH /usr/local/lib/ImageMagick-6.6.9/modules-Q8/filters
HOST powerpc-apple-darwin9.8.0
LDFLAGS -L/usr/local/lib -L/usr/local/lib -L/usr/X11/lib -R/usr/X11/lib
LIB_VERSION 0x669
LIB_VERSION_NUMBER 6,6,9,9
LIBRARY_PATH /usr/local/lib/ImageMagick-6.6.9
LIBS -lMagickCore -llcms2 -ltiff -lfreetype -ljpeg -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lpthread
NAME ImageMagick
PCFLAGS
PREFIX /usr/local
QuantumDepth 8
RELEASE_DATE 2011-05-17
SHARE_PATH /usr/local/share/ImageMagick-6.6.9
SVN_REVISION exported
TARGET_CPU powerpc
TARGET_OS darwin9.8.0
TARGET_VENDOR apple
VERSION 6.6.9
WEBSITE http://www.imagemagick.org

Path: [built-in]

Name Value
-------------------------------------------------------------------------------
NAME ImageMagick

------------

$ ls
$ convert logo: logo.gif
$ ls
logo.gif
$

It would appear as though this works when converting to .gif but not to .png... and maybe i'm using it wrong but resizing doesn't appear to work either.

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-17T19:26:34-07:00
by fmw42
try

convert logo: logo.jpg
convert logo: logo.png
convert logo: logo.tif

then

convert logo.png logo2.jpg
convert logo.jpg logo2.png
convert logo.tif logo.png

If all those work, then

try

convert logo: -resize 50% logo2.png

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-17T19:48:24-07:00
by meltemi
thanks. so tried each command you listed. everything works except when converting to/from .png. going to/from jpg and/or tif works just fine. Something is, clearly, wrong with png.

libpng was installed before ImageMagick:

$ libpng-config --version
1.5.2

any clue what's going on & how to get png working?

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-17T19:49:46-07:00
by fmw42
try uninstalling libpng and re-installing an older version of libpng. Then re-install IM

mine is currently


libpng-config --version
1.4.5

P.S. I had installed all my delegates via MacPorts, but then I installed IM manually so that I could update it more frequently.

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-17T23:16:17-07:00
by meltemi
OK. tried it with libpng-1.4.7 and same problem... for some reason ImageMagick is throwing warnings:

..."Application was compiled with png.h from libpng-1.2.26"
and
...libpng-1.2.26 warning: Application is running with png.c from libpng-1.4.7

if you look back at beginning of this thread they're basically the same except replace "1.4.7" with "1.5.2". Where is ImageMagick getting its reference to libpng-1.2.26?

$ which libpng-config
/usr/local/bin/libpng-config

$ libpng-config --version
1.4.7

$ convert -debug all logo: logo.png
... <hundreds of debug lines> ...
Exit BUILD_PALETTE:
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Coder convert[45220]: png.c/MagickPNGWarningHandler/1332/Coder
libpng-1.2.26 warning: Application was compiled with png.h from libpng-1.2.26
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Locale convert[45220]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/share/ImageMagick-6.6.9/locale.xml"
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Locale convert[45220]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/etc/ImageMagick/locale.xml"
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Locale convert[45220]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/usr/local/share/doc/ImageMagick-6.6.9//locale.xml"
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Locale convert[45220]: locale.c/GetLocaleOptions/468/Locale
Searching for locale file: "/Users/boris/.magick/locale.xml"
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Configure convert[45220]: locale.c/LoadLocaleList/769/Configure
Loading locale configure file "/usr/local/share/ImageMagick-6.6.9/locale.xml" ...
2011-05-17T23:07:53-07:00 0:00.221 0.161u 6.6.9 Configure convert[45220]: locale.c/LoadLocaleList/769/Configure
Loading locale configure file "/usr/local/share/ImageMagick-6.6.9/english.xml" ...
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Exception convert[45220]: png.c/MagickPNGWarningHandler/1335/Exception
Application was compiled with png.h from libpng-1.2.26 `logo.png'
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Coder convert[45220]: png.c/MagickPNGWarningHandler/1332/Coder
libpng-1.2.26 warning: Application is running with png.c from libpng-1.4.7
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Exception convert[45220]: png.c/MagickPNGWarningHandler/1335/Exception
Application is running with png.c from libpng-1.4.7 `logo.png'
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Coder convert[45220]: png.c/MagickPNGWarningHandler/1332/Coder
libpng-1.2.26 warning: Incompatible libpng version in application and library
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Exception convert[45220]: png.c/MagickPNGWarningHandler/1335/Exception
Incompatible libpng version in application and library `logo.png'
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Exception convert[45220]: png.c/WriteOnePNGImage/8214/Exception
memory allocation failed `logo.png'
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Coder convert[45220]: png.c/WritePNGImage/10721/Coder
exit WritePNGImage()
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Cache convert[45220]: cache.c/DestroyPixelCache/1504/Cache
destroy LOGO[0]
2011-05-17T23:07:53-07:00 0:00.231 0.171u 6.6.9 Resource convert[45220]: resource.c/RelinquishMagickResource/810/Resource
Memory: 1.536MB/1.465MiB/2GiB

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T09:52:22-07:00
by fmw42
try

find /usr | grep "png.h"

and see how many you find. Perhaps you need to clean up all the old (perhaps left over files from previous libpng version). Somehow, IM is getting confused on them or the more current one is not including png.h or not overriding the older one


Perhaps one version of libpng is installed in usr/bin and another in /usr/local/bin

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T11:18:31-07:00
by meltemi
Thank you! You've been very helpful...and patient!

So there appear to be a few:

$ find /usr | grep "png.h"
/usr/include/wx-2.8/wx/imagpng.h
/usr/local/include/libpng14/png.h
/usr/local/include/png.h
/usr/X11/include/libpng12/png.h

This is taking me into unchartered territory. If I were to just remove the last one that appears to be the culprit (/usr/X11/include/libpng12/png.h) what kind of havoc would ensue?

Also, now seeing X11 I'm wondering if compiling the libwmf library may have created my problems? :

$ cd libwmf-0.2.8.4
$ make clean
make: *** No rule to make target `clean'. Stop.
$ ./configure --without-expat --with-xml --with-png=/usr/X11 --prefix=/usr/local
$ make
$ sudo make install

This library was compiled after libpng but before ImageMagick during yesterday's sudo make install marathon trying to get ImageMagick working... It's the --with-png=/usr/X11 flag that catches my eye. No idea what it's for. I'm just following basic guidelines I took from https://github.com/masterkain/ImageMagi ... tall_im.sh.

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T11:26:14-07:00
by fmw42
At this point, it is going beyond my unix abilities. Perhaps some other unix guru can help further.

All I can suggest is (brute force) remove all libpng components and re-install libpng and then reinstall IM again.

If necessary remove and re-install libwmf also, then re-install it, then libpng, then IM.

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T11:32:25-07:00
by meltemi
how can I find out what that "--with-png=/usr/X11" flag for libwmf means exactly?

ugh..UNIX.

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T12:13:04-07:00
by fmw42
meltemi wrote:how can I find out what that "--with-png=/usr/X11" flag for libwmf means exactly?

ugh..UNIX.

Looks like your png.h is coming from your X11 install.

/usr/X11/include/libpng12/png.h

perhaps install libwmf with

--with-png=/usr/local/include/

But again this is just a guess as I am not a unix guru.

Or upgdate your X11 from a more current Xcode Tools that is compatible with your PowerPC version of Mac OSX. (You don't say what you are running -- Tiger, Leopard, Snow Leopard)

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T12:36:54-07:00
by meltemi
Hi! So, thank you! You were instrumental in helping me FINALLY sort this out!

I removed the X11 png.h & pngconf.h
then recompiled libwmf without any --with-png flag at all
then recompiled ImageMagick and i can now convert to & from .png

very glad to put this one to rest...for now anyway ;-)

Thank you!

Re: Convert not working after install on PowerPC Mac

Posted: 2011-05-18T12:52:19-07:00
by fmw42
Glad that it finally worked out successfully for you.