GraphicsMagick support

cedarm - May 17, 2009 - 21:24
Project:ImageAPI
Version:6.x-1.6
Component:ImageAPI Imagick
Category:feature request
Priority:normal
Assigned:cedarm
Status:needs review
Description

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").

#1

cedarm - May 17, 2009 - 21:25
Version:6.x-1.0» 6.x-1.6

I think this request is still valid for the current version.

#2

cedarm - May 17, 2009 - 21:48

Ok, 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.

AttachmentSize
imageapi-465412-3.patch 2.29 KB

#3

cedarm - May 17, 2009 - 21:51
Status:active» needs review

(Grr, forgot status.) Needs review please.

#4

drewish - May 17, 2009 - 22:19
Status:needs review» postponed

http://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.

#5

cedarm - May 21, 2009 - 20:46

Great! 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?

#6

drewish - May 23, 2009 - 07:54
Status:postponed» needs work

I 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?

#7

cedarm - May 27, 2009 - 06:25

Yes. 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.

#8

cedarm - May 27, 2009 - 06:28
Status:needs work» needs review

Revised patch to only add "Prepend arguments" option, and not "Extra arguments".

AttachmentSize
imageapi-465412-8.patch 1.34 KB
 
 

Drupal is a registered trademark of Dries Buytaert.