#50014 [Asn->Fbk]: imagettfbbox gives unexpected results.
| From: | tabe@php.net | Date: | Thu, 29 Oct 2009 12:32:40 +0000 |
| Subject: | #50014 [Asn->Fbk]: imagettfbbox gives unexpected results. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144070@lists.php.net to get a copy of this message | ||
ID: 50014
Updated by: tabe@php.net
Reported By: info at frankdegraaf dot net
-Status: Assigned
+Status: Feedback
Bug Type: GD related
Operating System: Debian Lenny amd64
PHP Version: 5.2.11
Assigned To: pajoye
New Comment:
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
)
Previous Comments:
------------------------------------------------------------------------
[2009-10-27 11:51:49] johannes@php.net
Pierre, please check this. Thanks.
------------------------------------------------------------------------
[2009-10-27 10:32:19] 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
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50014&edit=1