Further to my attempts to build a completely standalone version of ImageMagick (see my previous post on the matter), I am having real problems getting the png delegate included. The version that is used is always one in /opt/local. I have read on this forum that if you rename the local folder to local~ that the png delegate in the imagemagick folder that you are compiling from will be used. This seems not to be the case. When I do this, and then try to run convert with a png file, the following happens:
Code: Select all
$ /Users/paul/Desktop/ImageMagick-Final/bin/convert /Users/paul/Desktop/temp.png /Users/paul/Desktop/temp.png
convert: NoDecodeDelegateForThisImageFormat `PNG' @ error/constitute.c/ReadImage/501.
convert: NoImagesDefined `/Users/paul/Desktop/temp.png' @ error/convert.c/ConvertImageCommand/3252.
When I run otool -L /path/to/convert I get a whole list of dependencies, most of them in /opt/local - not good because you can not be sure that that folder and the files referenced will be on other machines.
Because I have been trying loads of different things - all based on suggestions from various posts in this forum and other places, I wrote a script to automate this:
Code: Select all
#!/usr/bin/env bash
MYPATH=$PATH
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
cd ~/Desktop
mkdir ImageMagick-Final
tar xvzf ImageMagick.tar.gz
cd ImageMagick-6.9.3-7
tar xvzf ~/Desktop/jpegsrc.v9a.tar.gz
mv jpeg-9a jpeg
tar xvzf ~/Desktop/libpng-1.6.21.tar.gz
mv libpng-1.6.21 png
cd png
./configure --disable-shared --disable-dependency-tracking --prefix="/Users/paul/Desktop/ImageMagick-6.9.3-7/png"
make clean;make
make install
cd ../jpeg
./configure --disable-shared --disable-dependency-tracking --prefix="/Users/paul/Desktop/ImageMagick-6.9.3-7/jpeg"
make clean;make
make install
cd ../
./configure --disable-installed --disable-shared --enable-delegate-build --disable-dependency-tracking --with-x=no --without-perl --with-freetype=no --with-jp2=no --with-magick-plus-plus=no --without-frozenpaths --with-bzlib=no --with-png=yes --with-jpeg=yes --prefix=/Users/paul/Desktop/ImageMagick-Final LDFLAGS="-L/Users/paul/Desktop/ImageMagick-6.9.3-7/png -L/Users/paul/Desktop/ImageMagick-6.9.3-7/jpeg" CPPFLAGS='-I/Users/paul/Desktop/ImageMagick-6.9.3-7/png/include -I/Users/paul/Desktop/ImageMagick-6.9.3-7/jpeg/include'
make clean;make
make install
echo ""
echo $PATH
export PATH=$MYPATH
echo ""
echo $PATH
What I want is for the png and jpeg libraries to be part of a portable ImageMagick - one that can be put in an app (in my case one created in LiveCode) and for it to work without the need for the user to install tools like ImageMagick themselves. I am finding this getting very frustrating now. I’m sure I’ve missed something out, but I can’t see what. I’ve tried so many permutations of parameters in various ./configure calls that I really feel that this might not be possible - yet I read that it is.