Gregwar / Captcha

PHP Captcha library
MIT License
1.73k stars 290 forks source link

once I use directly the wanted phrase to the builder, the inline() function can't be used ? #67

Open llxcyzgh opened 5 years ago

llxcyzgh commented 5 years ago
 $captcha = new CaptchaBuilder('12345');           
 var_dump($captcha->getPhrase()); // 12345           
 var_dump($captcha->inline());exit; // error: imagejpeg() expects parameter 1 to be resource, null given
llxcyzgh commented 5 years ago

well, it's solved.

I need to add one line code after newing a CaptchaBuilder, just like:

$captcha = new CaptchaBuilder('12345');
$captcha = $captcha->build();// use GD to generate a picture
var_dump($captcha->getPhrase()); // 12345
var_dump($captcha->inline()); // data:image/jpeg;base64,....