[BUGFIX] Calculations in GIFBUILDER properties using stdWrap fail 23/24923/3
authorDan Untenzu <mail@pixelbrackets.de>
Mon, 21 Oct 2013 12:13:39 +0000 (14:13 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Sat, 15 Aug 2015 10:54:43 +0000 (12:54 +0200)
Unset each existing TypoScript subarray of all properties
with calculations (offset,dimensions,set,…) in GIFBUILDER.
Do this to prevent the double execution of stdWrap,
which would cause those properties to return uncalculated
and therefore wrong values afterwards.

Resolves: #53002
Releases: master, 6.2
Change-Id: Ib9a6ede30988acad25df8fcca811475c19e77b09
Reviewed-on: http://review.typo3.org/24923
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php

index 6d3266f..959ceae 100644 (file)
@@ -283,6 +283,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'IMAGE':
                                                        if (isset($this->setup[$theKey . '.']['offset.'])) {
                                                                $this->setup[$theKey . '.']['offset'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['offset'], $this->setup[$theKey . '.']['offset.']);
+                                                               unset($this->setup[$theKey . '.']['offset.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['offset']) {
                                                                $this->setup[$theKey . '.']['offset'] = $this->calcOffset($this->setup[$theKey . '.']['offset']);
@@ -293,6 +294,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'ELLIPSE':
                                                        if (isset($this->setup[$theKey . '.']['dimensions.'])) {
                                                                $this->setup[$theKey . '.']['dimensions'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['dimensions'], $this->setup[$theKey . '.']['dimensions.']);
+                                                               unset($this->setup[$theKey . '.']['dimensions.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['dimensions']) {
                                                                $this->setup[$theKey . '.']['dimensions'] = $this->calcOffset($this->setup[$theKey . '.']['dimensions']);
@@ -301,6 +303,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'WORKAREA':
                                                        if (isset($this->setup[$theKey . '.']['set.'])) {
                                                                $this->setup[$theKey . '.']['set'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['set'], $this->setup[$theKey . '.']['set.']);
+                                                               unset($this->setup[$theKey . '.']['set.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['set']) {
                                                                $this->setup[$theKey . '.']['set'] = $this->calcOffset($this->setup[$theKey . '.']['set']);
@@ -309,6 +312,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'CROP':
                                                        if (isset($this->setup[$theKey . '.']['crop.'])) {
                                                                $this->setup[$theKey . '.']['crop'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['crop'], $this->setup[$theKey . '.']['crop.']);
+                                                               unset($this->setup[$theKey . '.']['crop.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['crop']) {
                                                                $this->setup[$theKey . '.']['crop'] = $this->calcOffset($this->setup[$theKey . '.']['crop']);
@@ -317,12 +321,14 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                                                case 'SCALE':
                                                        if (isset($this->setup[$theKey . '.']['width.'])) {
                                                                $this->setup[$theKey . '.']['width'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['width'], $this->setup[$theKey . '.']['width.']);
+                                                               unset($this->setup[$theKey . '.']['width.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['width']) {
                                                                $this->setup[$theKey . '.']['width'] = $this->calcOffset($this->setup[$theKey . '.']['width']);
                                                        }
                                                        if (isset($this->setup[$theKey . '.']['height.'])) {
                                                                $this->setup[$theKey . '.']['height'] = $this->cObj->stdWrap($this->setup[$theKey . '.']['height'], $this->setup[$theKey . '.']['height.']);
+                                                               unset($this->setup[$theKey . '.']['height.']);
                                                        }
                                                        if ($this->setup[$theKey . '.']['height']) {
                                                                $this->setup[$theKey . '.']['height'] = $this->calcOffset($this->setup[$theKey . '.']['height']);