15 |
|
|
16 |
|
#include "color.h" |
17 |
|
|
18 |
+ |
#include "resolu.h" |
19 |
+ |
|
20 |
|
#include "pic.h" |
21 |
|
|
22 |
|
#include "targa.h" |
136 |
|
printargs(i, argv, stdout); |
137 |
|
fputformat(COLRFMT, stdout); |
138 |
|
putchar('\n'); |
139 |
< |
fputresolu(YMAJOR|YDECR, xmax, ymax, stdout); |
139 |
> |
fprtresolu(xmax, ymax, stdout); |
140 |
|
/* convert file */ |
141 |
|
tg2ra(&head); |
142 |
|
} else { |
294 |
|
return(NULL); |
295 |
|
/* get header info. */ |
296 |
|
if (checkheader(p->fp, COLRFMT, NULL) < 0 || |
297 |
< |
fgetresolu(&xmax, &ymax, p->fp) != (YMAJOR|YDECR)) |
297 |
> |
fgetresolu(&xmax, &ymax, p->fp) < 0) |
298 |
|
quiterr("bad picture format"); |
299 |
|
p->nexty = 0; |
300 |
|
p->bytes_line = 0; /* variable length lines */ |
334 |
|
register int i, j; |
335 |
|
|
336 |
|
/* get color table */ |
337 |
< |
if ((hp->CMapBits==24 ? fread((char *)map.c3,sizeof(map.c3),1,stdin) : |
338 |
< |
fread((char *)map.c4,sizeof(map.c4),1,stdin)) != 1) |
337 |
> |
if ((hp->CMapBits==24 ? fread((char *)(map.c3+hp->mapOrig), |
338 |
> |
3*hp->mapLength,1,stdin) : |
339 |
> |
fread((char *)(map.c4+hp->mapOrig), |
340 |
> |
4*hp->mapLength,1,stdin)) != 1) |
341 |
|
quiterr("error reading color table"); |
342 |
|
/* convert table */ |
343 |
|
for (i = hp->mapOrig; i < hp->mapOrig+hp->mapLength; i++) |