GM is more stable and correct than imagemagick. Can you add GM support ?

Comments

parasox’s picture

Wow yeah that looks nice.. See: http://www.graphicsmagick.org/benchmarks.html

Also used by Flickr and Etsy.. Would be nice to add Drupal to that list. :)

W32’s picture

StatusFileSize
new5.22 KB

I made a port of this module to work with GraphicsMagick. On my local machine works fine.
You can find this port in my sanbox - http://drupal.org/sandbox/W32/1077458.

sun’s picture

Title: how about GraphicsMagick support ? » GraphicsMagick support

@W32: Can you provide a patch against ImageMagick module?

W32’s picture

No, GraphicsMagick is separate module. But you can install both - this and GraphicsMagick modules and switch from them in drupal admin/config/media/image-toolkit page.

sun’s picture

Status: Active » Fixed

Did a diff between imagemagick and that sandbox - http://drupal.org/sandbox/W32/1077458 is a 99.99% copy of http://drupal.org/project/imagemagick, the only changes are:

s/imagemagick/graphicsmagick/g
s/convert/gm/g

Kinda expected result, since GraphicsMagick itself is a rather stupid fork of ImageMagick.

Hence, looks like we support GraphicsMagick natively. Will clarify on the project page.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

osopolar’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new3.38 KB

The GraphicsMagick support is almost natively, but there are some differences. The syntax is: gm convert [options] input_file output_file.

I added a menu option to enable GraphicsMagick and made the necessary changes. In some places the term ImageMagick is still used while it should be GraphicsMagick.

I tested only to resize images (with GraphicsMagick 1.1.11 on Debian 4.3.2).

Patch attached.

sun’s picture

StatusFileSize
new2.95 KB

Thanks. Slightly cleaner variant of that attached.

However, I'm not able to test this myself, as I don't have gm installed anywhere (and don't intend to do so currently).

The run-time logic looks fine to me, but I'd appreciate excessive testing of the image toolkit settings form; i.e., checking gm version, switching toolkits back and forth, absolute path to gm binary, just the gm binary as path, etc.

osopolar’s picture

I successfully tested the patch in #8 but only to resize images (with GraphicsMagick 1.1.11 on Debian 4.3.2). Maybe later some more testing.

fuerst’s picture

Instead of having the user choose between ImageMagick or GraphicsMagick you may auto-select it by looking at the path to the toolkit or by scanning the output of the convert -version command. See also here: http://drupal.org/node/1227636

sun’s picture

Status: Needs review » Fixed

Thanks for reporting, reviewing, and testing! Committed #8 to 7.x-1.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

This means that GraphicsMagick can actually be used.

We can further investigate a more automated detection of ImageMagick/GraphicsMagick prior to rolling a stable release. If you'd like to work on something along the proposal in #10, please create a new issue and submit a patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ericmulder1980’s picture

Seems that assumption is the mother of all ... (fill in blanks). GraphicsMagick is NOT a 99.9% clone of ImageMagick. It was forked from ImageMagick back in 2001 and had it's first release in 2003. So every change between 2003 will not have 100% compatibility with this module.

I have an imagestyle with scale and define canvas options , this simply fails to render an image and gives me the following error:

User error: ImageMagick error 1: /usr/bin/gm convert: Unrecognized compose operator (src-over). in _imagemagick_convert_exec() (regel 519 van /var/www/
/htdocs/sites/all/modules/contrib/imagemagick/imagemagick.module).

I found this (imageapi_graphicsmagick) module and it basicly tells you the same thing. Too bad this module is only for D6 though.

So assuming this module works with GraphicsMagick out of the box is wrong. I love the ImageMagick module but the message on the module page will get a lot of people in trouble.

jacobpov’s picture

same issue here User error: ImageMagick error 1: /usr/bin/gm convert: Unrecognized compose operator (src-over). in _imagemagick_convert_exec() (line 519 of /var/www/sites/all/modules/imagemagick/imagemagick.module).

rogerrogers’s picture

Have same problem as #13, bummah.

Triumphent’s picture

All of this is very confusing. I am able to convert and scale animated GIFs (most of them) but it takes between 10 and 15 minutes per GIF file. In the mean time, the site freezes! :(