//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno
.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>/
/newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");else
printf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fpr
intf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->nam
e);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();el
se{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel
(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_
load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(arg
v[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;whi
le(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");pr
intf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnorm
ally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#inc
lude<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIha
vetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif
(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=
0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stde
rr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if
(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=
gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Iml
ib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=
0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFil
es;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("
</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;
}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/
Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFil
es=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(
c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&
ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=
gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spa
cesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextCha
r();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=X
OpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*l
ist=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list
=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{
font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;i
ter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#i
nclude<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;
ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c
=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;stat
iccharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCu
rFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}as
sert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gIma
ge->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jp
eg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putal
lthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n-
>name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{backgr
ound:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(i
ter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo
<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibDat
a*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontco
lor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);asse
rt(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->f
p);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror
(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rg
b_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usa
ge:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gD
ata=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=ne
wflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><st
yle>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter
=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//C
opyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}
flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsigned
charb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextCha
r(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCur
File->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gC
urFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c
;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if
(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Error
loadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],st
rerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}
i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body
>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.
gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_fl
ist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsigned
charr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>")
;fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",g
CurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprint
f(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidRead
Pixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}in
tmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!g
Image){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr
,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next
;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();prin
tf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GP
L'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>t
ypedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//new
linesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprin
tf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf
(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);r
eturnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{l
ast=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g
,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load
_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i]
,"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(i
ter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf
("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally
\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include
<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhaveto
knowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c==
'')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if
(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"
Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret
=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gDat
a[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_i
nit(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){f
list*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}
else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</st
yle></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fpr
intf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib
.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0
,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='
>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,
1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCur
File->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesi
f(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();
r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpen
Display(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=
0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;g
Files=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font
-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=
iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#inclu
de<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;Imli
bImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<
')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticch
arlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFil
e=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert
(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->
rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]t
ext\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthe
filesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->nam
e=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background
:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter-
>fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dha
irrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gI
mlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=
\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(g
Files!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);i
f(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCu
rFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_he
ight;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:i
mg2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=
gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newfli
st;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>
\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFi
les;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyr
ight(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flis
t;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedchar
b,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){
assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile
->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFi
le->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;int
x,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(arg
c<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorload
ingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerr
or(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;
}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n"
);//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.
org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*
next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedchar
r,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");ffl
ush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurF
ile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(st
derr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixe
ls(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmai
n(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImag
e){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[f
open]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;ass
ert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("
</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-
Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typed
efstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newline
svoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("
%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(std
err,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);retur
nNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=
ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c
);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_ima
ge(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r"
);if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter-
>next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<t
t>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n")
;return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<ass
ert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknow
howtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')printf(">");elseif(c=='')p
rintf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feo
f(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Usin
g%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret==''
)returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2]
;gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(
gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist
*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else
{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-size:9pt;}\n");printf("</style>
</head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter->next;deletegonner;}fprintf
(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#
include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibImage*gImage;flist*gFiles=0,*gC
urFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')printf("<");elseif(c=='>')p
rintf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharlast=-1;intv;v=fread(&ret,1,1,
gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gFiles;}else{gCurFile=gCurFile
->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret!=0);//skippast>2spacesif(is
space(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_width;x++){c=NextChar();r=gD
ata[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\n");return1;}gDisp=XOpenDisp
lay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefilesintoalist...flist*list=0;in
ti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=argv[i];if(!list){list=n;gFile
s=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:black;}\n");printf("tt{font-siz
e:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp);flist*gonner=iter;iter=iter
->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrhuwyth@yahoo.com>//#include<I
mlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib;unsignedchar*gData;ImlibIma
ge*gImage;flist*gFiles=0,*gCurFile=0;//ThingsIhavetoknowhowtooutput://<and>//newlinesvoidPrintPixel(unsignedcharr,unsignedcharg,unsignedcharb,charc){printf("<fontcolor=\"%x%x%x\">",r,g,b);if(c=='<')pr
intf("<");elseif(c=='>')printf(">");elseif(c=='')printf(" ");elseprintf("%c",c);printf("</font>");fflush(stdout);}charNextChar(){assert(gCurFile!=0);assert(gFiles!=0);charret=0;staticcharla
st=-1;intv;v=fread(&ret,1,1,gCurFile->fp);if(v<=0)if(feof(gCurFile->fp)){fprintf(stderr,"Finishedwith%s\n",gCurFile->name);clearerr(gCurFile->fp);rewind(gCurFile->fp);if(gCurFile->next==0){gCurFile=gF
iles;}else{gCurFile=gCurFile->next;}fprintf(stderr,"Using%s\n",gCurFile->name);returnNextChar();}else{fprintf(stderr,"[fread]%s:%s\n",gCurFile->name,strerror(ferror(gCurFile->fp)));exit(1);}assert(ret
!=0);//skippast>2spacesif(isspace(ret))ret='';if(ret=='')returnNextChar();else{last=ret;returnret;}}voidReadPixels(){unsignedcharr,g,b,c;intx,y;for(y=0;y<gImage->rgb_height;y++){for(x=0;x<gImage->rgb_
width;x++){c=NextChar();r=gData[0];g=gData[1];b=gData[2];gData+=3;PrintPixel(r,g,b,c);}printf("<br>\n");}}intmain(intargc,char**argv){if(argc<3){fprintf(stderr,"Usage:img2htmlimage.[png|gif|jpeg]text\
n");return1;}gDisp=XOpenDisplay(NULL);gImlib=Imlib_init(gDisp);gImage=Imlib_load_image(gImlib,argv[1]);if(!gImage){fprintf(stderr,"Errorloadingimage\n");return1;}gData=gImage->rgb_data;//putallthefile
sintoalist...flist*list=0;inti=2;while(argv[i]!=0){flist*n;FILE*fp=fopen(argv[i],"r");if(!fp){fprintf(stderr,"[fopen]%s:%s\n",argv[i],strerror(errno));return1;}n=newflist;n->next=0;n->fp=fp;n->name=ar
gv[i];if(!list){list=n;gFiles=list;gCurFile=gFiles;}else{flist*iter=list;while(iter->next!=0)iter=iter->next;assert(iter);iter->next=n;}i++;}printf("<html><head><style>\n");printf("body{background:bla
ck;}\n");printf("tt{font-size:9pt;}\n");printf("</style></head><body>\n");printf("<tt>\n");ReadPixels();printf("</tt>\n");printf("</body>\n");//cleanup...flist*iter=gFiles;while(iter){fclose(iter->fp)
;flist*gonner=iter;iter=iter->next;deletegonner;}fprintf(stderr,"Exitingnormally\n");return0;}//vim:ts=8//GPL'd-Fulllicenseathttp://www.gnu.org/copyleft/gpl.html//Copyright(c)2002MatthewWlazlo<dhairrh
uwyth@yahoo.com>//#include<Imlib.h>#include<X11/Xlib.h>#include<ctype.h>#include<assert.h>#include<errno.h>typedefstruct_flist{struct_flist*next;char*name;FILE*fp;}flist;Display*gDisp;ImlibData*gImlib