| 58 |
|
|
| 59 |
|
int nfile; /* number of files */ |
| 60 |
|
|
| 61 |
+ |
char ourfmt[LPICFMT+1] = PICFMT; |
| 62 |
|
int wrongformat = 0; |
| 63 |
|
|
| 64 |
|
FILE *popen(), *lblopen(); |
| 73 |
|
|
| 74 |
|
if (isheadid(s)) |
| 75 |
|
return; |
| 76 |
< |
if (formatval(fmt, s)) |
| 77 |
< |
wrongformat = strcmp(fmt, COLRFMT); |
| 78 |
< |
else { |
| 76 |
> |
if (formatval(fmt, s)) { |
| 77 |
> |
if (globmatch(ourfmt, fmt)) { |
| 78 |
> |
wrongformat = 0; |
| 79 |
> |
strcpy(ourfmt, fmt); |
| 80 |
> |
} else |
| 81 |
> |
wrongformat = 1; |
| 82 |
> |
} else { |
| 83 |
|
putc('\t', stdout); |
| 84 |
|
fputs(s, stdout); |
| 85 |
|
} |
| 227 |
|
printf("%s:\n", input[nfile].name); |
| 228 |
|
getheader(input[nfile].fp, tabputs, NULL); |
| 229 |
|
if (wrongformat) { |
| 230 |
< |
fprintf(stderr, "%s: not a Radiance picture\n", |
| 230 |
> |
fprintf(stderr, "%s: bad Radiance input file\n", |
| 231 |
|
input[nfile].name); |
| 232 |
|
quit(1); |
| 233 |
|
} |
| 294 |
|
ymax = ysiz; |
| 295 |
|
/* add new header info. */ |
| 296 |
|
printargs(argc, argv, stdout); |
| 297 |
< |
fputformat(COLRFMT, stdout); |
| 297 |
> |
if (strcmp(ourfmt, PICFMT)) |
| 298 |
> |
fputformat(ourfmt, stdout); /* print format if known */ |
| 299 |
|
putchar('\n'); |
| 300 |
|
fprtresolu(xsiz, ysiz, stdout); |
| 301 |
|
|