Error In Imagettfbbox Function Captcha
(Read 7253 times) sellkony Newbie Posts: 10 Error in imagettfbbox function « on: December 20, 2010, 03:27:47 PM » Hello.I've got 3.5 version and does'n generate the confirm code for signup.Warning: imagettfbbox() [function.imagettfbbox]: Could not find/open font in /var/www/video/includes/captcha.php on line 53Error in imagettfbbox functionWhat can I check please Very tnx in advance !!! Logged frankie Administrator Hero Member Posts: 7052 PHPmotion Developer Re: Error in imagettfbbox function « Reply #1 on: December 20, 2010, 03:49:31 PM » open captcha.php and changevar $font = 'DoradoHeadline.ttf';to var $font = './DoradoHeadline.ttf';see if that does it..... Logged sellkony Newbie Posts: 10 Re: Error in imagettfbbox function « Reply #2 on: December 20, 2010, 04:22:33 PM » YEAHHHH !!!You are N.1Very thankyou !!!! Logged Print Pages: [1] « previous next » PHPMotion » PHPmotion v3 and v 3.5 Support » General Support » Error in imagettfbbox function SMF 2.0.1 | SMF © 2011, Simple MachinesSMFAds for Free Forums XHTML RSS WAP2
Ubuntu 8.04 Desktop ivikasAugust 30th, 2008, 08:34 AMHello all, I have an ubuntu 8.04 desktop and i have a lamp on it.Iam using php5 and now i have to use CAPTCHA for my local web development.I searched and found that for using CAPTCHA i need to install php5-gd.Is this library neccessary for all image uploading,image gallary creation?? I installed php5-gd but still CAPTCHA is not working.During installation of php5-gd one package was set to remove,this is http://phpmotion.com/forum/index.php?topic=19913.0 as below ----------------------------------------------------------------------- Reading package lists... Done Building dependency tree http://ubuntuforums.org/images/smilies/guitar.gif Reading state information... Done The following packages were automatically installed and are no longer required: libglib1.2ldbl libgtk1.2 libsoup2.2-8 xulrunner-1.9-dom-inspector devhelp-common python-libgmail libzvbi-common libgbf-1-common libgtk1.2-common python-fuse Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libgd2-xpm libt1-5 Suggested packages: libgd-tools The following packages https://ubuntuforums.org/archive/index.php/t-905187.html will be REMOVED: libgd2-noxpm The following NEW packages will be installed: libgd2-xpm libt1-5 php5-gd 0 upgraded, 3 newly installed, 1 to remove and 248 not upgraded. Need to get 491kB of archives. After this operation, 512kB of additional disk space will be used. Do you want to continue [Y/n]? y --------------------------------------------------------------------- Is there any problem with this removal I first stopped apache2 webserver,then installed php5-gd with apt-get install php5-gd After this i have even restarted apache2 and cleared firefox cache and reloaded my php page containing CAPTCHA. I also checked the phpinfo(); The output of phpinfo(); --------------------------------------------------------------------- GD Support enabled GD Version 2.0 or higher FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.3.5 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled ----------------------------------------------------------------------- It says GD is enabled.But still my CAPTCHA is nor working...Can anyone give a fix. Thanks in advance:guitar: gmxgeekAugust 30th, 2008, 08:40 AMcan you go to the actual CAPTCHA script itself in
and get tips & solutions from a community of 418,513 IT Pros https://bytes.com/topic/php/answers/738312-error-function-imagettfbbox & Developers. It's quick & easy. Error in function imagettfbbox() 100+ P: 431 eragon Im trying to put a captcha image in my site to stop people from spamming, and when i view the image its self i get this: Fatal error: Call to undefined function imagettfbbox() in (...)/htdocs/CaptchaSecurityImages.php on line 39 error in so heres my code: [php] generateCode($characters); /* font size will be 75% of the image height */ $font_size = $height * 0.75; $image = @imagecreate($width, $height) or die('Cannot initialize new GD image stream'); /* set the colours */ $background_color = imagecolorallocate($image, 255, 255, 255); $text_color = imagecolorallocate($image, 20, 40, 100); $noise_color = imagecolorallocate($image, 100, 120, 180); /* generate random dots in background */ for( $i=0; $i<($width*$height)/3; $i++ ) { imagefilledellipse($image, mt_rand(0,$width), mt_rand(0,$height), 1, 1, $noise_color); } /* generate random lines in background */ for( $i=0; $i<($width*$height)/150; $i++ ) { imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), $noise_color); } /* create textbox and add text */ $textbox = imagettfbbox($font_size, 0, $this->font, $code) or die('Error in imagettfbbox function'); $x = ($width - $textbox[4])/2; $y = ($height - $textbox[5])/2; imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function'); /* output captcha image to browser */ header('Content-Type: image/jpeg'); imagejpeg($image); imagedestroy($image); $_SESSION['secur