diff options
author | Tony Theodore <tonyt@logyst.com> | 2013-02-14 02:39:37 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2013-02-14 02:39:37 (GMT) |
commit | 574dd6ebb656414251aa36e07b830ae05f7de43e (patch) | |
tree | 55e992a7cfb279a0f869178b344facef6659bcbf /src/gd-test.c | |
parent | 1eefbe8b1dd34b02ac6a89d6ff05080a3771d36a (diff) | |
download | mxe-574dd6ebb656414251aa36e07b830ae05f7de43e.zip mxe-574dd6ebb656414251aa36e07b830ae05f7de43e.tar.gz mxe-574dd6ebb656414251aa36e07b830ae05f7de43e.tar.bz2 |
package gd: add jpeg image to test
Diffstat (limited to 'src/gd-test.c')
-rw-r--r-- | src/gd-test.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gd-test.c b/src/gd-test.c index 8dc6cad..8cdc3b8 100644 --- a/src/gd-test.c +++ b/src/gd-test.c @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) { gdImagePtr im; - FILE *fp; + FILE *fp, *fj; int cor_rad; (void)argc; @@ -34,6 +34,17 @@ int main(int argc, char *argv[]) fclose(fp); fprintf(stdout, "test-gd.png created\n"); + + fj = fopen("test-gd.jpg", "wb"); + if (!fj) { + fprintf(stderr, "Can't save jpeg image.\n"); + gdImageDestroy(im); + return 1; + } + gdImageJpeg(im, fj, 50); + fclose(fj); + + fprintf(stdout, "test-gd.jpg created\n"); gdImageDestroy(im); return 0; } |