From:             aderyn at gentoo dot se
Operating system: Linux 2.6.7 (Gentoo)
PHP version:      5.0.0RC3
PHP Bug Type:     GD related
Bug description:  imagettftext fails

Description:
------------
This code (See below) leaves the image empty, without returning any kind
of error. I've verified that it really remains empty several times. The
intresting thing is that if I replace imagecreatetruecolor with
imagecreate it works.

Configure-line:
'./configure' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-xsl'
'--with-gd' '--with-pspell' '--with-ttf' '--with-zlib'
'--with-jpeg-dir=/usr/lib' '--enable-sockets' '--enable-ftp'
'--with-mysql=/usr/local/mysql40/' '--enable-exif'

No gd-related changes to php.ini.

Reproduce code:
---------------
list($ll['x'],$ll['y'],$lr['x'],$lr['y'],$ur['x'],$ur['y'],$ul['x'],$ul['y'])
= imagettfbbox(10,0,FONT,$text);
//echo abs($lr['x'])+abs($ur['x']),' ',abs($ur['y'])+abs($lr['y']);
$img2 =
imagecreatetruecolor(abs($lr['x'])+abs($ul['x']),abs($ur['y'])+abs($lr['y']));
imagecolorallocate($img2,0,0,0);
imagettftext($img2,10,0,$ul['x'],8,imagecolorallocate($img2,255,0,0),FONT,$text);
imagepng($img2,'foo.png');
imagedestroy($img2);

Expected result:
----------------
The text outputted on the image canvas.

Actual result:
--------------
A blank image.

-- 
Edit bug report at http://bugs.php.net/?id=28885&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28885&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28885&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28885&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28885&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28885&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28885&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28885&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28885&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28885&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28885&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28885&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28885&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28885&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28885&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28885&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28885&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28885&r=float

Reply via email to