#25926 [NEW]: ImageTTFText and ImageTTFBox don't work and return wierd values
| From: | olga at bluebytes dot com | Date: | Mon, 20 Oct 2003 19:50:42 +0000 |
| Subject: | #25926 [NEW]: ImageTTFText and ImageTTFBox don't work and return wierd values | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-49249@lists.php.net to get a copy of this message | ||
From: olga at bluebytes dot com
Operating system: Linux
PHP version: 4.3.3
PHP Bug Type: GD related
Bug description: ImageTTFText and ImageTTFBox don't work and return wierd values
Description:
------------
ImageTTFText doesn't output any characters. If there's anything else in
the image, the rest will be fine; if the text string is the only thing,
the image will be blank.
Trying to figure out what's wrong, I took a look at the return values from
ImageTTFText as well as ImageTTFBox. They both produce huge values, i.e.
Array ( [0] => 138323388 [1] => 11 [2] => -1073754136 [3] => 1076636124
[4] => 138611764 [5] => 138323484 [6] => 11 [7] => 0 )
The values DO NOT depend on the font used. Furthermore, they are different
each time I load the page for the SAME font
(http://blunoise.com/imagetext.php shows values for "Hello world" in
arial).
Reproduce code:
---------------
<?php
//header("Content-type: image/jpeg");
error_reporting('E_ALL');
$im = imagecreate(400,30);
$white = imagecolorallocate($im, 255,255,255);
$black = imagecolorallocate($im, 0,0,0);
// Replace path by your own font path
$result = imagettftext($im, 12, 0, 6, 20, $black,
"/home/blunoise/fonts/arial.ttf", "Hello world");
$bbox=imagettfbbox (12, 0, "/home/blunoise/fonts/arial.ttf", "Hello
world");
print_r($bbox);
//imagepng($im);
imagedestroy($im);
?>
Expected result:
----------------
A jpeg saying "Hello world"
--
Edit bug report at http://bugs.php.net/?id=25926&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25926&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25926&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25926&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25926&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25926&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25926&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25926&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25926&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25926&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25926&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25926&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25926&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25926&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25926&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25926&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=25926&r=float