summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ws2a/gencaptcha.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/ws2a/gencaptcha.c b/ws2a/gencaptcha.c
index de5729c..c21e6ef 100644
--- a/ws2a/gencaptcha.c
+++ b/ws2a/gencaptcha.c
@@ -76,41 +76,7 @@ int main(){
system(command);
sprintf(command,"convert \"/home/git/wswebpage/ws2a/captchas/%lu.png\" -virtual-pixel White -distort Arc %d \"/home/git/wswebpage/ws2a/captchas/%lu.png\"",rhash,arcdis,rhash);
system(command);
-
- FILE* imgfile;
- FILE* tofile;
- char filepath[100];
- char tofilepath[100];
- sprintf(filepath,"../ws2a/captchas/%lu.png",rhash);
- sprintf(tofilepath,"/home/git/wswebpage/ws2a/captchas/%lu.png",rhash);
- //printf("Filepath:%s",filepath);
- imgfile = fopen(filepath,"rb");
- tofile = fopen(tofilepath,"wb");
- if(imgfile == NULL){
- printf("Unable to open file!");
- return 1;
- }
- fseek(imgfile,0,SEEK_END);
- unsigned long filelen = ftell(imgfile);
- //printf("File length:%lu",filelen);
- fseek(imgfile,0,SEEK_SET);
- //fwrite(imgfile,1,filelen,stdout);
-
- char* buffer = malloc(filelen+1);
- if(buffer == NULL){
- printf("Memory error!");
- return 1;
- }
- fread(buffer, filelen, 1, imgfile);
- fclose(imgfile);
- //printf("%s%c%c\n","Content-Type:image/png",13,10);
- int i = 0;
- while(i < filelen){
- fprintf(tofile,"%c",buffer[i]);
- i++;
- }
- free(buffer);
- fclose(tofile);
+
printf("%s%c%c\n","Content-Type:text/html;charset=iso-8859-1",13,10);
printf("%lu",rhash);
/*