#49815 [NEW]: Problem with imagettfbbox
| From: | christian dot roy at orange dot fr | Date: | Thu, 08 Oct 2009 15:07:48 +0000 |
| Subject: | #49815 [NEW]: Problem with imagettfbbox | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-143389@lists.php.net to get a copy of this message | ||
From: christian dot roy at orange dot fr
Operating system: Linux
PHP version: 5.2.11
PHP Bug Type: GD related
Bug description: Problem with imagettfbbox
Description:
------------
delivered value problem : x coord are wrong.
Seems to be very similar with bug #48801 taht has been fixed in 5.2.11 for
y coordinates
Reproduce code:
---------------
$fontPath = 'Labo/Includes/Times.ttf'; // std Times.ttf
$testChars = array( 'a', 'k', 'j' );
echo '<pre>';
foreach( $testChars as $char )
{
$dims = imagettfbbox( 60, 0, $fontPath, $char );
echo '<br>bbox returned rectangle for ' . $char . ' : ';
echo $dims[0]." * ";
echo $dims[1]." * ";
echo $dims[2]." * ";
echo $dims[3]." * ";
echo $dims[4]." * ";
echo $dims[5]." * ";
echo $dims[6]." * ";
echo $dims[7]."<br>";
}
echo '</pre>';
Expected result:
----------------
With PHP 4.4.9 :
bbox returned rectangle for a : 2 * 1 * 35 * 1 * 35 * -38 * 2
* -38
bbox returned rectangle for k : 0 * -1 * 38 * -1 * 38 * -57 *
0 * -57
bbox returned rectangle for j : -9 * 17 * 14 * 17 * 14 * -57 *
-9 * -57
Actual result:
--------------
With PHP 5.2.11
bbox returned rectangle for a : 2 * 1 * 35 * 1 * 35 * -38 * 2
* -38
bbox returned rectangle for k : 0 * -1 * 38 * -1 * 38 * -57 *
0 * -57
bbox returned rectangle for j : -9 * 17 * 14 * 17 * 14 * -57 *
-9 * -57
--
Edit bug report at http://bugs.php.net/?id=49815&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49815&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49815&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49815&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49815&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49815&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49815&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49815&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49815&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49815&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49815&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49815&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49815&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49815&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49815&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49815&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49815&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49815&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49815&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49815&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49815&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49815&r=mysqlcfg