From:             [EMAIL PROTECTED]
Operating system: Linux-Mandrake 8.2
PHP version:      4.1.2
PHP Bug Type:     GD related
Bug description:  PNG generation w/ TTF Font loading works from cmd line but fails 
from http

Running Linux-Mandrake 8.2 on Duron 700 266 FSB w/ php 4.1.2 and Zend
engine optimized to 65535 (pass 9 and 10 and 11)

Installed:
apache-conf-1.3.23-4mdk
apache-suexec-1.3.23-3mdk
apache-modules-1.3.23-4mdk
apache-mod_perl-1.3.23_1.26-5mdk
apache-manual-1.3.23-4mdk
apache-devel-1.3.23-4mdk
apache-1.3.23-4mdk
apache-common-1.3.23-4mdk
apache-source-1.3.20-3mdk
php-imap-4.1.2-1mdk
php-manual_en-4.1.1-1mdk
php-xml-4.1.2-1mdk
php-common-4.1.2-1mdk
php-mysql-4.1.2-2mdk
php-readline-4.1.2-1mdk
php-4.1.2-1mdk
php-dba_gdbm_db3-4.1.2-1mdk
php-ldap-4.1.2-1mdk
php-gd-4.1.2-1mdk
php-pgsql-4.1.2-1mdk
mod_php-4.1.2-1mdk
php-devel-4.1.2-1mdk
libgd1-devel-1.8.4-4mdk
libgd1-1.8.4-4mdk
freetype-tools-1.3.1-12mdk
freetype-1.3.1-12mdk
freetype-devel-1.3.1-12mdk
freetype2-2.0.4-1mdk
freetype2-devel-2.0.4-1mdk

http://reality.poetryunlimited.com:81/testvars - list of php settings and
modules

http://new.poetryunlimited.com:81/testbug.php3 -fails miserably.

php testbug.php3 generates image perfectly. Copy of saved image located at
http://new.poetryunlimited.com:81/images/myimg.png

Font directory cannot even be relative or font loading fails - preferred
earlier GD preferences - where can we set the GDFONTPATH env variable per
server? Can we use a full path outside of the apache tree???

Any font file can be used in place of the ttf I have placed below. If the
ttf is requried it can be retrieved from
http://new.poetryunlimited.com:81/font/bluebold.ttf

testbug.php3 follows

<?php
$imagewidth = 100;
$imageheight = 20;
$fontsize = 12;
$myimg=ImageCreate($imagewidth, $imageheight);
$col1=ImageColorAllocate($myimg, 255, 0, 0);
$col2=ImageColorAllocate($myimg, 255, 255, 255);
$thetextbox = ImageTTFBBox ($fontsize, 0,
"/home/httpd/html/new/font/bluebold.ttf", "My Button");
$textwidth = (($thetextbox[4] + $thetextbox[2]) / 2) - (($thetextbox[6] +
$thetextbox[0]) / 2);
$xpos = ($imagewidth - $textwidth) / 2;
$ypos = 14;
ImageTTFText ($myimg, $fontsize, 0, $xpos, $ypos, $col2,
"/home/httpd/html/new/font/bluebold.ttf", "My Button");
ImagePNG($myimg, "myimg.png");
ImageDestroy($myimg);
?>
<img src="myimg.png" border=0>

-- 
Edit bug report at http://bugs.php.net/?id=16300&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16300&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16300&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16300&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16300&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16300&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16300&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16300&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16300&r=submittedtwice

Reply via email to