Needs review
Project:
ImageAPI
Version:
6.x-1.6
Component:
ImageAPI Imagick
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 May 2009 at 21:24 UTC
Updated:
24 May 2024 at 10:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
cedarm commentedI think this request is still valid for the current version.
Comment #2
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 commented(Grr, forgot status.) Needs review please.
Comment #4
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 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 commentedI guess i'm not clear what a GM command would look like. Something like:
/usr/bin/gm convert input.jpg output.jpgAnd the convert bit tells GM to act like IM?
Comment #7
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 commentedRevised patch to only add "Prepend arguments" option, and not "Extra arguments".
Comment #9
avpaderno