Bug #64614 [Opn]: imagettbbox() Always returns -1 for X coordinate left corner.
Edit report at https://bugs.php.net/bug.php?id=64614&edit=1
ID: 64614
Updated by: cmb@php.net
Reported by: fredcm at gmail dot com
Summary: imagettbbox() Always returns -1 for X coordinate
left corner.
Status: Open
Type: Bug
Package: GD related
Operating System: Linux/Windows
PHP Version: 5.4.13
Block user comment: N
Private report: N
New Comment:
Besides Mark's fix, I've noticed that external libgd's results may
differ from those of the bundled libgd, see
<https://github.com/libgd/libgd/issues/301>.
Previous Comments:
------------------------------------------------------------------------
[2016-03-31 11:37:35] mplomer at gmx dot de
For proposed fix and further info/discussion, see bug #53504
------------------------------------------------------------------------
[2015-05-17 16:17:32] davehampson12 at gmail dot com
Same reason as the original reporter - I need to calculate the bounding box dimensions of text and
this bug doesn't help :)
------------------------------------------------------------------------
[2013-04-09 12:11:16] fredcm at gmail dot com
Description:
------------
//The function imagettbbox() always returns -1 for X coordinate left corner.
$bbox = imagettfbbox(20, 0, './arial.ttf', 'TestImagettfbbox');
echo $bbox[0]; // always -1 - lower left corner, X position
echo $bbox[6]; // always -1 - upper left corner, X position
//with this problem there is no way to align left the text in the image.
Test script:
---------------
$bbox = imagettfbbox(20, 0, './arial.ttf', 'TestImagettfbbox');
echo $bbox[0]; // always -1 - lower left corner, X position
echo $bbox[6]; // always -1 - upper left corner, X position
Expected result:
----------------
Return valid values for X coordinates.
I've tested the imagettbbox() in PHP 5.0.4 and the function is working.
Actual result:
--------------
imagettbbox() always returns -1 for X coordinate of the left corners.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64614&edit=1
Thread (10 messages)