| 280 |
|
return(0); |
| 281 |
|
fflush(stdout); |
| 282 |
|
while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) { |
| 283 |
< |
if (write(fileno(stdout), buf, n) != n) |
| 283 |
> |
if (write(1, buf, n) != n) |
| 284 |
|
return(0); |
| 285 |
|
ntot += n; |
| 286 |
|
} |
| 613 |
|
int n; |
| 614 |
|
|
| 615 |
|
if (formatval(fmt, s)) { |
| 616 |
+ |
if (fmtid == fmt) return(0); |
| 617 |
|
if (fmtid == NULL) { |
| 618 |
|
fmtid = fmt; |
| 619 |
|
return(0); |
| 620 |
|
} |
| 621 |
+ |
if (!check & (comp_size == 1) & (n_comp > 1)) |
| 622 |
+ |
return(0); /* byte exception - skip check */ |
| 623 |
|
if (!strcmp(fmt, fmtid)) |
| 624 |
|
return(0); |
| 625 |
|
fprintf(stderr, "Input format '%s' != '%s'\n", fmt, fmtid); |
| 644 |
|
return(0); |
| 645 |
|
} |
| 646 |
|
if (!strncmp(s, "NCOMP=", 6)) { |
| 647 |
+ |
if (!check & (comp_size == 1) & (n_comp > 1)) |
| 648 |
+ |
return(0); /* byte exception - ignore */ |
| 649 |
|
n = atoi(s+6); |
| 650 |
|
if ((n_comp > 0) & (n != n_comp)) { |
| 651 |
|
fputs("Incorrect number of components\n", stderr); |
| 768 |
|
argv[0]); |
| 769 |
|
return(!output_stream(stdin)); |
| 770 |
|
} |
| 771 |
< |
if (i_header) { /* read header */ |
| 772 |
< |
if (getheader(stdin, headline, NULL) < 0) |
| 768 |
< |
return(1); |
| 769 |
< |
if (!check_sizes()) |
| 770 |
< |
return(1); |
| 771 |
< |
} else if (!check_sizes()) |
| 771 |
> |
/* read input header? */ |
| 772 |
> |
if (i_header && getheader(stdin, headline, NULL) < 0) |
| 773 |
|
return(1); |
| 774 |
< |
if (o_header) { /* write/add to header */ |
| 774 |
> |
if (!check_sizes()) /* adjust sizes */ |
| 775 |
> |
return(1); |
| 776 |
> |
if (o_header) { /* add to output header? */ |
| 777 |
|
if (!i_header) |
| 778 |
|
newheader("RADIANCE", stdout); |
| 779 |
|
printargs(a, argv, stdout); |
| 780 |
|
printf("NCOMP=%d\n", n_comp); |
| 781 |
|
} |
| 782 |
< |
if (!comp_size) { /* a little late... */ |
| 782 |
> |
if (!comp_size) { /* a little late, here... */ |
| 783 |
|
SET_FILE_TEXT(stdin); |
| 784 |
|
SET_FILE_TEXT(stdout); |
| 785 |
|
} |