1 #include "../include/bitmapvalidator.h"
\r
2 #include "../include/freenet/captcha/easybmp/EasyBMP.h"
\r
6 const bool BitmapValidator::Validate(const std::vector<unsigned char> &data)
\r
8 bool validated=false;
\r
9 std::ostringstream tempname;
\r
11 tempname << "validatebmp-" << rand() << ".tmp";
\r
12 FILE *outfile=fopen(tempname.str().c_str(),"w+b");
\r
15 fwrite(&data[0],1,data.size(),outfile);
\r
19 if(temp.ReadFromFile(tempname.str().c_str()))
\r
24 unlink(tempname.str().c_str());
\r