Page 1 of 1

[SOLVED] ImageMagick download version crisis

Posted: 2012-09-29T11:46:55-07:00
by Draoidh
A couple of months ago we had a long thread about my IM 6.7.7 gradient problem: multi-colour gradient, dreadful banding. The upshot of it was that I had to upgrade to a higher version, at least IM 6.7.8.6 Q16.

My sys admin downloaded ImageMagick-6.7.9-8 and installed to-day following these instructions. My previous Debian installation was uninstalled and the downloaded version resides in /usr/local/bin.

However, when checking the version I get:

Code: Select all

$ /usr/local/bin/convert --version
Version: ImageMagick 6.7.7-10 2012-07-30 Q16 http://www.imagemagick.org
The version.sh file in the downloaded source directory tells me it's PACKAGE_VERSION='6.7.9'.

When I run the example from our previous thread, I get exactly the output I had with 6.7.7-10: 6.7.7-10 output. Therefore I conclude 6.7.7-10 is what I have.

Is there anything else I would have had to upgrade?

Re: ImageMagick download version crisis

Posted: 2012-09-29T13:59:09-07:00
by fmw42
Sounds like you have multiple versions of IM in different places. Check your system for multiple versions

try

type -a convert

Re: ImageMagick download version crisis

Posted: 2012-09-29T14:16:53-07:00
by Draoidh
Hello Fred,
Tried that and had already done a "whereis convert" before: the only executable "convert" on my system /usr/local/bin/convert and this is the one that was compiled to-day. (I also checked the file date.)
And as you can see from my previous post, I even used a fully qualified path.

Re: ImageMagick download version crisis

Posted: 2012-09-29T14:45:38-07:00
by Draoidh
I found what is causing the problem:

The executables in /usr/local/bin (convert, mogrify, ...) are just wee stubs. The magick code is in the libraries. And it was still pulling up my old libraries from /usr/lib. When I de-installed the Debian package imagemagick-common, convert pulled the newly installed libraries from /usr/local/lib.

However, removing imagemagick-common also caused packages to be removed that depended on it. In other words I need both and I need my new magick installation to pick up the correct set of libraries. Will look into this now.

Re: ImageMagick download version crisis

Posted: 2012-09-29T14:48:44-07:00
by Draoidh
Panic over. Sys admin had not run

Code: Select all

ldconfig /usr/local/lib
Sorted.

Re: [SOLVED] ImageMagick download version crisis

Posted: 2012-10-02T06:35:30-07:00
by NicolasRobidoux
Indeed, you should run ldconfig after you install anything without using the package manager.

An alternative is to hardwire the path to the executable, like this: /usr/local/bin/convert.
This will run the convert command from where it's installed when you compile. By default, locally compiled ImageMagick installs itself in /usr/local/bin. On the other hand, linux package managers generally install in /usr/bin, so you can switch to that version (without uninstalling) using /usr/bin/convert, that is, by hardwiring the path to the version installed by the package manager when you call, for example, convert.

Code: Select all

$ /usr/local/bin/convert -version
Version: ImageMagick 7.0.0-0 2012-09-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP  HDRI  

$ /usr/bin/convert -version
Version: ImageMagick 6.6.0-4 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
You may find http://exquires.ca/INSTALL.html#install ... rom-source of interest. It pertains to the alpha development branch of ImageMagick 7, but it's directly relevant to any version. The instructions assume that you are using the compiled ImageMagick on a machine with similar hardware as the one on which you compile. (This has to do with the -march=native flags.)
Also, you may not want an HDRI version, so take out --enable-hdri. This flag is actually unnecessary with ImageMagick 7, because HDRI is now its default. (Q16 is still the ImageMagick 6 default.)

Re: [SOLVED] ImageMagick download version crisis

Posted: 2012-10-02T06:50:41-07:00
by NicolasRobidoux
Leaving the ImageMagick installed by the package manager there, without uninstalling, is a good idea, to maintain compatibility with package manager installed applications that use it (VIPS and NIP2, for example, although they are careful to run with just about any version of ImageMagick).

Re: [SOLVED] ImageMagick download version crisis

Posted: 2012-10-02T07:45:03-07:00
by Draoidh
Nicolas, thanks for your advice.

My newly compiled IM had been installed into /usr/local/bin. My PATH variable already pointed to this directory and pulled the correct executable from there.

However, without ldconfig the convert command pulls up the old libraries (if present) rather than the new libraries from /usr/local/lib.

A correct PATH setting or fully qualified command points you to the right executable but without ldconfig pointing you to the correct libraries you won't be running the new version.

Re: [SOLVED] ImageMagick download version crisis

Posted: 2012-10-07T17:44:21-07:00
by anthony
See the utility script in...
API's and Building, Creating a Personal ImageMagick
http://www.imagemagick.org/Usage/api/#personal

The script specifies which libraries, configs, and binaries are to be used. You basically prefix the IM command or script with this script to set up the 'envioronment' for that specific version of IM.

For example one such script I have is called "hdri" which uses my HDRI version of IM. I can then run
hdri convert ...
or
hdri im_script ....
to run using the specific HDRI installation...

Re: [SOLVED] ImageMagick download version crisis

Posted: 2012-10-08T02:39:13-07:00
by Draoidh
Thanks Anthony; that's useful to know.