Do not revert to CMAP for second file. (Rob Pike).

This commit is contained in:
rsc 2005-09-15 17:09:40 +00:00
parent 68e139f293
commit d1e25ee94e

View file

@ -268,16 +268,18 @@ rpt: array = Breadjpg(&b, colorspace);
c = nil; c = nil;
if(jflag) if(jflag)
goto Return; goto Return;
if(!dflag && !inited){ if(!dflag){
if(initdraw(0, 0, 0) < 0){ if(!inited){
fprint(2, "jpg: initdraw failed: %r\n"); if(initdraw(0, 0, 0) < 0){
return "initdraw"; fprint(2, "jpg: initdraw failed: %r\n");
return "initdraw";
}
if(Fflag == 0)
einit(Ekeyboard|Emouse);
inited++;
} }
if(Fflag == 0)
einit(Ekeyboard|Emouse);
if(defaultcolor && screen->depth>8 && outchan==CMAP8) if(defaultcolor && screen->depth>8 && outchan==CMAP8)
outchan = RGB24; outchan = RGB24;
inited++;
} }
if(outchan == CMAP8) if(outchan == CMAP8)
c = torgbv(r, !eflag); c = torgbv(r, !eflag);