[BUGFIX] Fix source collection for GIFBUILDER 17/55817/2
authorMarco Huber <mail@marco-huber.de>
Mon, 22 Aug 2016 11:49:34 +0000 (13:49 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 20 Feb 2018 07:51:48 +0000 (08:51 +0100)
If the file resource is a GIFBUILDER object, the dimension is set in the
properties XY, maxWidth or maxHeight.

Change-Id: Ic931760a966e6647042bca976c48e7bbaabdbb5a
Resolves: #77577
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/55817
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 2264ed9..91ddc35 100644 (file)
@@ -1190,7 +1190,7 @@ class ContentObjectRenderer
                 } else {
                     $pixelDensity = 1;
                 }
-                $dimensionKeys = ['width', 'height', 'maxW', 'minW', 'maxH', 'minH'];
+                $dimensionKeys = ['width', 'height', 'maxW', 'minW', 'maxH', 'minH', 'maxWidth', 'maxHeight', 'XY'];
                 foreach ($dimensionKeys as $dimensionKey) {
                     $dimension = $this->stdWrap($sourceConfiguration[$dimensionKey], $sourceConfiguration[$dimensionKey . '.']);
                     if (!$dimension) {
@@ -1203,6 +1203,12 @@ class ContentObjectRenderer
                             if ($dimensionParts[1]) {
                                 $dimension .= $dimensionParts[1];
                             }
+                        } elseif ($dimensionKey === 'XY') {
+                            $dimensionParts = GeneralUtility::intExplode(',', $dimension, false, 2);
+                            $dimension = $dimensionParts[0] * $pixelDensity;
+                            if ($dimensionParts[1]) {
+                                $dimension .= ',' . $dimensionParts[1] * $pixelDensity;
+                            }
                         } else {
                             $dimension = (int)$dimension * $pixelDensity;
                         }