|
@@ -6,7 +6,7 @@
|
|
|
$_SESSION['captcha'] = $captcha;
|
|
|
//Set the image width and height
|
|
|
$width = 165;
|
|
|
- $height = 20;
|
|
|
+ $height = 50;
|
|
|
//Create the image resource
|
|
|
$image = ImageCreate($width, $height);
|
|
|
//We are making three colors, white, black and gray
|
|
@@ -16,11 +16,11 @@
|
|
|
//Make the background black
|
|
|
ImageFill($image, 0, 0, $black);
|
|
|
//Add randomly generated string in white to the image
|
|
|
- ImageString($image, 3, 30, 3, $captcha, $white);
|
|
|
+ imagettftext($image,13,-7,5,20,$white,realpath(dirname(__FILE__)).'/../css/fonts/FiraMono/FiraMono-Bold.ttf',$captcha);
|
|
|
//Throw in some lines to make it a little bit harder for any bots to break
|
|
|
ImageRectangle($image,0,0,$width-1,$height-1,$grey);
|
|
|
- imageline($image, 0, $height/2, $width, $height/2, $grey);
|
|
|
- imageline($image, $width/2, 0, $width/2, $height, $grey);
|
|
|
+ imageline($image,0,0,$width,$height,$grey);
|
|
|
+ imageline($image,$width,0,0,$height,$grey);
|
|
|
//Tell the browser what kind of file is come in
|
|
|
header("Content-Type: image/jpeg");
|
|
|
//Output the newly created image in jpeg format
|