Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76527 - mod_php 5.0.3 gd freetype no support
Summary: mod_php 5.0.3 gd freetype no support
Status: VERIFIED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 60438
  Show dependency tree
 
Reported: 2005-01-03 08:57 UTC by Romang
Modified: 2009-01-06 00:47 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Mod_PHP 5.0.3 config.log file (config.log,113.06 KB, application/octet-stream)
2005-01-10 00:33 UTC, Romang
Details
Emerge mod_php build log (emerge-mod_php.log,413.54 KB, application/octet-stream)
2005-01-10 00:34 UTC, Romang
Details
4020-freetype-2.1.9-r1.log (4020-freetype-2.1.9-r1.log,81.55 KB, text/plain)
2005-04-27 13:31 UTC, Jon Todaro
Details
4021-gd-2.0.32.log (4021-gd-2.0.32.log,56.27 KB, text/plain)
2005-04-27 13:32 UTC, Jon Todaro
Details
4022-php-5.0.3-r1.log (4022-php-5.0.3-r1.log,428.21 KB, text/plain)
2005-04-27 13:33 UTC, Jon Todaro
Details
4023-mod_php-5.0.3-r2.log (4023-mod_php-5.0.3-r2.log,453.78 KB, text/plain)
2005-04-27 13:33 UTC, Jon Todaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Romang 2005-01-03 08:57:36 UTC
Hello,

I try to compile mod_php with freetype support in gd.

I have gd support with truetype ->

[ebuild   R   ] media-libs/gd-2.0.32  -X +jpeg +png +truetype

** Configuration summary for gd 2.0.32:

   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for Freetype 2.x library: yes
   Support for Fontconfig library:   no
   Support for Xpm library:          no
   Support for pthreads:             yes

I have mod_php with :

[ebuild   R   ] dev-php/mod_php-5.0.3  -adabas +apache2 +bcmath -berkdb -birdstep -bzlib +calendar -cdb -cpdflib +crypt +ctype +curl -curlwrappers -db2 +dba -dbase -dbm -dbmaker -dbx -debug +dio -empress -empress-bcs -esoob -exif -fam -fdftk +filepro -flatfile -frontbase +ftp +gd +gd-external +gdbm -gmp -hyperwave-api +iconv +imap -informix -ingres -inifile -interbase -iodbc +jpeg -kerberos -ldap -libedit -mcve +memlimit +mhash +mime -ming -mnogosearch -msession -msql -mssql +mysql -mysqli +ncurses -nis +nls -oci8 -odbc -oracle7 -ovrimos +pcntl -pcre -pfpro +png -posix -postgres -qdbm +readline -recode -sapdb -sasl +session -shared -sharedmem +simplexml +snmp +soap +sockets -solid +spell -spl -sqlite +ssl -sybase -sybase-ct +sysvipc -tidy +tiff -tokenizer +truetype -wddx +xml2 -xmlrpc -xpm -xsl +zlib

But on my phpinfo.php GD has no support off freetype.

Any idea ?

Regards.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-01-04 20:28:06 UTC
rebuild php and attach the config.log and full log output from portage building php.
Comment 2 Romang 2005-01-10 00:33:56 UTC
Created attachment 48079 [details]
Mod_PHP 5.0.3 config.log file
Comment 3 Romang 2005-01-10 00:34:26 UTC
Created attachment 48080 [details]
Emerge mod_php build log
Comment 4 Romang 2005-01-10 00:34:58 UTC
Hello,

You can find attached the logs you ask me.

Regards.
Comment 5 Stuart Herbert (RETIRED) gentoo-dev 2005-01-18 11:30:44 UTC
Hi,

Please leave the status field alone in future.  Changing it does not help us to help you any quicker.

Thank you for your understanding,
Stu
Comment 6 Jon Todaro 2005-04-27 13:12:09 UTC










I am having the same problem with 5.0.3-r2. I have the following USE variables in my /etc/make.conf so I am sure I do not have a problem there.
SE="ipv6 -alsa activefilter apache2 -berkdb bzlib calendar cups curl curlwrappers -dba -doc -esd exif exiscan-acl flash freetype ftp gd gd-external -gdbm gif -gnome gnutls -hardened hardenedphp imap imlib j2ee java javacomm javascript jce jcs jdk jpeg justify -gtk -gtk2 -kde ldap libwww maildir -mbox milter mime ming mmx mozilla mpeg mysql nis noaudio nomac pam pear perl pdflib php png python -qt ruby ruby18 samba -sdl session simplexml shared sharedext smtp snmp soap spl ssl -svga t1lib tcpd -tcltk tidy tiff tokenizer truetype vhosts X xinerama xml xml2 xmlrpc -xmms xpm xsl zlib"
I will attach my /var/log/portage logs for freetype gd php & mod_php as well.
Comment 7 Jon Todaro 2005-04-27 13:31:03 UTC
Created attachment 57429 [details]
4020-freetype-2.1.9-r1.log
Comment 8 Jon Todaro 2005-04-27 13:32:23 UTC
Created attachment 57430 [details]
4021-gd-2.0.32.log
Comment 9 Jon Todaro 2005-04-27 13:33:07 UTC
Created attachment 57431 [details]
4022-php-5.0.3-r1.log
Comment 10 Jon Todaro 2005-04-27 13:33:52 UTC
Created attachment 57432 [details]
4023-mod_php-5.0.3-r2.log
Comment 11 Jon Todaro 2005-04-27 13:41:21 UTC
Error from apache2/error_log that made me search for the gd/truetype/freetype/php/mod_php error in the first place.

[client 192.168.1.55] PHP Fatal error:  Call to undefined function ImageTTFText() in watermark.php on line 62, referer: http://tl.bone.ath.cx


PHP file that produced that error is as follows:

*[root@bordergw:~] cat watermark.php
<?php

function watermark($img,$text="[date]",$datfmt="Y-m-d",$font="ARIAL.TTF",$font_size=12,$rgbtext="FFFFFF",$rgbtsdw="000000",$hotspot=8,$txp=0,$typ=0,$sxp=1,$syp=1) {

$suffx=substr($img,strlen($img)-4,4);
if ($suffx==".jpg" || $suffx=="jpeg" || $suffx==".png") {
$text=str_replace("[date]",date($datfmt),$text);

if ($suffx==".jpg" || $suffx=="jpeg") {
$image=imagecreatefromjpeg($img);
}
if ($suffx==".png") {
$image=imagecreatefrompng($img);
}

$rgbtext=HexDec($rgbtext);
$txtr=floor($rgbtext/pow(256,2));
$txtg=floor(($rgbtext%pow(256,2))/pow(256,1));
$txtb=floor((($rgbtext%pow(256,2))%pow(256,1))/pow(256,0));

$rgbtsdw=HexDec($rgbtsdw);
$tsdr=floor($rgbtsdw/pow(256,2));
$tsdg=floor(($rgbtsdw%pow(256,2))/pow(256,1));
$tsdb=floor((($rgbtsdw%pow(256,2))%pow(256,1))/pow(256,0));

$coltext = imagecolorallocate($image,$txtr,$txtg,$txtb);
$coltsdw = imagecolorallocate($image,$tsdr,$tsdg,$tsdb);

if ($hotspot!=0) {
$ix=imagesx($image); $iy=imagesy($image); $tsw=strlen($text)*$font_size/imagefontwidth($font)*3; $tsh=$font_size/imagefontheight($font);
switch ($hotspot) {
case 1:
$txp=$txp; $typ=$tsh*$tsh+imagefontheight($font)*2+$typ;
break;
case 2:
$txp=floor(($ix-$tsw)/2); $typ=$tsh*$tsh+imagefontheight($font)*2+$typ;
break;
case 3:
$txp=$ix-$tsw-$txp; $typ=$tsh*$tsh+imagefontheight($font)*2+$typ;
break;
case 4:
$txp=$txp; $typ=floor(($iy-$tsh)/2);
break;
case 5:
$txp=floor(($ix-$tsw)/2); $typ=floor(($iy-$tsh)/2);
break;
case 6:
$txp=$ix-$tsw-$txp; $typ=floor(($iy-$tsh)/2);
break;
case 7:
$txp=$txp; $typ=$iy-$tsh-$typ;
break;
case 8:
$txp=floor(($ix-$tsw)/2); $typ=$iy-$tsh-$typ;
break;
case 9:
$txp=$ix-$tsw-$txp; $typ=$iy-$tsh-$typ;
break;
}
}

ImageTTFText($image,$font_size,0,$txp+$sxp,$typ+$syp,$coltsdw,$font,$text);
ImageTTFText($image,$font_size,0,$txp,$typ,$coltext,$font,$text);

if ($suffx==".jpg" || $suffx=="jpeg") {
header("Content-type: image/jpg");
imagejpeg($image);
}
if ($suffx==".png") {
header("Content-type: image/png");
imagepng($image);
}

imagedestroy($image);

}
}

if (isset($wmimg)) {
if (!isset($wmtext)) {$wmtext="[date]";}
if (!isset($wmdatfmt)) {$wmdatfmt="Y-m-d";}
if (!isset($wmfont)) {$wmfont="ARIAL.TTF";}
if (!isset($wmfont_size)) {$wmfont_size=12;}
if (!isset($wmrgbtext)) {$wmrgbtext="FFFFFF";}
if (!isset($wmrgbtsdw)) {$wmrgbtsdw="000000";}
if (!isset($wmhotspot)) {$wmhotspot=8;}
if (!isset($wmtxp)) {$wmtxp=0;}
if (!isset($wmtyp)) {$wmtyp=0;}
if (!isset($wmsxp)) {$wmsxp=1;}
if (!isset($wmsyp)) {$wmsyp=1;}

watermark($wmimg,$wmtext,$wmdatfmt,$wmfont,$wmfont_size,$wmrgbtext,$wmrgbtsdw,$wmhotspot,$wmtxp,$wmtyp,$wmsxp,$wmsyp);
}

?>

This script creates a dynamic watermark across an image.


Comment 12 Stuart Herbert (RETIRED) gentoo-dev 2005-08-24 23:51:58 UTC
Hi,

Could you please retest this against the new dev-lang/php package, available in
the Gentoo PHP Overlay [1]?

[1] http://svn.gnqs.org/projects/gentoo-php-overlay/

Many thanks,
Stu
Comment 13 Jakub Moc (RETIRED) gentoo-dev 2005-09-06 01:29:04 UTC
User response needed here. Please, see comment #12 and report back.
Comment 14 Oleg Gawriloff 2008-11-19 11:12:14 UTC
All works perfectly with latest dev-lang/php-5.2.6-r7.
USE flags:
dev-lang/php* -* apache2 -threads bcmath ctype curl ftp freetype gd hash iconv ldap memlimit mysql mysqli pcre pdo pdo-external posix postgres session simplexml sqlite ssl tokenizer truetype xml xmlreader xmlrpc xmlwriter zlib unicode
With gd 2.0.35 installed:
media-libs/gd -* jpeg png truetype
With freetype 2.3.7 installed.