[SOLVED] ImageMagick download version crisis

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
Draoidh
Posts: 69
Joined: 2012-07-03T11:29:44-07:00
Authentication code: 13
Location: soon to be independent Scotland

[SOLVED] ImageMagick download version crisis

Post 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?
Last edited by Draoidh on 2012-09-29T14:49:06-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick download version crisis

Post by fmw42 »

Sounds like you have multiple versions of IM in different places. Check your system for multiple versions

try

type -a convert
User avatar
Draoidh
Posts: 69
Joined: 2012-07-03T11:29:44-07:00
Authentication code: 13
Location: soon to be independent Scotland

Re: ImageMagick download version crisis

Post 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.
User avatar
Draoidh
Posts: 69
Joined: 2012-07-03T11:29:44-07:00
Authentication code: 13
Location: soon to be independent Scotland

Re: ImageMagick download version crisis

Post 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.
User avatar
Draoidh
Posts: 69
Joined: 2012-07-03T11:29:44-07:00
Authentication code: 13
Location: soon to be independent Scotland

Re: ImageMagick download version crisis

Post by Draoidh »

Panic over. Sys admin had not run

Code: Select all

ldconfig /usr/local/lib
Sorted.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: [SOLVED] ImageMagick download version crisis

Post 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.)
Last edited by NicolasRobidoux on 2012-10-02T07:04:09-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

Re: [SOLVED] ImageMagick download version crisis

Post 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).
User avatar
Draoidh
Posts: 69
Joined: 2012-07-03T11:29:44-07:00
Authentication code: 13
Location: soon to be independent Scotland

Re: [SOLVED] ImageMagick download version crisis

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: [SOLVED] ImageMagick download version crisis

Post 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...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
Draoidh
Posts: 69
Joined: 2012-07-03T11:29:44-07:00
Authentication code: 13
Location: soon to be independent Scotland

Re: [SOLVED] ImageMagick download version crisis

Post by Draoidh »

Thanks Anthony; that's useful to know.
Post Reply