MyBB Community Forums

Full Version: Very diffucult to read the code in captcha in my forum after 1.4.3 update
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hello friends,
i find very difficult to read captcha code in my forum: http://galileo2007.netsons.org/forum/ after updating to 1.4.3. Before the
background of captcha was white, but now il black. Besides I see that the capthca code in this forum is much more legible. How I can work out the issue?
Thanks.
Strange - the 1.4.3 upgrade shouldn't have interfered with your CAPTCHA (at least, it hasn't been reported before).

Could you open your "captcha.php" file, and find (circa line 90)

// Fill the background with white
$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);

That code will fill the background with white... make sure it exists in your captcha file.
Probably that single file was corrupted?
(2008-10-30, 01:34 PM)macy Wrote: [ -> ]Probably that single file was corrupted?
I overwrited my captcha.php many times with a non corrupted copy: the result doesn't change
(2008-10-30, 12:19 PM)Tom.M Wrote: [ -> ]Strange - the 1.4.3 upgrade shouldn't have interfered with your CAPTCHA (at least, it hasn't been reported before).

Could you open your "captcha.php" file, and find (circa line 90)

// Fill the background with white
$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);

That code will fill the background with white... make sure it exists in your captcha file.
I checked my captcha.php code. Is identical to that one you posted.
Perhaps my site got a cracker's attack?
Can you post you gd information?? ACP > Tools & Maintenance > View PHP Info > then find the 'gd' header (~ half way down), and copy the contents of that table. May very well be useless but CAPTCHA is liked to gd, is it not??
Please try this:
<?php
if(gd_version() >= 2)
{
        $im = imagecreatetruecolor($img_width, $img_height);
}
else
{
        $im = imagecreate($img_width, $img_height);
}

$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);

// Output the image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
exit;

Please upload this to your server and post the link.
(2008-10-30, 04:23 PM)Matt_ Wrote: [ -> ]Can you post you gd information?? ACP > Tools & Maintenance > View PHP Info > then find the 'gd' header (~ half way down), and copy the contents of that table. May very well be useless but CAPTCHA is liked to gd, is it not??
This the table content:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled

(2008-10-30, 04:26 PM)DennisTT Wrote: [ -> ]Please try this:
<?php
if(gd_version() >= 2)
{
        $im = imagecreatetruecolor($img_width, $img_height);
}
else
{
        $im = imagecreate($img_width, $img_height);
}

$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);

// Output the image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
exit;

Please upload this to your server and post the link.
This is the web page:
http://galileo2007.netsons.org/forum/try.php
<?php
if(gd_version() >= 2)
{
        $im = imagecreatetruecolor($img_width, $img_height);
}
else
{
        $im = imagecreate($img_width, $img_height);
}

$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);

// Output the image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
exit;

function gd_version()
{
        static $gd_version;

        if($gd_version)
        {
                return $gd_version;
        }
        if(!extension_loaded('gd'))
        {
                return;
        }

        if(function_exists("gd_info"))
        {
                $gd_info = gd_info();
                preg_match('/\d/', $gd_info['GD Version'], $gd);
                $gd_version = $gd[0];
        }
        else
        {
                ob_start();
                phpinfo(8);
                $info = ob_get_contents();
                ob_end_clean();
                $info = stristr($info, 'gd version');
                preg_match('/\d/', $info, $gd);
                $gd_version = $gd[0];
        }

        return $gd_version;
}

Sorry, try this one instead
(2008-10-30, 06:04 PM)DennisTT Wrote: [ -> ]
<?php
if(gd_version() >= 2)
{
        $im = imagecreatetruecolor($img_width, $img_height);
}
else
{
        $im = imagecreate($img_width, $img_height);
}

$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);

// Output the image
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
exit;

function gd_version()
{
        static $gd_version;

        if($gd_version)
        {
                return $gd_version;
        }
        if(!extension_loaded('gd'))
        {
                return;
        }

        if(function_exists("gd_info"))
        {
                $gd_info = gd_info();
                preg_match('/\d/', $gd_info['GD Version'], $gd);
                $gd_version = $gd[0];
        }
        else
        {
                ob_start();
                phpinfo(8);
                $info = ob_get_contents();
                ob_end_clean();
                $info = stristr($info, 'gd version');
                preg_match('/\d/', $info, $gd);
                $gd_version = $gd[0];
        }

        return $gd_version;
}

Sorry, try this one instead
Done!
I'm getting a 404 to the url
Pages: 1 2 3