problem with ImageFontWidth method,

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
legolas.w
Forum Newbie
Posts: 1
Joined: Thu Feb 07, 2008 5:29 am

problem with ImageFontWidth method,

Post by legolas.w »

Hi
Thank you for reading my post
I am trying to install a php application and it return an error like:

Code: Select all

Fatal error: Call to undefined function ImageFontWidth() in /var/www/triner/includes/functions.php on line 28
the line 25 to 30 looks like:

Code: Select all

 
    ## 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
 
 
 

Can some one please let me know what is the problem?

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: problem with ImageFontWidth method,

Post by Christopher »

You probably don't have the Image extension installed. Check phpinfo() and the manual:

http://us2.php.net/manual/en/ref.image.php
(#10850)
Post Reply