ID:               16300
 Updated by:       [EMAIL PROTECTED]
-Summary:          PNG generation w/ TTF Font loading works from cmd line
                   but fails from http
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         GD related
 Operating System: Linux-Mandrake 8.2
 PHP Version:      4.1.2
 New Comment:

>From HTTP this test process segfaults every time under mod_php4.
Succeeds in running test only on command line.

Also, running Zend optimizer 1.2.0.


Previous Comments:
------------------------------------------------------------------------

[2002-03-26 23:21:15] [EMAIL PROTECTED]

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 this bug report at http://bugs.php.net/?id=16300&edit=1

Reply via email to