5
/* A short program which converts a .png file into a .gd file, for
6
your convenience in creating images on the fly from a
7
basis image that must be loaded quickly. The .gd format
8
is not intended to be a general-purpose format. */
10
int main(int argc, char **argv)
17
fprintf(stderr, "Usage: pngtogd2 filename.png filename.gd2 cs fmt\n");
18
fprintf(stderr, " where cs is the chunk size\n");
19
fprintf(stderr, " fmt is 1 for raw, 2 for compressed\n");
22
in = fopen(argv[1], "rb");
24
fprintf(stderr, "Input file does not exist!\n");
27
im = gdImageCreateFromPng(in);
30
fprintf(stderr, "Input is not in PNG format!\n");
33
out = fopen(argv[2], "wb");
35
fprintf(stderr, "Output file cannot be written to!\n");
41
gdImageGd2(im, out, cs, fmt);