| 43 |
|
|
| 44 |
|
int nfile; /* number of files */ |
| 45 |
|
|
| 46 |
+ |
int wrongformat = 0; |
| 47 |
|
|
| 48 |
+ |
|
| 49 |
|
tabputs(s) /* print line preceded by a tab */ |
| 50 |
|
char *s; |
| 51 |
|
{ |
| 52 |
< |
putc('\t', stdout); |
| 53 |
< |
fputs(s, stdout); |
| 52 |
> |
char fmt[32]; |
| 53 |
> |
|
| 54 |
> |
if (isformat(s)) { |
| 55 |
> |
formatval(fmt, s); |
| 56 |
> |
wrongformat = strcmp(fmt, COLRFMT); |
| 57 |
> |
} else { |
| 58 |
> |
putc('\t', stdout); |
| 59 |
> |
fputs(s, stdout); |
| 60 |
> |
} |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
|
| 139 |
|
an++; |
| 140 |
|
/* get header */ |
| 141 |
|
printf("%s:\n", input[nfile].name); |
| 142 |
< |
getheader(input[nfile].fp, tabputs); |
| 142 |
> |
getheader(input[nfile].fp, tabputs, NULL); |
| 143 |
> |
if (wrongformat) { |
| 144 |
> |
fprintf(stderr, "%s: not a Radiance picture\n", |
| 145 |
> |
input[nfile].name); |
| 146 |
> |
quit(1); |
| 147 |
> |
} |
| 148 |
|
/* get picture size */ |
| 149 |
|
if (fgetresolu(&input[nfile].xres, &input[nfile].yres, |
| 150 |
|
input[nfile].fp) != (YMAJOR|YDECR)) { |
| 169 |
|
ysiz = ymax; |
| 170 |
|
/* add new header info. */ |
| 171 |
|
printargs(argc, argv, stdout); |
| 172 |
+ |
fputformat(COLRFMT, stdout); |
| 173 |
|
printf("\n-Y %d +X %d\n", ysiz, xsiz); |
| 174 |
|
|
| 175 |
|
compos(); |