PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Sep 21, 2018 9:47 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: GD-lib
PostPosted: Wed Jul 21, 2004 3:18 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
Hi,
I just found out about gd-lib. Where can you get it and how do I install it??

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:19 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
did you try looking on php.net? http://www.php.net/gd


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:22 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
I got to the GD website, but I'm not very good at this.
I already have PHP installed, so what should I download?
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:24 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
you may already have it installed, just need to turn it on.. look through your php.ini and you install's extensions folder.. enable it in php.ini and make sure it's in the extensions folder.. restart apache..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:29 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
hmm. When i look through the PHP.ini for GD, I only find ";extension=php_gd2.dll"
I had PHP installed by an executable that bundled Apache, PHP, MySQL, and PHPmyAdmin, and it has no information if it installed Gd-lib with it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:32 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
remove the ; in front of it.. and try restarting apache..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:37 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
Thanks. I'm pretty sure it works now, since it doesn't say "undefined function"
But i'm using some sample script that I got from a person's website just to learn off of.

Syntax: [ Download ] [ Hide ]
<?PHP
$image = imagecreatefrompng("FLASH.png");
$font_size = 14;
$color = imagecolorallocate($image, 255,255,255);
$black = imagecolorallocate($image, 0,0,0);
ImageTTFText ($image, $font_size, 0, 56, 36, $black, "../fonts/ARIALBD.TTF","Test Text");
ImageTTFText ($image, $font_size, 0, 55, 35, $color, "../fonts/ARIALBD.TTF","Test Text");
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
?>


It produces garbled up text. Is it something wrong with the script or the server??

EDIT:
I think its because i need the Fonts in my www root folder.

Thanks Alot!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:45 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
first things first, FLASH.png exists? "../fonts/ARIALBD.TTF" exists?

try moving ARIALBD.TTF to the scripts directory, lose the FLASH.png reference, and use [php_man]imagecreatetruecolor[/php_man]() to create a temporary one..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 3:47 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
Yeah, it was because i needed the font in my root folder.
Thanks a lot! You saved me a lot of time trying to figure out these install guides!

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 4:19 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
Whenever I use ImageCreate() it produces garbled text. I got an example from the PHP site and it didn't work. If its an old version of GD, if i need to update it, do I only have to change the Gd2.dll?
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 4:52 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
you have a newer version of GD, so you'll want to use imagecreatetruecolor() instead of imagecreate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 8:30 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
When I try either one, even when they're just by themselves, it produces a garbled text.
hmmmm..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 8:48 pm 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
I don't think by default the created image is cleared or filled with any color, you have to fill it.. otherwise, yes, it will have random data from memory (probably) stored.. unless it's a fully secure OS..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 10:50 pm 
Offline
Forum Commoner

Joined: Sun Jun 13, 2004 6:51 pm
Posts: 31
Oh. I got it

It was a dumb mistake. I had some HTML after the code so it screwed things up.
Thanks for all the time you spend helping people like me! I wish I could repay you....
If you ever need any graphic work... :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group