[BUGFIX] Disabled ImageMagick throws Exception
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 11 Dec 2011 00:20:44 +0000 (18:20 -0600)
committerJigal van Hemert <jigal@xs4all.nl>
Sun, 11 Dec 2011 11:38:49 +0000 (12:38 +0100)
Disabling ImageMagick causes t3lib_stdgraphic to throw a
RuntimeException when checking for version compatibility.

Change-Id: I3a13ce95c923487cbc7488ac30fd747c52d60904
Fixes: #32433
Releases: 4.7, 4.6
Reviewed-on: http://review.typo3.org/7190
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
t3lib/class.t3lib_stdgraphic.php

index 37a8dc0..e3d1db2 100644 (file)
@@ -145,7 +145,10 @@ class t3lib_stdGraphic {
                if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['png_truecolor']) {
                        $this->png_truecolor = TRUE;
                }
-               if (!$gfxConf['im_version_5'] || $gfxConf['im_version_5'] === 'im4' || $gfxConf['im_version_5'] === 'im5') {
+               if (!$gfxConf['im']) {
+                       $this->NO_IMAGE_MAGICK = 1;
+               }
+               if (!$this->NO_IMAGE_MAGICK && (!$gfxConf['im_version_5'] || $gfxConf['im_version_5'] === 'im4' || $gfxConf['im_version_5'] === 'im5')) {
                        throw new RuntimeException(
                                'Your TYPO3 installation is configured to use an old version of ImageMagick, which is not supported anymore. ' .
                                'Please upgrade to ImageMagick version 6 or GraphicksMagick and set $TYPO3_CONF_VARS[\'GFX\'][\'im_version_5\'] appropriately.',
@@ -209,9 +212,6 @@ class t3lib_stdGraphic {
                        }
                }
 
-               if (!$gfxConf['im']) {
-                       $this->NO_IMAGE_MAGICK = 1;
-               }
                        // Secures that images are not scaled up.
                if ($gfxConf['im_noScaleUp']) {
                        $this->mayScaleUp = 0;