11main (
int argc,
char **argv)
19 fprintf (stderr,
"Usage: gdparttopng filename.gd filename.png x y w h\n");
22 in =
fopen (argv[1],
"rb");
25 fprintf (stderr,
"Input file does not exist!\n");
34 printf (
"Extracting from (%d, %d), size is %dx%d\n", x, y, w, h);
40 fprintf (stderr,
"Input is not in GD2 format!\n");
46 fprintf (stderr,
"Output file cannot be written to!\n");
53 fprintf(stderr,
"No PNG library support.\n");
fprintf($stream, string $format, mixed ... $values)
printf(string $format, mixed ... $values)
fopen(string $filename, string $mode, bool $use_include_path=false, $context=null)
gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h)
void gdImagePng(gdImagePtr im, FILE *out)
void gdImageDestroy(gdImagePtr im)
exit(string|int $status=0)