GraphicsMagick will work, honest!

  • Bill Taroli

    Bill Taroli - 2007-11-09

    I was called in by a friend to help him get LinPHA set up in his shared hosting account. He'd already been running other stuff there and was just trying out LinPHA for sharing a large number of images. The issue he encountered was that he was using GraphicsMagick (instead of ImageMagick or gd) for the translation of images into different sizes, formats, etc. And, in most cases, tools that previously supported IM now also support GM as well -- they're pretty much commandline and API compatible.

    Long story short, and to actually prove more useful than "just check out xxxx file and you can get it working", I thought I'd like the actual things I did to make this work.

    The key thing to remember is that IM's "convert" is almost completely identical in usage to "gm convert" (on the commandline). With this in mind, I was able to reduce the customizations required to get LinPHA to the following -- once I had completed the basic installation and ignored it's report that ImageMagick wasn't found.

       1. Update two values in the configuration table of the database.
              * compare_path = '<your full path>/gm ' (with trailing space)
              * use_compare = 1
       2. Comment the line in header.php that calls upgrade.php.
       3. Comment the line in image.php that adds the "-strip" option to the convert exec call.

    The important bit about putting the trailing space on the "compare_value" value is that this is concatenated as a prefix to "compare <options>" in the code. By referring specifically to gm and including the space, LinPHA will unwittingly run gm with the apropriate options to convert the image as desired.

    Now, I will point out that there may be an alternative to the use of "-strip" with gm, so that instead of simply commenting that option out it may be desired to update that line with a different option. But I have not researched or tested that at this point.

    • bzrudi

      bzrudi - 2007-11-10

      Hi taroliw,

      I knew GraphicsMagick is nearly compatible to ImageMagick API, as it's a fork of. However it's not so commonly in use, so we didn't add support for it yet.
      I will integrate support if you send me a patch, but it will require 'full' support beginning from installer. I will not accept some quick and dirty hacks somewhere around, also it would mean that the GM part needs to be maintained later ;-)

      looking forward...

      cheers bzrudi


Log in to post a comment.