[BUGFIX] undefined variable imgExt
authorSimon Schaufelberger <simonschaufi@googlemail.com>
Thu, 1 Mar 2012 14:32:55 +0000 (15:32 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Thu, 8 Mar 2012 11:40:40 +0000 (12:40 +0100)
reducing colors in getImgResource function fails if not using image-
magic

Change-Id: I99577b8064d8094d47f2735767ad6ea4c8c0d54e
Fixes: #34446
Releases: 4.7, 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/9316
Reviewed-by: Steffen Ritter
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Tested-by: Steffen Ritter
typo3/sysext/cms/tslib/class.tslib_content.php

index 65470b5..fcc85ed 100644 (file)
@@ -5219,7 +5219,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]);