[PHP] Freetype and JPEG disabled
Hi All, I've tried to compile and install PHP with gd and freetype library enabled, and all PNG and GIF library are loaded. But somehow, JPEG and Freetype still not recognized. I installed Freetype 2.0. Anyone facing these problems before ??? How can I resolved these ? Regards, Feris
[PHP] FREETYPE and GD
Hello, I've created a simple script that takes in image and draws some lines and some text on top of it. I am having a problem with the text part of this. When the string that I am drawing on the image contains and apostrophe ( ' ) there is always a backslash ( \ ) before it. It make sense that it is the escape character, but I need to be able to show the apostrophe. Anyone have any ideas about this? ?php $backdir = /var/www/html/backgrounds/; $im = ImageCreatefromJPEG($backdir.$_GET['background']); $textcolor = imagecolorallocate($im, 255, 255, 255); $font = /var/www/html/fonts/arial.ttf; imagepolygon($im, array(36, 24, 36, 456, 684, 456, 684, 24), 4, $textcolor); imagepolygon($im, array(72, 48, 72, 432, 648, 432, 648, 48), 4, $textcolor); maketext($im, 30, 0, 360, 240, $textcolor, $font, $_GET['toparea']); Header(Content-type: image/jpeg); Imagejpeg($im); imagedestroy($im); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FREETYPE and GD
Aaron Todd wrote: I've created a simple script that takes in image and draws some lines and some text on top of it. I am having a problem with the text part of this. When the string that I am drawing on the image contains and apostrophe ( ' ) there is always a backslash ( \ ) before it. It make sense that it is the escape character, but I need to be able to show the apostrophe. Anyone have any ideas about this? ?php $backdir = /var/www/html/backgrounds/; $im = ImageCreatefromJPEG($backdir.$_GET['background']); Because you have Magic Quotes GPC on, all GET/POST/COOKIE data automatically has addslashes called on it, before you see it. That's good because you are probably usually putting your data into a MySQL database that needs that. In this case, though, you want to use http://php.net/stripslashes to undo the automated addslashes of Magic Quotes. Or, if your site mostly/only takes GET data and puts it on images, and rarely puts it into the database, go ahead and turn Magic Quotes GPC off in php.ini (or in your .htaccess) Note that you can't turn it off in your script with ini_set since the GPC data is already altered by the time your script starts. GD is not really directly involved, per se, in this issue. You'd have the same problem if you were putting your GET data into a file, or displaying it directly to the user, or pretty much doing anything at all with it *except* for stuffing it into MySQL. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FREETYPE and GD
BEAUTIFUL Thats exactly what I was looking for. I'm not doing anything with MySQL so I am going to leave Magic Quotes on and just use stripslashes() Thanks a bunch. Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Aaron Todd wrote: I've created a simple script that takes in image and draws some lines and some text on top of it. I am having a problem with the text part of this. When the string that I am drawing on the image contains and apostrophe ( ' ) there is always a backslash ( \ ) before it. It make sense that it is the escape character, but I need to be able to show the apostrophe. Anyone have any ideas about this? ?php $backdir = /var/www/html/backgrounds/; $im = ImageCreatefromJPEG($backdir.$_GET['background']); Because you have Magic Quotes GPC on, all GET/POST/COOKIE data automatically has addslashes called on it, before you see it. That's good because you are probably usually putting your data into a MySQL database that needs that. In this case, though, you want to use http://php.net/stripslashes to undo the automated addslashes of Magic Quotes. Or, if your site mostly/only takes GET data and puts it on images, and rarely puts it into the database, go ahead and turn Magic Quotes GPC off in php.ini (or in your .htaccess) Note that you can't turn it off in your script with ini_set since the GPC data is already altered by the time your script starts. GD is not really directly involved, per se, in this issue. You'd have the same problem if you were putting your GET data into a file, or displaying it directly to the user, or pretty much doing anything at all with it *except* for stuffing it into MySQL. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP+FreeType installation headaches
On Wednesday 26 November 2003 13:51, Daniel Hansen wrote: I am having a bear of a time getting FreeType compiled into PHP. I have successfully installed the RPM: [EMAIL PROTECTED] rpms]# rpm -U freetype-2.1.3-6.i386.rpm [EMAIL PROTECTED] php-4.3.1]# rpm -q freetype-2.1.3-6 freetype-2.1.3-6 I know I need the --with-freetype-dir=DIR argument in configure, and have tried: --with-freetype-dir --with-freetype-dir=/usr/lib/ --with-freetype-dir=/usr/lib With RHL you probably want: --with-freetype-dir=/usr However, recent versions of PHP has bundled both the gd freetype libs so you may want to use those to save yourself some headache. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* When the going gets tough, the tough get empirical. -- Jon Carroll */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP+FreeType installation headaches
Jason Wong wrote: With RHL you probably want: --with-freetype-dir=/usr I tried that -- no luck. But the libfreetype* files are in /usr/lib Someone else suggested installing the FT devel rpm (which I had not done earlier due to a download problem). I am trying that now. We'll see! Thanks. Dan However, recent versions of PHP has bundled both the gd freetype libs so you may want to use those to save yourself some headache. -- == For affordable custom Web solutions built on reliable, non-proprietary open-source technologies, Please visit http://www.anacys.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP+FreeType installation headaches
On Wednesday 26 November 2003 15:06, Daniel Hansen wrote: Jason Wong wrote: With RHL you probably want: --with-freetype-dir=/usr I tried that -- no luck. But the libfreetype* files are in /usr/lib Someone else suggested installing the FT devel rpm (which I had not done earlier due to a download problem). I am trying that now. We'll see! Yes you have to install *-devel*.rpm for whatever libs you want to compile into php. And yes, =/usr should work once you've installed the devel package. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Remember: Silly is a state of Mind, Stupid is a way of Life. -- Dave Butler */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP+FreeType installation headaches
Jason Wong wrote: On Wednesday 26 November 2003 15:06, Daniel Hansen wrote: Jason Wong wrote: With RHL you probably want: --with-freetype-dir=/usr I tried that -- no luck. But the libfreetype* files are in /usr/lib Someone else suggested installing the FT devel rpm (which I had not done earlier due to a download problem). I am trying that now. We'll see! Yes you have to install *-devel*.rpm for whatever libs you want to compile into php. And yes, =/usr should work once you've installed the devel package. Adding the devel package did the trick. And yes, you're right, --with-freetype-dir=/usr worked just fine. Thanks! Dan
[PHP] PHP+FreeType installation headaches
I am having a bear of a time getting FreeType compiled into PHP. I have successfully installed the RPM: [EMAIL PROTECTED] rpms]# rpm -U freetype-2.1.3-6.i386.rpm [EMAIL PROTECTED] php-4.3.1]# rpm -q freetype-2.1.3-6 freetype-2.1.3-6 I know I need the --with-freetype-dir=DIR argument in configure, and have tried: --with-freetype-dir --with-freetype-dir=/usr/lib/ --with-freetype-dir=/usr/lib running configure always results in an error -- messages ending in: checking for GD support... yes checking for the location of libjpeg... yes checking for the location of libpng... yes checking for the location of libXpm... yes checking for FreeType 1.x support... yes checking for FreeType 2... yes checking for T1lib support... yes checking whether to enable truetype string function in GD... yes checking for fabsf... (cached) yes checking for floorf... (cached) yes checking for jpeg_read_header in -ljpeg... (cached) yes checking for png_write_image in -lpng... (cached) yes checking for XpmFreeXpmImage in -lXpm... (cached) yes configure: error: freetype2 not found! ** my full command line is: ./configure --with-mysql --with-apxs2 --with-xpm-dir --with-png --with-png-dir --with-jpeg-dir --enable-exif --with-zlib-dir --with-gd --with-ttf --with-freetype --with-freetype-dir=/usr/lib Where am I going astray? (phpinfo follows) Dan Hansen PHP Version 4.3.1 System Linux nikto 2.4.18-14 #1 Wed Sep 4 11:57:57 EDT 2002 i586 Build Date Nov 25 2003 02:00:36 Configure Command './configure' '--with-mysql' '--with-apxs2' '--with-xpm-dir' '--with-png' '--with-png-dir' '--with-jpeg-dir' '--enable-exif' '--with-zlib-dir' '--with-gd' '--with-ttf' '--with-freetype' Server API Apache 2.0 Filter Virtual Directory Support disabled Configuration File (php.ini) Path /usr/local/lib/php.ini PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Debug Build no Thread Safety disabled Registered PHP Streams php, http, ftp, compress.zlib This program makes use of the Zend Scripting Language Engine: Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies PHP Credits Configuration PHP Core Directive Local Value Master Value allow_call_time_pass_reference On On allow_url_fopen On On always_populate_raw_post_data Off Off arg_separator.input arg_separator.output asp_tags Off Off auto_append_file no value no value auto_prepend_file no value no value browscap no value no value default_charset no value no value default_mimetype text/html text/html define_syslog_variables Off Off disable_functions no value no value display_errors On On display_startup_errors Off Off doc_root no value no value docref_ext no value no value docref_root http://www.php.net/ http://www.php.net/ enable_dl On On error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 2039 2039 expose_php On On extension_dir /usr/lib/php4 /usr/lib/php4 file_uploads On On gpc_order GPC GPC highlight.bg #FF #FF highlight.comment #FF9900 #FF9900 highlight.default #CC #CC highlight.html #00 #00 highlight.keyword #006600 #006600 highlight.string #CC #CC html_errors On On ignore_repeated_errors Off Off ignore_repeated_source Off Off ignore_user_abort Off Off implicit_flush Off Off include_path .:/php/includes:/usr/share/php .:/php/includes:/usr/share/php log_errors Off Off log_errors_max_len 1024 1024 magic_quotes_gpc On On magic_quotes_runtime Off Off magic_quotes_sybase Off Off max_execution_time 300 300 max_input_time -1 -1 open_basedir no value no value output_buffering no value no value output_handler no value no value post_max_size 8M 8M precision 14 14 register_argc_argv On On register_globals On On report_memleaks On On safe_mode Off Off safe_mode_exec_dir no value no value safe_mode_gid Off Off safe_mode_include_dir no value no value sendmail_from [EMAIL PROTECTED] [EMAIL PROTECTED] sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i short_open_tag On On SMTP localhost localhost smtp_port 25 25 sql.safe_mode Off Off track_errors Off Off unserialize_callback_func no value no value upload_max_filesize 2M 2M upload_tmp_dir /var/www/temp/upload /var/www/temp/upload user_dir no value no value variables_order EGPCS EGPCS xmlrpc_error_number 0 0 xmlrpc_errors Off Off y2k_compliance Off Off Apache 2.0 ctype ctype functions enabled exif EXIF Support enabled EXIF Version 1.4 $Id: exif.c,v 1.118.2.12 2002/12/23 08:43:13 sesser Exp $ Supported EXIF Version 0220 Supported filetypes JPEG,TIFF gd GD Support enabled GD Version bundled (2.0 compatible) GIF Read Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled imap IMAP Support enabled IMAP c-Client Version 2001
[PHP] freetype - could not open font problem
Hi there, I am trying to use freetype, but do always get the message Warning: Could not find/open font in test.php on line 18 The font is available and ok. I double checked it. What could cause this error exept of the given reason? I am trapped ;-) Thanx for any help on that. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] freetype - could not open font problem
From: andy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 24, 2002 7:29 AM Subject: [PHP] freetype - could not open font problem I am trying to use freetype, but do always get the message Warning: Could not find/open font in test.php on line 18 The font is available and ok. I double checked it. What could cause this error exept of the given reason? I am trapped ;-) Thanx for any help on that. Andy When I've done this, I put the ttfs in /usr/local/fonts/ttf Then I defined a const for the dir, define('FONTDIR','/usr/local/font/ttf/') And used concat to build the absolute path: $font = FONTDIR . 'arial.ttf'; You can uses file_exists() to make sure it's not a permissions problem -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] freetype - problems with true type and transprency
Hi there, I am trying to put text into an image. There are some problems where I do not find a solution for. The image is a jpg and stored on the filesystem. Now I would like to create a stamp in trutype font verdana with a name. Just the text on the image. I experianced following problems: o The text has a white background which covers the other image o It does not work with truetype. I tryed imagettftext but results in a broken image. Here is the code which should do the job, but does not: $label = imagecreate(200,50); $white = imagecolorallocate($label,255,255,255); $black = imagecolorallocate($label,0,0,0); Imagestring($label,1,0,0,'andy',$black); #Imagettftext($label, 30,0,10,33,$black,'verdana.ttf',$number); $photoImage = ImageCreateFromJPEG('card_city.jpg'); $pos_x = 5; $pos_y= 220; $label_w= 200; $label_h = 50; ImageCopy($photoImage, $label, $pos_x, $pos_y, 0, 0, $label_w, $label_h); header(Content-type: image/jpeg); imagejpeg($photoImage); Has anybody an idea how to solve this prob? Thanx in advance for any help. Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FreeType 2 support ?
Hi all, I'm getting this error while running a simple script. Warning: imageftbbox(): No FreeType 2 support in this PHP build in /home/www/htdocs/button_create.php on line 11 Here's my phpinfo https://utkalika.yi.org/phpinfo.php (note the https) While compiling PHP, It says freetype(2) support yes. FreeType 1.x no What might be the problem ? R'twick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FreeType 2 on windows?
How do I get FreeType 2 installed on my WIndowsXP box? Anyone know of web site with a tutorial? Thanks Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com
[PHP] freetype+gd+php not working
I have been trying to get FreeType working with PHP but have had no luck. In Apache's error log i'm getting: PHP Warning: libgd was not built with TrueType font support Here's the lines that are probably pertinent from my web server compilation script. Any suggestions on how to fix this would be greatly appreciated. FreeType 2.05 - make setup CFG=--prefix=/usr/local make make install GD 1.8.4 Changed lines in Makefile to: CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -lm -lfreetype INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 \ -I/usr/X11R6/include/X11 -I/usr/local/include \ -I/usr/local/src/jpeg-6b -I/usr/local/include/freetype2 # /usr/local/src/jpeg-6b is the source location for jpeg-6b. # /usr/include/freetype2 doesn't exist, but the script i use # for the installation doesn't remove it and since it doesn't # exist, no harm should be done. Same with the X11 directories. make make install PHP 4.0.6 - ./configure --with-apache=../apache_1.3.22 --with-openssl \ --with-imap=/usr/local/src/imap-2000c \ --with-pgsql=/usr/local/pgsql --with-mysql=/usr/local/mysql \ --with-dbase --with-ms-sql --with-sybase=/usr/local/freetds \ --with-config-file-path=/etc/httpd --enable-track-vars \ --disable-debug --enable-pic --enable-inline-optimization \ --enable-ftp --with-xml \ --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local \ --with-freetype-dir=/usr/local/freetype-2.0.5 --with-zlib \ --enable-gd-native-tt --with-freetype make make install Apache 1.3.22 - SSL_BASE=SYSTEM ./configure --prefix=/usr/local/apache \ --with-layout=RedHat --enable-module=most --enable-module=ssl \ --activate-module=src/modules/perl/libperl.a \ --activate-module=src/modules/php4/libphp4.a make make certificate TYPE=dummy make install Dan Ramaley Digital Media Library Specialist (515) 271-1934 Cowles Library 140, Drake University -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] gd php freetype problem solved
This is just a post to get in the archives. So if someone searches the archives for this they'll hopefully hit this one and their problems will be solved. I've battled this for two days..and have finally solved the problem. I figure that the should help someone who had problems similar to mine. when you configure php with gd keep in mind that you need to have libgd.a in /usr/lib. libgd.so won't do it! watch: ./configure --with-mysql=/usr/local/mysql --with-apache=/usr/src/apache_1.3.19 --enable-ftp --with-jpeg-dir=/usr/src/jpeg-6b --with-png-dir=/usr/src/libpng-1.0.9 --with-freetype-dir=/usr/src/freetype-2.0.1/ --with-gd=/usr/src/gd-2.0.1 --with-imap=/usr/src/imap-4.5 --enable-gd-native-ttf' --enable-calendar' you have to remember to do a make libgd.a in /usr/src/gd-2.0.1 (or where ever you untarrred gd) .a libs are for being statically linked with progs. .so libs are stand alone, dynamic libs. then everything works ok you learn something new every day :-) If anybody has questions i urge to ask me for a copy of the bash script that i used to compile php with apache. Mail me at [EMAIL PROTECTED] ~kurth Kurth Bemis Owner: Ozone Computer Owner/Senior Administrator: USAExpress.net LLC HomePage: http://kurth.hardcrypto.com Man kann niemanden zu seinem Glck zwingen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] freetype
i'm attempting to comiple in freetype2 into php4.0.4pl1. this is my configure line trinity:~/php-4.0.4pl1# ./configure --with-mysql=/usr/local/mysql/ --with-apache=../apache_1.3.19/ --enable-freetype-4bit-antialias-hack --with-ttf=/usr/local/lib/ --with-gd and this is what configure spits back at me.. checking whether to add fribidi support... no checking whether to enable FTP support... no checking whether to enable truetype string function in gd... no checking for libjpeg (needed by gd-1.8+)... no configure: warning: If configure fails try --with-jpeg-dir=DIR checking for libXpm (needed by gd-1.8+)... no configure: warning: If configure fails try --with-xpm-dir=DIR checking whether to include GD support... yes (static) checking for gdImageString16 in -lgd... (cached) yes checking for gdImagePaletteCopy in -lgd... (cached) yes checking for gdImageColorClosestHWB in -lgd... (cached) yes checking for compress in -lz... (cached) yes checking for png_info_init in -lpng... (cached) yes checking for gdImageColorResolve in -lgd... (cached) yes checking for gdImageCreateFromPng in -lgd... (cached) yes checking for gdImageCreateFromGif in -lgd... (cached) no checking for gdImageWBMP in -lgd... (cached) yes checking for gdImageCreateFromJpeg in -lgd... (cached) no checking for gdImageCreateFromXpm in -lgd... (cached) yes checking whether to include FreeType 1.x support... yes checking for T1lib support... no checking whether to include GNU gettext support... no yes gd and freetype2 are installedboth in /usr/local/lib ~kurth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] freetype info required
http://freetype.sourceforge.net/old_index.html Freetype is a freeware font engine. It works great for adding ttf to graphic images generated on the fly and such. Do you absolutely have to have ttf to create graphic images? No...but it sure makes things a lot prettier to look at. I think you will find most of the information you want through the link above. Dean -Original Message- From: Robert Vetter [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 12:04 PM To: [EMAIL PROTECTED] Subject: [PHP] freetype info required Could someone please supply me with a little information about freetype fonts concerning the following points of interest: 1/ A good description of what it actually is. 2/ How to actually use it in a practical sense hopefully in conjunction with php. 3/ Supply of some small code snippets showing real world examples. 4/ Any freetype library functions. I thank you all in advance for any help that you can grtant to me. Joe :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] freetype info required
Could someone please supply me with a little information about freetype fonts concerning the following points of interest: 1/ A good description of what it actually is. 2/ How to actually use it in a practical sense hopefully in conjunction with php. 3/ Supply of some small code snippets showing real world examples. 4/ Any freetype library functions. I thank you all in advance for any help that you can grtant to me. Joe :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]