Commit 68bb4f61 authored by Arnab Nandi's avatar Arnab Nandi

added check for imagerotate, since many people don't seem to have it.

parent b5b6a1fa
......@@ -10,6 +10,7 @@ Notes
- Uses GD to draw stuff, emits in PNG
- Uses the _cron hook to clean up old image files - make sure you have the
drupal cron setup, or you'll have to manually reclaim diskspace.
- Now checks for imagerotate() function that some people don't seem to have. [Dec 12 2004]
Captcha Todo - arnabdotorg
- have to check for GD.
......@@ -85,10 +85,12 @@ function captcha_user($type, &$edit, &$user, $category = NULL) {
imageline($im, rand(0, 120), rand(0, 120), rand(0, 120), rand(0, 120), $foreground);
$im2 = imagerotate($im,rand(-20,45),$background);
$im = $im2;
//rotate only if function is defined (many PHP installations have this function missing)
if (function_exists('imagerotate')) {
$im2 = imagerotate($im,rand(-20,45),$background);
$im = $im2;
$middleground = imagecolorallocatealpha($im, rand(160, 200), rand(160, 200), rand(160, 200), 80);
//random shapes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment