18 |
|
|
19 |
|
VIEW vw = STDVIEW; |
20 |
|
int gotvw = 0; |
21 |
< |
char fmt[MAXFMTLEN] = "Unknown"; |
21 |
> |
char fmt[MAXFMTLEN] = "ascii"; /* assumed when unspecified */ |
22 |
|
int ncomp = 0; |
23 |
|
RESOLU res; |
24 |
|
int rmin, cmin, nrows, ncols; |
234 |
|
fputs(": cannot open for writing\n", stderr); |
235 |
|
return(1); |
236 |
|
} |
237 |
+ |
#ifdef getc_unlocked /* avoid stupid semaphores */ |
238 |
+ |
flockfile(fp); |
239 |
+ |
flockfile(stdout); |
240 |
+ |
#endif |
241 |
|
/* process information header */ |
242 |
|
if (getheader(fp, headline, NULL) < 0) { |
243 |
|
fputs(progname, stderr); |
261 |
|
fputs(": illegal crop\n", stderr); |
262 |
|
return(1); |
263 |
|
} |
264 |
< |
printargs(argc, argv, stdout); |
264 |
> |
printargs(5, argv, stdout); |
265 |
|
if (gotvw) { /* adjust view? */ |
266 |
|
double p0[2], p1[2]; |
267 |
|
const char *err; |
271 |
|
p1[0] = (cmin+ncols)/(double)res.xr; |
272 |
|
p1[1] = (rmin+nrows)/(double)res.yr; |
273 |
|
} else { |
274 |
< |
p0[1] = cmin/(double)res.xr; |
275 |
< |
p0[0] = rmin/(double)res.yr; |
276 |
< |
p1[1] = (cmin+ncols)/(double)res.xr; |
277 |
< |
p1[0] = (rmin+nrows)/(double)res.yr; |
274 |
> |
p0[0] = rmin/(double)res.xr; |
275 |
> |
p0[1] = cmin/(double)res.yr; |
276 |
> |
p1[0] = (rmin+nrows)/(double)res.xr; |
277 |
> |
p1[1] = (cmin+ncols)/(double)res.yr; |
278 |
|
} |
279 |
|
if (res.rt & XDECR) { |
280 |
|
p0[0] = 1. - p0[0]; |