75 |
|
quiterr("incompatible format"); |
76 |
|
/* put header */ |
77 |
|
printargs(i, argv, stdout); |
78 |
+ |
fputformat(COLRFMT, stdout); |
79 |
|
putchar('\n'); |
80 |
|
fputresolu(YMAJOR|YDECR, xmax, ymax, stdout); |
81 |
|
/* convert file */ |
82 |
|
pr2ra(); |
83 |
|
} else { |
84 |
< |
/* discard input header */ |
85 |
< |
getheader(stdin, NULL); |
86 |
< |
/* get resolution */ |
87 |
< |
if (fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR)) |
87 |
< |
quiterr("bad picture size"); |
84 |
> |
/* get header info. */ |
85 |
> |
if (checkheader(stdin, COLRFMT, NULL) < 0 || |
86 |
> |
fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR)) |
87 |
> |
quiterr("bad picture format"); |
88 |
|
/* write rasterfile header */ |
89 |
|
head.ras_magic = RAS_MAGIC; |
90 |
|
head.ras_width = xmax; |