# HG changeset patch # User Dan # Date 1212856829 14400 # Node ID fd082123f2f493a6b192cf14467a151691211d6c # Parent 26479224936a1b3e7cc91b4b191480375b11c6c4 Fixed some GD detection bugs with freecap diff -r 26479224936a -r fd082123f2f4 includes/captcha.php --- a/includes/captcha.php Sat Jun 07 12:39:24 2008 -0400 +++ b/includes/captcha.php Sat Jun 07 12:40:29 2008 -0400 @@ -166,10 +166,10 @@ $engine = getConfig('captcha_engine'); if ( !$engine ) { - $engine = 'bc'; + $engine = 'freecap'; } } - if( !extension_loaded("gd") || !function_exists("gd_info") || !function_exists('imagettftext') ) + if( !extension_loaded("gd") || !function_exists("gd_info") || !function_exists('imagettftext') || !function_exists('imagepng') || !function_exists('imagecreatefromjpeg') ) { $engine = 'failsafe'; } diff -r 26479224936a -r fd082123f2f4 includes/captcha/engine_freecap.php --- a/includes/captcha/engine_freecap.php Sat Jun 07 12:39:24 2008 -0400 +++ b/includes/captcha/engine_freecap.php Sat Jun 07 12:40:29 2008 -0400 @@ -388,7 +388,7 @@ ImageFill($this->im3,0,0,$bg3); $temp_bg_col = ImageColorAllocate($temp_bg,255,255,255); ImageFill($temp_bg,0,0,$temp_bg_col); - + // we draw all noise onto temp_bg // then if we're morphing, merge from temp_bg to im3 // or if not, just copy a $widthx$height portion of $temp_bg to $this->im3 @@ -459,7 +459,7 @@ $temp_width[$i] = imagesx($temp_im[$i]); $temp_height[$i] = imagesy($temp_im[$i]); } - + $blocksize = $this->rand_func(20,60); for($i=0 ; $i<$width*2 ; $i+=$blocksize) {