\r
#include <cmath>\r
#include <vector>\r
+#include <cstdlib>\r
\r
#ifdef ALTERNATE_CAPTCHA\r
\r
\r
void AlternateCaptcha2::Generate()\r
{\r
+ if(m_fonts.size()==0)\r
+ {\r
+ return;\r
+ }\r
+\r
std::string puzzlestring=GenerateRandomString(6);\r
std::vector<int> fontnums(puzzlestring.size(),0);\r
\r
for(int i=0; i<numlines; i++)\r
{\r
int x1=rand()%150;\r
- int y1=(rand()%100)+100;\r
+ int y1=(rand()%80)+110;\r
int x2=(rand()%150)+150;\r
- int y2=(rand()%100)+100;\r
+ int y2=(rand()%80)+110;\r
bigbmp.Line(x1,y1,x2,y2,white);\r
bigbmp.Line(x1+1,y1,x2+1,y2,white);\r
}\r
}\r
\r
// rotate the big bitmap back to (almost) horizontal\r
- bigbmp.Rotate(-lastrot+((rand()%10)-5),0,0,150,150);\r
+ bigbmp.Rotate(-lastrot+((rand()%20)-10),0,0,150,150);\r
\r
// grab the center of the big bitmap as the final bitmap\r
FreeImage::Bitmap bmp(110,50,32);\r