Re: problem with imagefontwidth function, It looks to be unavailable...
| From: | Richard Lynch | Date: | Fri, 08 Feb 2008 18:47:12 +0000 |
| Subject: | Re: problem with imagefontwidth function, It looks to be unavailable... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268965@lists.php.net to get a copy of this message | ||
You probably do not have GD installed...
Does <?php phpinfo();?> list "GD" as one of your extensions?
If not, install it.
On Thu, February 7, 2008 6:57 am, Legolas wood wrote:
> Hi
> Thank you for reading my post
> I am trying to run a php based application using php5 and apache.
> but I receive an error like:
>
>
> *Fatal error*: Call to undefined function imagefontwidth() in
> */var/www/v603/includes/functions.php* on line *28*
>
>
> when line 28 and its surrounding lines are:
>
> ## create an image not a text for the pin
>
> $font = 6;
>
> $width = imagefontwidth($font) * strlen($generated_pin);
>
> $height = ImageFontHeight($font);
>
>
>
> $im = @imagecreate ($width,$height);
>
> $background_color = imagecolorallocate ($im, 219, 239, 249);
> //cell background
>
> $text_color = imagecolorallocate ($im, 0, 0,0);//text color
>
> imagestring ($im, $font, 0, 0, $generated_pin, $text_color);
>
> touch($image_url . 'uplimg/site_pin_' . $full_pin . '.jpg');
>
> imagejpeg($im, $image_url . 'uplimg/site_pin_' . $full_pin .
> '.jpg');
>
>
>
> $image_output = '<img src="' . $image_url . 'uplimg/site_pin_'
> .
> $full_pin . '.jpg">';
>
>
>
> imagedestroy($im);
>
>
>
> return $image_output;
>
>
>
> Can you tell me what is wrong with this code and how I can resolve the
> problem.
>
> Thanks
>
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?