125 |
|
} |
126 |
|
/* put header */ |
127 |
|
printargs(i, argv, stdout); |
128 |
+ |
fputformat(COLRFMT, stdout); |
129 |
|
putchar('\n'); |
130 |
|
fputresolu(YMAJOR|YDECR, xmax, ymax, stdout); |
131 |
|
/* convert file */ |
283 |
|
p->fp = stdin; |
284 |
|
else if ((p->fp = fopen(fname, "r")) == NULL) |
285 |
|
return(NULL); |
286 |
< |
/* discard header */ |
287 |
< |
getheader(p->fp, NULL); |
288 |
< |
if (fgetresolu(&xmax, &ymax, p->fp) != (YMAJOR|YDECR)) |
289 |
< |
quiterr("bad picture size"); |
286 |
> |
/* get header info. */ |
287 |
> |
if (checkheader(p->fp, COLRFMT, NULL) < 0 || |
288 |
> |
fgetresolu(&xmax, &ymax, p->fp) != (YMAJOR|YDECR)) |
289 |
> |
quiterr("bad picture format"); |
290 |
|
p->nexty = 0; |
291 |
|
p->bytes_line = 0; /* variable length lines */ |
292 |
|
p->pos.y = (long *)ecalloc(ymax, sizeof(long)); |