[BUGFIX] undefined variable imgExt 40/12840/2
authorSimon Schaufelberger <simonschaufi@googlemail.com>
Thu, 1 Mar 2012 14:32:55 +0000 (15:32 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 12 May 2013 13:28:33 +0000 (15:28 +0200)
reducing colors in getImgResource function fails if not using
image-magick

Change-Id: I127ea54becd12a09cdd92a299e1f2d517d106763
Fixes: #34446
Releases: 4.7, 4.6, 4.5, 4.4
Reviewed-on: https://review.typo3.org/12840
Reviewed-by: Marcus Schwemer
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/cms/tslib/class.tslib_content.php

index 47a30b5..3e8ef14 100644 (file)
@@ -5108,7 +5108,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_div::intInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
                                                                        if (is_file($reduced)) {
                                                                                unlink($GLOBALS['TSFE']->tmpl->fileCache[$hash][3]);