• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
captcha open font error

#1
there is a problem when add font_path value.
With out "font_path" Everything went fine i need to increase font size and add bold character.
So I had Arial Bold Font.
working config
PHP Code:
$vals = [
            'img_path' => './captcha/',
            'img_url' => base_url('captcha/'),
            'img_width' => 260,
            'img_height' => 45,
            'expiration' => 900,
            'word_length' => 6,
            'font_size' => 20,
            'img_id' => 'Imageid',
            'pool' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',

            // White background and border, black text and red grid
            'colors' => array(
                'background' => array(255255255),
                'border' => array(255255255),
                'text' => array(000),
                'grid' => array(2554040)
            )
        ]; 
Are Fine
when I Had
PHP Code:
$vals = [
            'img_path' => './captcha/',
            'img_url' => base_url('captcha/'),
            'font_path' => './dist/fonts/arialbd.ttf'// font line from server
            'img_width' => 260,
            'img_height' => 45,
            'expiration' => 900,
            'word_length' => 6,
            'font_size' => 20,
            'img_id' => 'Imageid',
            'pool' => 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',

            // White background and border, black text and red grid
            'colors' => array(
                'background' => array(255255255),
                'border' => array(255255255),
                'text' => array(000),
                'grid' => array(2554040)
            )
        ]; 
I got a error  that :
Severity: Warning
Message: imagettftext(): Could not find/open font
Filename: helpers/captcha_helper.php
Line Number: 272
Reply

#2
@hafijul233,

Are the permissions set correctly for the file to be opened?
Reply

#3
(04-24-2020, 10:11 AM)php_rocs Wrote: @hafijul233,

Are the permissions set correctly for the file to be opened?
Yes. when I add base_url() No Error.
Reply

#4
@hafijul233,

When the code is executed what does the system think that the path is?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.