65 |
|
exit(1); |
66 |
|
} |
67 |
|
if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) { |
68 |
< |
fprintf(stderr, "can't open output \"%s\"\n", |
68 |
> |
fprintf(stderr, "%s: can't open output \"%s\"\n", |
69 |
|
progname, argv[i+1]); |
70 |
|
exit(1); |
71 |
|
} |
127 |
|
quiterr("out of memory in avs2ra"); |
128 |
|
/* convert image */ |
129 |
|
for (y = ymax-1; y >= 0; y--) { |
130 |
< |
(void)getc(stdin); /* toss alpha */ |
131 |
< |
scanout[x][RED] = getc(stdin); |
132 |
< |
scanout[x][GRN] = getc(stdin); |
133 |
< |
scanout[x][BLU] = getc(stdin); |
134 |
< |
if (feof(stdin) || ferror(stdin)) |
130 |
> |
for (x = 0; x < xmax; x++) { |
131 |
> |
(void)getc(stdin); /* toss alpha */ |
132 |
> |
scanout[x][RED] = getc(stdin); |
133 |
> |
scanout[x][GRN] = getc(stdin); |
134 |
> |
scanout[x][BLU] = getc(stdin); |
135 |
> |
} |
136 |
> |
if (feof(stdin) | ferror(stdin)) |
137 |
|
quiterr("error reading AVS image"); |
138 |
|
/* undo gamma */ |
139 |
|
gambs_colrs(scanout, xmax); |