Bug #21054
closedGMENU - first menu item does not appear because of wrong calulation of text position
100%
Description
The fist menu item does not appear, but always only the first.
The problem occours because of the wrong calculation of the text position in tslib_gifBuilder::ImageTTFBBoxWrapper
If you call the following function all in this function simply twice it works:
$calc = ImageTTFBBox(t3lib_div::freetypeDpiComp($sF*$strCfg['fontSize']), $angle, $fontFile, $strCfg['str']);
I have checked the image proccessing menu point in the install tool with the following result:
TYPO3 4.2.8
ImageMagick enabled: 1
ImageMagick path: (6.3.7)
ImageMagick path/LZW: (6.3.7)
Version 5/GraphicsMagick flag: im5
GDLib enabled: 1
GDLib using PNG: 0
GDLib 2 enabled: 0
IM5 effects enabled: 0 (Blurring/Sharpening with IM 5+)
Freetype DPI: 96 (Should be 96 for Freetype 2)
Mask invert: 0 (Should be set for some IM versions approx. 5.4+)
File Formats: gif,jpg,jpeg,tif,bmp,pcx,tga,png,pdf,ai
The testmenu items all works fine exclude the following:
GD libary functions:
- Render text with TrueType font using 'niceText' option
- Render 'niceText' with a shadow under
(issue imported from #M11954)
Files
Updated by Andreas Wolf about 15 years ago
What exactly does not look correct on the rendered test images? Does it help to set Freetype DPI to 72? Which PHP/GD version are you using? Try to enable usage of GD version 2 and check the result again.
Updated by Christian Bernet about 15 years ago
We have exactly the same error. The rendered test images looked right. php: 5.2.6, freetype: 2.3.7, libgd2. The use of GD Version 2 is enabled. The label of the first item wich has "align = center" in a GMENU will not be drawn.
We have another error: if we have the typoscript: "dimensions = [10.w]+16,0,3,18" we get a fatal error. it's in different typo3 versions, from 4.0.4 trought 4.2.9. it was after a upgrade from debian etch to the lenny version.
Updated by Christian Bernet about 15 years ago
its a php bug http://bugs.php.net/bug.php?id=22513
Updated by Albrecht Köhnlein over 13 years ago
- File 21054.patch 21054.patch added
- Target version deleted (
0)
Yes, it's a PHP bug, but here is a tiny bugfix/workaround for those who can't fix their PHP.
The problem are the negative values, returned from PHP function ImageTTFBBox
Array ( [0] => -1 [1] => 0 [2] => -2147483648 [3] => 0 [4] => -2147483648 [5] => -26 [6] => -1 [7] => -26 )
Because the wrong values do not appear always, it helps to recalculate until the value is correct. So I changed
$calc = ImageTTFBBox(t3lib_div::freetypeDpiComp($sF*$strCfg['fontSize']), $angle, $fontFile, $strCfg['str']);
into
do { $calc = ImageTTFBBox(t3lib_div::freetypeDpiComp($sF*$strCfg['fontSize']), $angle, $fontFile, $strCfg['str']); } while($calc[2] < 0);
in file class.t3lib_stdgraphic.php
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change I6c1548e0f8762d6c2befdd47dbfb7810b01c9508 has been pushed to the review server.
It is available at http://review.typo3.org/3281
Updated by Mr. Hudson over 13 years ago
Patch set 3 of change I6c1548e0f8762d6c2befdd47dbfb7810b01c9508 has been pushed to the review server.
It is available at http://review.typo3.org/3281
Updated by Mr. Hudson over 13 years ago
Patch set 4 of change I6c1548e0f8762d6c2befdd47dbfb7810b01c9508 has been pushed to the review server.
It is available at http://review.typo3.org/3281
Updated by Mr. Hudson about 13 years ago
Patch set 5 of change I6c1548e0f8762d6c2befdd47dbfb7810b01c9508 has been pushed to the review server.
It is available at http://review.typo3.org/3281
Updated by Albrecht Köhnlein about 13 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset bef7ecc6a931797fe77afcceabbeb22f84bc2e83.
Updated by Gerrit Code Review almost 13 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_4-4 has been pushed to the review server.
It is available at http://review.typo3.org/7120
Updated by Gerrit Code Review almost 13 years ago
Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/7119
Updated by Albrecht Köhnlein almost 13 years ago
- Status changed from Under Review to Resolved
Applied in changeset ee28ebccdb12ccf7c526e6e01aaabdf04c007102.