ImageMagick delegates and installation

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
soluna
Posts: 9
Joined: 2015-12-06T10:49:21-07:00
Authentication code: 1151

ImageMagick delegates and installation

Post by soluna »

I've installed ImageMagick with the package created by http://cactuslab.com/imagemagick/ for mac (which put it in opt/ImageMagick/ and supposedly includes all the libs), though when I've tried to use some of the ImageMagick scripts it retrieves this:
$ convert -monochrome p20.jpg out.png
convert: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/501.
convert: no images defined `out.png' @ error/convert.c/ConvertImageCommand/3241.

I've listed the libs disponible and:
$ convert -list configure | grep -i "delegates"
DELEGATES bzlib mpeg x

Then, I think that the problem is related with the location of the libs and the program, I don't know if I have to run the commands from ImageMagick folder or I can use another where the images to be converted are located.

Thanks in advance
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick delegates and installation

Post by fmw42 »

You seem to be missing all the delegates. You at least need the delegates for PNG and JPG. They should also be in /opt where IM is installed.

I prefer MacPorts. It usually puts everything in opt/local/bin. Check to see if your delegates went there.

Also you command should properly have the input image right after convert, though that might not matter in IM 6, but likely will matter in IM 7. See http://www.imagemagick.org/Usage/basics/#why
soluna
Posts: 9
Joined: 2015-12-06T10:49:21-07:00
Authentication code: 1151

Re: ImageMagick delegates and installation

Post by soluna »

Thanks, I finally uninstalled all the previous version (or at least I tried) and now I'm installing it from Macports. Thanks for your advise I'll have a look to the usage.
soluna
Posts: 9
Joined: 2015-12-06T10:49:21-07:00
Authentication code: 1151

Re: ImageMagick delegates and installation

Post by soluna »

Well, I've still problems with the delegates. I've uninstalled ImageMagick and installed it again from Macports as suggested, which is supposed to include all the libs, but when I run:
$ identify -version
Version: ImageMagick 6.9.2-7 Q16 x86_64 2015-11-30 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC
Delegates (built-in): bzlib x

It seems that the program can't find the libs. Any suggestions?
soluna
Posts: 9
Joined: 2015-12-06T10:49:21-07:00
Authentication code: 1151

Re: ImageMagick delegates and installation

Post by soluna »

How can I test if it is working?, every time I run the command convert I get:
/usr/local/bin/convert: No such file or directory
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick delegates and installation

Post by fmw42 »

just run

convert ...

With MacPorts it is in in /opt/local/bin, not usr/local/bin. But you should be able to run from any directory just using convert and no path.
soluna
Posts: 9
Joined: 2015-12-06T10:49:21-07:00
Authentication code: 1151

Re: ImageMagick delegates and installation

Post by soluna »

Thanks, it works if I write the full path:
$ /opt/local/bin/convert p20.jpg p20.png

though it doesn't if I didn't set the path for the program, see:
$convert p20.jpg p20a.png
-bash: convert: command not found

Is there a way to avoid writing the full path?? I think there is something wrong with the path, How can I fix it?? Many thanks

By the way, all the libs are installed in that dir,
$ /opt/local/bin/convert -version
Version: ImageMagick 6.9.2-4 Q16 x86_64 2015-12-07 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: ImageMagick delegates and installation

Post by fmw42 »

Typically, MacPorts writes the path to convert in the PATH environment variable in your .profile file. Perhaps if you do not have that, it does not get set. But you can manually edit the .profile file in your home directory to add the path to convert.

Here is what I have on my Mac OSX Snow Leopard, but I think on newer Macs, you have to create a new .profile or .bash_profile file and edit it. To create one, type touch .profile or touch .bash_profile. Then edit in a text editor.


cat .profile # cat lists the information in .profile to the terminal

# 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
export MAGICK_FONT_PATH=/Users/fred/


See
http://coolestguidesontheplanet.com/add-shell-path-osx/
http://www.cyberciti.biz/faq/appleosx-b ... -variable/
http://apple.stackexchange.com/question ... is-my-path
Post Reply