From 70d4de3a57c004e6e6785e9bba189861e1437116 Mon Sep 17 00:00:00 2001 From: b Date: Sat, 24 May 2014 14:01:54 +0000 Subject: [PATCH] Online! git-svn-id: svn://botcastle1b/bluenh@2 276fc840-c973-4a23-809e-93696693fc29 --- bluenh.htm | 33 ++++++++++++++ bluenhd.cpp | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 6 ++- nh.png | Bin 0 -> 9252 bytes param.png | Bin 0 -> 989 bytes 5 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 bluenh.htm create mode 100644 bluenhd.cpp create mode 100644 nh.png create mode 100644 param.png diff --git a/bluenh.htm b/bluenh.htm new file mode 100644 index 0000000..3997431 --- /dev/null +++ b/bluenh.htm @@ -0,0 +1,33 @@ + + + + ENHANCE! • Bicycles on the Moon + + + + + 1190.bicyclesonthemoon.dnsd.info +

ENHANCE!

+
+ parameter explanation picture
+
+ a=, b=, c=,
+ d=, e=, f=.
+
+ + Enhance by URL
+ URL of image: + +
+
+ Enhance by file upload
+ Upload the image: + + +
+
+
+ Source code available at svn://bicyclesonthemoon.dnsd.info/bluenh (use "e" to login) or http://1190.bicyclesonthemoon.dnsd.info/pro/bluenh. + + + diff --git a/bluenhd.cpp b/bluenhd.cpp new file mode 100644 index 0000000..54ef528 --- /dev/null +++ b/bluenhd.cpp @@ -0,0 +1,124 @@ +// // //Download images and + // // ENHANCE them! + // // + // // Requires cgilib +// // //line 146 of cgi.h + // // must be changed + // // from "extern }" + // // to "}" +// // // + // // ~~bicyclesonthemoon + +#include +#include +#include +#include +#include +#include +#include + +#define WGET_PATH "/usr/bin/wget" +#define ENH_PATH "./bluenh" +#define RM_PATH "/bin/rm" +#define LOG_PATH "/eizm/log/bluenh/bluenh.log" +#define USERAGENT "Bluenhancement\x20(1190.bicyclesonthemoon.dnsd.info/bluenh/bluenh.htm)" +#define MSTD_PATH "/pro/bluenh/nh.png" + +int main (int argc, char *argv[]); +void mustard(int mustard); + +FILE *pix; +unsigned char buf[1024]; +char url[1024]; +char path[256]; +char method[256]; +s_cgi *cgi; +int t; +pid_t sub; +struct stat st; +unsigned long p; +unsigned short q; +char **up; +// unsigned char a,b,c,d,e,f; +// bool meg=false; + +int main (int argc, char *argv[]) +{ + cgi=cgiInit(); + + up=cgiGetFiles(cgi); + if (up) + { + sprintf(path,"%s",cgiGetFile(cgi,up[0])->tmpfile); + sprintf(url,"%s",cgiGetFile(cgi,up[0])->filename); + } + else + { + sprintf(url,"%s",(cgiGetValue(cgi,"inpix")!=NULL)?(cgiGetValue(cgi,"inpix")):""); + sprintf(path,"/var/tmp/%lu",(unsigned long)getpid()); + + //Why is there no spawnl() in linux? + sub=fork(); + if(sub==0) + { + t=execl(WGET_PATH,WGET_PATH,"-q","-t","2","-U",USERAGENT,"-O",path,url,(char *)0); + exit(t); + } + waitpid(sub,&t,0); + if(t)mustard(t); + } + + sub=fork(); + if(sub==0) + { + t=execl(ENH_PATH,ENH_PATH,path,path,cgiGetValue(cgi,"a")!=NULL?cgiGetValue(cgi,"a"):"0",cgiGetValue(cgi,"b")!=NULL?cgiGetValue(cgi,"b"):"127",cgiGetValue(cgi,"c")!=NULL?cgiGetValue(cgi,"c"):"255",cgiGetValue(cgi,"d")!=NULL?cgiGetValue(cgi,"d"):"0",cgiGetValue(cgi,"e")!=NULL?cgiGetValue(cgi,"e"):"127",cgiGetValue(cgi,"f")!=NULL?cgiGetValue(cgi,"f"):"255","q",(char *)0); + exit(t); + } + waitpid(sub,&t,0); + if(t)mustard(t); + + pix=fopen(path,"rb"); + if(pix==NULL) + mustard(123); + fstat(fileno(pix),&st); + p=st.st_size/1024; + q=st.st_size%1024; + + printf("Content-Length: %lu\n",(unsigned long)(st.st_size)); + printf("Content-type: image/png\n\n"); + for(unsigned long i=0;i$zj=tp{*^fVka5D0``TT9IV0wEQK zKuBb%NWmSEth8+KMdD?ksRF4QxQYcA$7rSCSCOswD)XkO_gXzRa!HSAszJ3$@km8^ND%_c(Mi!IgpsLE zPFQitT(hE&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HbDwd)D3-&aE AWB>pF literal 0 HcmV?d00001 diff --git a/param.png b/param.png new file mode 100644 index 0000000000000000000000000000000000000000..d71c0901162a6ba874dd763e7a1fee6f355da750 GIT binary patch literal 989 zcmV<310wv1P)Px#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy22e~?MF0Q*|NsA`*`M7200T)$L_t(&-tF4KYT`f`2XNg$y_Dt! zqsEM5Hw{&0fL4IvJvEPp$tMk7fK-{0F*!o zS<^u%M$iU9O9ZXhP=uf<8wwCKM39XjhYMv8@&S}WNN}M9LJ~kRf;MbuiJ%o5iV!qK zP=KHz8?q7P0O&V_d@l40LV^qZgpdT#cLe=lLthc}4M7701^*WfOXwM!o~d8zseX4Y zE~EPGiLi|7cl?@nG)h}{^l-6LM&mjZ3IH`FJzUzVph*pi9bmgF6aZ=h8)sPyK#2pO zg#b`b(kQb4l-K}T_yF2RqL7M2Ar*;2DiVcMBm(7;2$b3Y%FB{Kp#)G9K)V{C(XIw) z6bb+xA{kK;$%u+bMpQ&Hq9T$B9V400F_H-_1c3UIMp+9$c?}RKuK@z}B#jO=U`8jA z^ynm#9-TzeqSHuPbQ(#EP9teiC;?;vD769fc)=Oau?9@2DQWar0|r!%q(S9K8dQ!{ zk3O~l^uYnpdtpTRdaDwtg0SUU{-a~;3Ha`n6HO2Ve2c4F9lintogFk!@(r1ghawLd zjzXE&ZqF_#)IC2Zk?hW9b28HlL|J=wZj)2co?Y6v>uT8qY^5+K> zSnu@jbOo|(ZZf+h;xl+mPuLWR!cx^=ckU(}QLm6MyPqc7K%wMU=x?low> z-Kyc#!#;vW8Z?Gbr=upbcDQ^IXzeCb1&?Zj=Z^={3Ig>4Q?2&^&RG~6N4B>N00000 LNkvXXu0mjfl3kS5 literal 0 HcmV?d00001 -- 2.30.2