[BUGFIX] undefined variable imgExt
authorSimon Schaufelberger <simonschaufi@googlemail.com>
Thu, 1 Mar 2012 14:32:55 +0000 (15:32 +0100)
committerXavier Perseguers <xavier@typo3.org>
Tue, 16 Oct 2012 10:09:59 +0000 (12:09 +0200)
reducing colors in getImgResource function fails if not using
image-magick

Change-Id: I58a4c14bda731a1f36f04a352cfed74770d884fb
Fixes: #34446
Releases: 4.7, 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/12839
Reviewed-by: Simon Schaufelberger
Reviewed-by: Marcus Schwemer
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/cms/tslib/class.tslib_content.php

index 1ca3efa..4b3d50b 100644 (file)
@@ -5111,7 +5111,7 @@ class tslib_cObj {
                                                        } else { // Normal situation:
                                                                $fileArray['params'] = $this->modifyImageMagickStripProfileParameters($fileArray['params'], $fileArray);
                                                                $GLOBALS['TSFE']->tmpl->fileCache[$hash] = $gifCreator->imageMagickConvert($theImage, $fileArray['ext'], $fileArray['width'], $fileArray['height'], $fileArray['params'], $fileArray['frame'], $options);
-                                                               if (($fileArray['reduceColors'] || ($imgExt == 'png' && !$gifCreator->png_truecolor)) && is_file($GLOBALS['TSFE']->tmpl->fileCache[$hash][3])) {
+                                                               if (($fileArray['reduceColors'] || ($fileArray['ext'] == 'png' && !$gifCreator->png_truecolor)) && is_file($GLOBALS['TSFE']->tmpl->fileCache[$hash][3])) {
                                                                        $reduced = $gifCreator->IMreduceColors($GLOBALS['TSFE']->tmpl->fileCache[$hash][3], t3lib_utility_Math::forceIntegerInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
                                                                        if (is_file($reduced)) {
                                                                                unlink($GLOBALS['TSFE']->tmpl->fileCache[$hash][3]);