php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50014 imagettfbbox gives unexpected results.
Submitted: 2009-10-27 10:32 UTC Modified: 2009-11-06 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: info at frankdegraaf dot net Assigned: tabe (profile)
Status: No Feedback Package: GD related
PHP Version: 5.2.11 OS: Debian Lenny amd64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: info at frankdegraaf dot net
New email:
PHP Version: OS:

 

 [2009-10-27 10:32 UTC] info at frankdegraaf dot net
Description:
------------
The return results for imagettfbbox are way off. The function gives a large negative values for [1] (lower left corner, Y position), [2] (lower right corner, X position), [4](upper right corner, X position), [7](upper left corner, Y position).

The changelog shows a solved bug regarding this function (#48555), perhaps it is related.

The font can be downloaded here: http://www.fonts4free.net/dsplus/m.php?p=bn_machine.zip

Reproduce code:
---------------
<?php
print_r(imagettfbbox(37, 11, '/var/www/fonts/BNMachine.ttf', 'T'));
?>

Expected result:
----------------
Result from PHP 5.2.10:

Array
(
    [0] => -1
    [1] => 0
    [2] => 25
    [3] => -4
    [4] => 18
    [5] => -42
    [6] => -9
    [7] => -37
)

Actual result:
--------------
Result from PHP 5.2.11:

Array
(
    [0] => -1
    [1] => -2147483648
    [2] => -2147483648
    [3] => -4
    [4] => -2147483648
    [5] => -42
    [6] => -9
    [7] => -2147483648
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-27 11:51 UTC] johannes@php.net
Pierre, please check this. Thanks.
 [2009-10-29 12:32 UTC] tabe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

It looks ok with PHP_5_2:
Array
(
    [0] => -1
    [1] => -1
    [2] => 26
    [3] => -6
    [4] => 19
    [5] => -45
    [6] => -10
    [7] => -40
)

 [2009-11-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 14:01:29 2024 UTC