Commit 23267399 authored by Benni Mack's avatar Benni Mack Committed by Wouter Wolters
Browse files

[TASK] Remove PHP bug workaround in GIFBUILDER

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 4afcded3
......@@ -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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment