16 |
|
|
17 |
|
#include "color.h" |
18 |
|
|
19 |
+ |
#include "resolu.h" |
20 |
|
|
21 |
+ |
|
22 |
|
main(argc, argv) /* print a picture */ |
23 |
|
int argc; |
24 |
|
char *argv[]; |
41 |
|
exit(1); |
42 |
|
} |
43 |
|
/* discard header */ |
44 |
< |
getheader(input, NULL); |
44 |
> |
if (checkheader(input, COLRFMT, NULL) < 0) { |
45 |
> |
fprintf(stderr, "%s: not a Radiance picture\n", fname); |
46 |
> |
exit(1); |
47 |
> |
} |
48 |
|
/* get picture dimensions */ |
49 |
< |
if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { |
49 |
> |
if (fgetresolu(&xres, &yres, input) < 0) { |
50 |
|
fprintf(stderr, "%s: bad picture size\n", fname); |
51 |
|
exit(1); |
52 |
|
} |