Posted by fuerst on July 23, 2011 at 4:48pm
3 followers
| Project: | ImageAPI |
| Version: | 6.x-1.10 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Issue Summary
GraphicsMagick is a replacement for ImageMagick which claims to be more efficient than ImageMagick. Since GraphicsMagick is compatible to ImageMagick 5.5.2 it is not really supported by ImageAPI which supports ImageMagick 6.x - at least as it seems to me.
What differs is the following:
- Command line syntax: GraphicsMagick is called this way:
gm convert ...instead ofconvert ... - Position of command line parameters: It is
gm convert [options] input-file output-fileinstead ofconvert input-file [options] output-file - Some newer (version 6) ImageMagick options like +repage are not working in GraphicsMagick. (At least the module imagecache_actions is using +repage.)
The patch in comment #1 covers the above mentioned differences.
Some notes:
- To check if ImageMagick or GraphicsMagick is running I decided to just look at the user-entered path in admin/settings/imageapi/config/imageapi_imagemagick. If it ends by /gm (or \gm.exe for Windows OS) it assumes GraphicsMagick. I know from at least Linux Debian that it's GraphicsMagick package creates a /usr/bin/convert symbolic link to the /usr/bin/gm binary. Using that link instead of the binary ImageAPI still assumes ImageMagick is to be used. That probably should be solved by grepping the output of
convert -versionand setting a Drupal variable instead of relying of the path. - Because the use of GraphicsMagick is transparent to modules using ImageAPI (like imagecache_actions) there is no way to let the modules know about it. Therefore I decided to create a replacement mechanism by simply using
str_replace()to convert known incompatible options if possible. This is hard coded and also not version dependend. Must be discussed I guess.
Comments
#1
Here is the patch..
#2
Patch needs review of course.
#3
Thanks! Works as expected.
#4
Subscribing
#5
See also http://drupal.org/project/imageapi_graphicsmagick