GraphicsMagick

From TYPO3Wiki

Jump to: navigation, search

<< Back to Administrators page

[edit]

Please note in the Discussion page what you change!

GraphicsMagick is originally derived from ImageMagick 5.5.2.

Since the branch from ImageMagick, many improvements have been made by many authors using an open development model. GraphicsMagick is available for free, may be used to support both open and proprietary applications, and may be redistributed without fee.

This document helps you to correctly install gm-188x120t.png
GraphicsMagick and use this instead of ImageMagick. GraphicsMagick replaces the former ImageMagick!

Contents

Finding

Download the latest version from the GraphicsMagick FTP server. The extract it in the cgi-bin folder, e.g. at /var/www/vhosts/story-castle.net/httpdocs/cgi-bin Or simply use install it as a rpm file for your LINUX distribution and skip the following installation steps.
tar xvfpz GraphicsMagick-1.1.7.tar.gz 
chown -R myusername:psacln GraphicsMagick-1.1.7

Installing

Read the infos in the file INSTALL-os.txt where 'os' stands for 'unix', 'vms' or 'windows'.
If you do also have an ImageMagick installation then you cannot use the option '--enable-magick-compat' in the configure command.
cd GraphicsMagick-1.1.7
./configure --enable-magick-compat
After the configuration you build and install the files to the /usr/local/bin directory.
make
make install

Now you shall verify if everything has been built correctly.
cd /usr/local/bin
ls -l
total 8925
drwxr-xr-x   2 root root    1024 Feb 11 10:57 .
drwxr-xr-x  12 root root    1024 Jan 14 11:46 ..
-rwxr-xr-x   1 root root    1223 Feb 11 10:57 GraphicsMagick++-config
-rwxr-xr-x   1 root root    1266 Feb 11 10:57 GraphicsMagick-config
-rwxr-xr-x   1 root root    1250 Feb 11 10:57 GraphicsMagickWand-config
-rwxr-xr-x   1 root root 5209711 Feb 11 10:57 PerlMagick
lrwxrwxrwx   1 root root       2 Feb 11 10:57 animate -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 composite -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 conjure -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 convert -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 display -> gm
-rwxr-xr-x   1 root root 3891115 Feb 11 10:57 gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 identify -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 import -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 mogrify -> gm
lrwxrwxrwx   1 root root       2 Feb 11 10:57 montage -> gm

If you want to allow only executable files from /usr/local/php/bin for PHP applications, then you have to copy the files from /usr/bin or /usr/local/bin (see result of 'rpm -qa GraphicksMagick') into /usr/local/php/bin. Otherwise you skip the following 2 steps.

/usr/local # mkdir php
/usr/local # cd php
/usr/local/php # mkir bin
/usr/local/php # cd bin
/usr/local/php/bin # cp /usr/bin/animate .
/usr/local/php/bin # cp /usr/bin/compare .
...
/usr/local/php/bin # cp /usr/bin/xtp .

PHP Configuration

Edit the php.ini file for the allowed include and executable file directories outside of the apache document root folder.

safe_mode_include_dir = /usr/local/php/bin
safe_mode_exec_dir = /usr/local/php/bin

Settings for TYPO3 >= 3.8

You can drop all "im..." settings from localconf.php except

$TYPO3_CONF_VARS['GFX']['im_path'] = '<path>'; 
$TYPO3_CONF_VARS['GFX']['im_version_5'] = 'gm';

Using with TYPO3 < 3.8 and LINUX

  1. If you did not compile it with the option '--enable-magick-compat' you have to download the script graphicsmagick_wrapper

Since the wrapper is a Unix shell script, it will not work on Windows. For ideas & comments, send a mail to Michael Stucki.

  1. Create a new directory /usr/local/graphicsmagick and move the wrapper script into it
  2. Run the commands below to finish the installation:
  3. Have a look at the file localconf_graphicsmagick.php.txt to see some recommended settings for your localconf.php
PROGRAM=graphicsmagick
cd /usr/local/${PROGRAM}
chmod a+x ${PROGRAM}_wrapper.sh
for i in composite convert identify; \
   do ln -s ${PROGRAM}_wrapper.sh $i; \
   done

(shell's link modified to work)

Settings for option '--enable-magick-compat'

#  General options related to image processing
$TYPO3_CONF_VARS["GFX"]["gif_compress"] = '1';   
$TYPO3_CONF_VARS["GFX"]["thumbnails_png"] = '0'; # # GD library settings #  
$TYPO3_CONF_VARS["GFX"]["gdlib_png"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["gdlib_2"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["TTFdpi"] = '96'; # # ImageMagick settings # 
$TYPO3_CONF_VARS["GFX"]["im_path"] = '/usr/local/bin'; 
$TYPO3_CONF_VARS["GFX"]["im_version_5"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["im_imvMaskState"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["im_v5effects"] = '-1'; 
$TYPO3_CONF_VARS["GFX"]["im_combine_filename"] = 'composite';

Settings for graphicsmagick_wrapper.sh

#  General options related to image processing
$TYPO3_CONF_VARS["GFX"]["gif_compress"] = '1';   
$TYPO3_CONF_VARS["GFX"]["thumbnails_png"] = '0'; # # GD library settings #  
$TYPO3_CONF_VARS["GFX"]["gdlib_png"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["gdlib_2"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["TTFdpi"] = '96'; # # ImageMagick settings # 
$TYPO3_CONF_VARS["GFX"]["im_path"] = '/usr/local/graphicsmagick'; 
$TYPO3_CONF_VARS["GFX"]["im_version_5"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["im_imvMaskState"] = '1'; 
$TYPO3_CONF_VARS["GFX"]["im_v5effects"] = '-1'; 
$TYPO3_CONF_VARS["GFX"]["im_combine_filename"] = 'composite';
Personal tools