199 |
|
setmode(fileno(fin), O_BINARY); |
200 |
|
#endif |
201 |
|
/* get header */ |
202 |
< |
if (header && checkheader(fin, fmtid, stdout) < 0) { |
203 |
< |
fprintf(stderr, "%s: wrong input format\n", progname); |
204 |
< |
quit(1); |
205 |
< |
} |
202 |
> |
if (header) { |
203 |
> |
if (checkheader(fin, fmtid, stdout) < 0) { |
204 |
> |
fprintf(stderr, "%s: wrong input format\n", |
205 |
> |
progname); |
206 |
> |
quit(1); |
207 |
> |
} |
208 |
> |
} else |
209 |
> |
newheader("RADIANCE", stdout); |
210 |
|
/* get resolution */ |
211 |
|
if ((resolution && !fgetsresolu(&picres, fin)) || |
212 |
|
picres.xr <= 0 || picres.yr <= 0) { |
261 |
|
double d; |
262 |
|
COLOR ctmp; |
263 |
|
|
264 |
< |
if (isformat(line)) { |
261 |
< |
formatval(fmt, line); |
264 |
> |
if (formatval(fmt, line)) |
265 |
|
wrongformat = strcmp(fmt, COLRFMT); |
266 |
< |
} else if (original && isexpos(line)) { |
266 |
> |
else if (original && isexpos(line)) { |
267 |
|
d = 1.0/exposval(line); |
268 |
|
scalecolor(exposure, d); |
269 |
|
doexposure++; |