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.
I am running Debian and Ubuntu on my servers and I have found GraphicsMagick to be more stable for my needs than ImageMagick. The http://packages.ubuntu.com/graphicsmagick-imagemagick-compat allows imageapi to be used as is (by creating symlink as /usr/bin/convert). However, I need to have both GraphicsMagick and ImageMagick to be installed on the server, for other reasons. The native invocation of GraphicsMagick convert is
/usr/bin/gm convert
Add config option for argument(s) to prepend ("convert") along side the path to the binary ("/usr/bin/gm").
Comment | File | Size | Author |
---|---|---|---|
#8 | imageapi-465412-8.patch | 1.34 KB | cedarm |
#2 | imageapi-465412-3.patch | 2.29 KB | cedarm |
Comments
Comment #1
cedarm CreditAttribution: cedarm commentedI think this request is still valid for the current version.
Comment #2
cedarm CreditAttribution: cedarm commentedOk, here's a patch which adds two configuration options for imageapi_imagemagick. They both allow arbitrary options to be added to the command line (perhaps this should be protected by a separate permission?), but differ in their placement.
The first option, Prepend arguments, is explicitly for this issue, intended for GraphicsMagick support. Its value is placed immediate after the path to the binary, as the first argument.
The second option, Extra arguments, is placed after other $args in _imageapi_imagemagick_convert(). This can be used to add -strip or, as in the example, +profile '*', which will strip out ICC profiles. I was ending up with 3MB+ thumbnail images because of unnecessary data. Adding this brought it down to the usual size of ~1.2kB. I'll reroll the patch without this if desired.
Comment #3
cedarm CreditAttribution: cedarm commented(Grr, forgot status.) Needs review please.
Comment #4
drewish CreditAttribution: drewish commentedhttp://drupal.org/project/im_raw might be of interest for some of this because for the additional parameters you need the control over when they're used which in most imagecache scenarios means per-action. i'd say give that a look and see if it meets your needs.
Comment #5
cedarm CreditAttribution: cedarm commentedGreat! That definitely gives more flexibility, per action. I'll rip out the "Extra arguments" option, but I still think "Prepend arguments" has a place for GraphicsMagick support. I wouldn't want to have to modify every preset just to change from IM to GM. Your thoughts?
Comment #6
drewish CreditAttribution: drewish commentedI guess i'm not clear what a GM command would look like. Something like:
/usr/bin/gm convert input.jpg output.jpg
And the convert bit tells GM to act like IM?
Comment #7
cedarm CreditAttribution: cedarm commentedYes. The other way is to create a symlink to /usr/bin/gm named convert. (That's what the graphicsmagick-imagemagick-compat package contains, symlinks.)
BTW, it should be noted that GM doesn't (yet) support all of the options IM does, but seems to be sufficient for most needs.
Comment #8
cedarm CreditAttribution: cedarm commentedRevised patch to only add "Prepend arguments" option, and not "Extra arguments".