From: a dot vent at procommerz dot de
Operating system: Debian Linux 3.0 "Woody"
PHP version: 4.4.0
PHP Bug Type: GD related
Bug description: imagettftext produces no output
Description:
------------
The ImageTTFText function produces no result, but also no
error. I've tried several font files (Microsoft TT core
fonts and also from other sources), several paths (the
same dir as the PHP script, relative to DocRoot, absolute
path a.s.o.).
It looks like not calling imagettftext - the function
silently does nothing...
I have Debian "Woody" with Apache 1.3.29 / PHP 4.4.0. The
GD lib is the bundled one (phpinfo says: "2.0.28
compatible"). The Freetype lib version is 1.4pre, as
provided from Debian package manager.
PHP configure options:
'./configure' '--with-apxs=/var/www/bin/apxs'
'--with-mysql' '--enable-ftp' '--enable-shared'
'--with-iconv' '--with-gd' '--with-curl'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr'
'--with-dom=/usr' '--with-zlib' '--enable-cli'
'--with-ttf=/usr'
Output snippet from phpinfo:
GD Support
enabled
GD Version
bundled (2.0.28 compatible)
FreeType Support
enabled
FreeType Linkage
with TTF library
GIF Read Support
enabled
GIF Create Support
enabled
JPG Support
enabled
PNG Support
enabled
WBMP Support
enabled
XBM Support
enabled
Reproduce code:
---------------
<?php
header("Content-type: image/png");
$im = imagecreatetruecolor(400, 30);
$grey = imagecolorallocate($im, 102, 102, 102);
$white = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 0, 0, $grey);
$fontfile = realpath("./Arial.ttf");
imagettftext($im, 20, 0, 10, 20, $white, $fontfile, "Hello World!");
imagepng($im);
imagedestroy($im);
?>
Expected result:
----------------
Displays an image with white-colored text "Hello World" in
Arial font face on grey background.
Actual result:
--------------
Displays an grey-colored image without any text (empty
grey box). No error messages.
--
Edit bug report at http://bugs.php.net/?id=33692&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33692&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33692&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33692&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33692&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33692&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33692&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33692&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33692&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33692&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33692&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33692&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33692&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33692&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33692&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33692&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33692&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33692&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33692&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33692&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33692&r=mysqlcfg