| 50 |
|
static long ncall = 0L; /* number of calls to getpictscan */ |
| 51 |
|
static long nread = 0L; /* number of scanlines read */ |
| 52 |
|
|
| 53 |
+ |
static int wrongformat = 0; |
| 54 |
+ |
|
| 55 |
|
SCAN *scanretire(); |
| 56 |
|
|
| 57 |
|
extern long ftell(); |
| 292 |
|
getexpos(s) /* get exposure from header line */ |
| 293 |
|
char *s; |
| 294 |
|
{ |
| 295 |
+ |
char fmt[32]; |
| 296 |
+ |
|
| 297 |
|
if (isexpos(s)) |
| 298 |
|
exposure *= exposval(s); |
| 299 |
+ |
else if (isformat(s)) { |
| 300 |
+ |
formatval(fmt, s); |
| 301 |
+ |
wrongformat = strcmp(fmt, COLRFMT); |
| 302 |
+ |
} |
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
|
| 311 |
|
exit(1); |
| 312 |
|
} |
| 313 |
|
exposure = 1.0; |
| 314 |
< |
getheader(pictfp, getexpos); |
| 315 |
< |
if (fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) { |
| 316 |
< |
fprintf("%s: bad picture resolution\n", fn); |
| 314 |
> |
getheader(pictfp, getexpos, NULL); |
| 315 |
> |
if (wrongformat || |
| 316 |
> |
fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) { |
| 317 |
> |
fprintf("%s: bad picture format\n", fn); |
| 318 |
|
exit(1); |
| 319 |
|
} |
| 320 |
|
initscans(); |