[TASK] Remove PHP bug workaround in GIFBUILDER 96/57196/3
authorBenni Mack <benni@typo3.org>
Tue, 12 Jun 2018 08:29:25 +0000 (10:29 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 12 Jun 2018 11:44:51 +0000 (13:44 +0200)
TYPO3 has a bound box calculation workaround due to a PHP bug,
which was fixed in PHP 7.0.12 / 7.1, which can now safely be
removed.

Resolves: #85232
Releases: master
Change-Id: I72e9ea925ae7e91eea244b89a20b1bec2408ca78
Reviewed-on: https://review.typo3.org/57196
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php

index 8459588..60e8e1e 100644 (file)
@@ -943,17 +943,8 @@ class GraphicalFunctions
         foreach ($stringParts as $strCfg) {
             $fontFile = GeneralUtility::getFileAbsFileName($strCfg['fontFile']);
             if (is_readable($fontFile)) {
-                /**
-                 * Calculate Bounding Box for part.
-                 * Due to a PHP bug, we must retry if $calc[2] is negative.
-                 *
-                 * @see https://bugs.php.net/bug.php?id=51315
-                 * @see https://bugs.php.net/bug.php?id=22513
-                 */
-                $try = 0;
-                do {
-                    $calc = imagettfbbox($this->compensateFontSizeiBasedOnFreetypeDpi($sF * $strCfg['fontSize']), $angle, $fontFile, $strCfg['str']);
-                } while ($calc[2] < 0 && $try++ < 10);
+                // Calculate Bounding Box for part.
+                $calc = imagettfbbox($this->compensateFontSizeiBasedOnFreetypeDpi($sF * $strCfg['fontSize']), $angle, $fontFile, $strCfg['str']);
                 // Calculate offsets:
                 if (empty($offsetInfo)) {
                     // First run, just copy over.