summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Pickering <Apickx@cogarr.org>2016-05-10 18:17:17 -0400
committerAlexander Pickering <Apickx@cogarr.org>2016-05-10 18:17:17 -0400
commit6e8180b01a152119cec2cd2f6a13bc72220d7942 (patch)
tree50751a0eb91387a147bc6a74ceb98950e7fa9092
parenta2af7959311436a7dbbec33796079d3cf3c2d8ed (diff)
parent2eaa3969ef07cd8c7036c22c05072bdba2001887 (diff)
downloadwebpage-6e8180b01a152119cec2cd2f6a13bc72220d7942.tar.gz
webpage-6e8180b01a152119cec2cd2f6a13bc72220d7942.tar.bz2
webpage-6e8180b01a152119cec2cd2f6a13bc72220d7942.zip
Merge branch 'development'
-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);
/*