*destwidth = header.width;
*destheight = header.height;
+ fclose(fi);
return 1;
}
}
}
+ fclose(fi);
if(!zimagedata || uncompress(imagedata, &imagedatalen, zimagedata, zimagedatalen) != Z_OK) {
printf("Couldn't uncompress %s!\n", sname);
if(zimagedata)
return 0;
}
free(zimagedata);
- fclose(fi);
*destwidth = header.width;
*destheight = header.height;
unsigned char format;
unsigned char tmp;
unsigned char* data2=0;
- u32 datalen;
- u32 datalen2;
unsigned char head[] = {137,80,78,71,13,10,26,10}; // PNG header
int cols;
char alpha = 1;
png_quantize_image(data, width*height, numcolors, &data, palette);
}
- datalen = (width*height*bpp/8+cols*8);
-
fi = fopen(filename, "wb");
if(!fi) {
perror("open");