Color quantization/C: Difference between revisions

Fixed bug in C code
m (enough with the frogs)
(Fixed bug in C code)
Line 16:
int write_ppm(image im, char *fn)
{
FILE *fp = fopen(fn, "wwb");
if (!fp) return 0;
fprintf(fp, "P6\n%d %d\n255\n", im->w, im->h);
Line 47:
image read_ppm(char *fn)
{
FILE *fp = fopen(fn, "rrb");
int w, h, maxval;
image im = 0;
Anonymous user