Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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-file
instead 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 -version
and 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.
Comment | File | Size | Author |
---|---|---|---|
#1 | imageapi-1227636-1.patch | 3.75 KB | fuerst |
Comments
Comment #1
fuerst CreditAttribution: fuerst commentedHere is the patch..
Comment #2
fuerst CreditAttribution: fuerst commentedPatch needs review of course.
Comment #3
osopolarThanks! Works as expected.
Comment #4
crea CreditAttribution: crea commentedSubscribing
Comment #5
crea CreditAttribution: crea commentedSee also http://drupal.org/project/imageapi_graphicsmagick
Comment #5.0
crea CreditAttribution: crea commentedMake text more clear