libtthimage/Lib/t_png.c

40 lines
758 B
C

/*
* test des fonctionsPNG
*/
#include <stdio.h>
#include <stdlib.h>
#include "../tthimage.h"
/*::------------------------------------------------------------------::*/
/*::------------------------------------------------------------------::*/
/*::------------------------------------------------------------------::*/
int main(int argc, char *argv[])
{
Image_Desc *img;
int foo;
char *fname = "foo.png";
Image_print_version(0);
writepng_version_info();
if (2==argc) {
fname = argv[1];
}
img = Image_alloc(640, 480, IMAGE_RGB);
foo = Image_save_as_PNG(img, fname, 0, 0);
if (foo) {
fprintf(stderr, "save as '%s' -> %d\n", fname, foo);
exit(1);
}
return 0;
}
/*::------------------------------------------------------------------::*/