Last updated 10 June 2011. Created on 29 March 2007.
Edited by batigolix, joachim, bekasu, Senpai. Log in to edit this page.

Imagemagick is a powerful image manipulation toolkit that, unlike PHP's default GD library, supports gif, png, and other raw file formats too. A lot of users have Imagemagick installed on their server already, and don't even know it. If you're using the contributed image.module in your Drupal site, and you want to access the Imagemagick already installed on your server, here's how to do it:

  1. Locate the directory where you installed the Image module. It's most likely in /sites/default/modules/image or /sites/all/modules/image. Open the image folder and look for a file called 'image.imagemagick.inc'. Copy (don't move) that file to /includes/. That's a Drupal core directory, BTW.

    Alternatively to copying the file you could simply make a symlink in case the actual includes file gets updated at some point:

    ln -s ../sites/all/modules/image/image.imagemagick.inc image.imagemagick.inc
    
  2. After the file has been copied to your /includes/ folder on the server, surf your way to Administer > Site Configuration > Image Toolkit. There, you will find a second entry under "Select an image processing toolkit". Enable the Imagemagick library there, and click 'Save Configuration'.
  3. Set the proper path to Imagemagick's Convert binary. This is usually /usr/bin/convert, but it can be in other places too. If you installed Imagemagick on your own server, you'll know where to look. If you're using a hosting company who provides it as a package, ask them *after* you try and see if the default /usr/bin/convert works or not.

Note for Windows Server

For Drupalers that use a proper local server on Windows Systems and Drupal version 6.x, after you have installed the last version/(Stable) of ImageMagick ,

1. Follow from point #2. as above post, and activate the Library.

2. Set the proper path to ImageMagick, for Windows: i.e. "C:\imagemagick\convert.exe"
or what ever your ImageMagick installation might be.

You're done! If you found a bug, or something doesn't work right and you know it should, file a bug report for image.module. Full documentation on the Image module can be found in Contributed Modules > Image handbook.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

homo_sapiens’s picture

In my case making a symlink to image.imagemagick.inc in the /include-directory didn't work. I definitely had to copy image.imagemagick.inc into the /include-directory. By the way: it was within a Drupal 6.x-Installation!

brianbrown’s picture

It didn't work for me either, although the command given did correctly create an operable symlink (Apache/2.2.11; Drupal 6.13).
Regards,
-Brian

apotek’s picture

Instead of dropping a copy of the imagick.inc file into the docroot/includes folder (and thereby breaking core distribution compliance), couldn't a user put "require_once('your/path/to/the/imagick/include/file');" into the settings.php file?

mah ham