php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30289 imagettfbbox returns wrong information
Submitted: 2004-09-30 11:12 UTC Modified: 2004-11-19 18:06 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cipri@php.net Assigned:
Status: Closed Package: GD related
PHP Version: 4.3.9 OS: Linux
Private report: No CVE-ID: None
 [2004-09-30 11:12 UTC] cipri@php.net
Description:
------------
When running imagettfbbox() against a font, the returned values are way off, in the billions or negative billions.

Reproduce code:
---------------
print_r(imagettfbbox(9, 0, "HelvCondBlack.TTF", 'HOME'));

HelvCondBlack.TTF is available for download at http://www.campai.nl/fonttest/HelvCondBlack.TTF

Expected result:
----------------
Array
(
    [0] => -1
    [1] => -1
    [2] => 21
    [3] => -1
    [4] => 21
    [5] => -8
    [6] => -1
    [7] => -8
)



Actual result:
--------------
Array
(
    [0] => 1080490528
    [1] => 153840736
    [2] => -1073754904
    [3] => 1081352559
    [4] => 1080490544
    [5] => 1080487896
    [6] => -1073754872
    [7] => 1079718188
)
(The 2nd item, [1], will fluctuate mildly between requests)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-30 22:43 UTC] iliaa@php.net
Works fine with 4.3.9 i got here using bundled libgd, are you using bundled lib gd or the external one? What GD related configuration flags do you have enabled?
 [2004-10-01 10:24 UTC] cipri@php.net
From phpinfo()'s configure string:
--- 
'./configure' *snap* '--with-gd' '--enable-gd-native-ttf' '--with-t1lib' '--with-jpeg-dir=/usr/lib' '--with-png-dir=/usr/lib' '--with-ttf' *snap*
--- 

From the GD table in phpinfo():
--
                GD

GD Support          enabled  
GD Version          bundled (2.0.28 compatible)  
FreeType Support    enabled  
FreeType Linkage    with TTF library  
T1Lib Support       enabled  
GIF Read Support    enabled  
GIF Create Support  enabled  
JPG Support         enabled  
PNG Support         enabled  
WBMP Support        enabled  
XBM Support         enabled  

--
 [2004-10-01 15:59 UTC] cipri@php.net
Comparing it to a similar server, still running 4.3.0, which DOES give the right results, I noticed a small difference in the compile strings:

OK: '--with-ttf' 

WRONG: '--enable-gd-native-ttf' '--with-t1lib' '--with-ttf'
 [2004-10-04 14:28 UTC] cipri@php.net
After having PHP recompiled with the following items in the ./configure string everything started working again:

'--disable-gd-native-ttf'

It would thus seem to be a problem with GD's native TTF Functions...
 [2004-11-19 18:06 UTC] pajoye@php.net
Seems to be fixed using the right ft.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 01:01:28 2024 UTC