Files scview-20070202/scview and scview-20070202-hp/scview differ diff -u scview-20070202/scview.c scview-20070202-hp/scview.c --- scview-20070202/scview.c 2007-02-02 01:40:35.000000000 +0100 +++ scview-20070202-hp/scview.c 2007-08-18 15:05:31.000000000 +0200 @@ -930,6 +930,7 @@ " -gf - set gamma (-3..)\n" " -gt - load gamma table (format: text lines of range [0...1])\n" " -so - set scale offset\n" + " -ms - set max image size\n" " -i - start with hidden info line\n" "-s[t[c]|p] x y - scale image by x/y and write to stdout as PPM()/TGA(t[c:compress])/PNG(p)\n" "hotkeys:\n" @@ -1118,7 +1119,7 @@ } } -static long mkinfostring(uchar *t0,Tsc *sc,Tinfo *imgf,Timg *img,long inum,long minl) +static long mkinfostring(uchar *t0,Tsc *sc,Tinfo *imgf,Timg *img,long inum,long imgnum,long tagnum,long minl) { register Texpar *ep; register uchar *p, *t=t0; @@ -1132,6 +1133,18 @@ i=num_digits(inum,5); for (l=5-i; l; l--) *(t++)=' '; t+=print_dec(t,inum,i);; + *(t++)='/'; + i=num_digits(imgnum,5); + for (l=5-i; l; l--) *(t++)=' '; + t+=print_dec(t,imgnum,i);; + for (l=info_space; l; l--) *(t++)=' '; + + *(t++)='('; + *(t++)='T'; + i=num_digits(tagnum,5); + for (l=5-i; l; l--) *(t++)=' '; + t+=print_dec(t,tagnum,i);; + *(t++)=')'; for (l=info_space; l; l--) *(t++)=' '; p=t+info_max_namelen+info_space; @@ -1393,8 +1406,8 @@ uchar t[384]; Tinfo *files; Tdisp *dp; - long bx,by,sx,sy,so,sy0,tx,ty,x0,y0,x1,y1,i,j,opn,pn,scn,nsc; - long mx,my,vh,vw,num,info,autoscale=1,imgnum; + long bx,by,sx,sy,so,ms,sy0,tx,ty,x0,y0,x1,y1,i,j,opn,pn,scn,nsc; + long mx,my,vh,vw,num,info,autoscale=1,imgnum,numtag; long x0min,x0max,y0min,y0max,lastill,mpx=-1,mpy=-1; double pixx0=0.0,pixy0=0.0,pixx=0.0,pixy=0.0; uchar *buffer; @@ -1444,6 +1457,7 @@ img.sf0=4; img.gi=mkgamma(img.gamma,0); so=0; + ms=0; lastill=0; sx=sy=0; tx=ty=nsc=0; @@ -1497,6 +1511,12 @@ i++; continue; } + if ( !strcmp(argv[i],"-ms") ) + { + ms=atoi(argv[i+1]); + i++; + continue; + } if ( !strcmp(argv[i],"-s") ) { @@ -1620,8 +1640,8 @@ { for (scn=img.maxsc; scn>0; scn--) { - if ( ((scaler[scn].z*(img.iw))<= sx *scaler[scn].n) - && ((scaler[scn].z*(img.ih))<=(sy0-info)*scaler[scn].n) ) break; + if ( ((scaler[scn].z*(img.iw))<=(ms?ms: sx )*scaler[scn].n) + && ((scaler[scn].z*(img.ih))<=(ms?ms:(sy0-info))*scaler[scn].n) ) break; } if ( autoscale>1 && (scnimg.maxsc ) scn=img.maxsc; @@ -1720,7 +1740,8 @@ if ( info ) { - i=mkinfostring(t,scaler+scn,files+pn,&img,pn,lastill); + numtag=0; for(i=0;isx-infotx ) i=(sx-infotx)/6; draw_string_6x13(buffer+4*((sy0-infoty)*sx+infotx),4*sx,t,i>lastill?i:lastill); lastill=i; Files scview-20070202/scview.o and scview-20070202-hp/scview.o differ