diff options
author | Norikatsu Shigemura <nork@FreeBSD.org> | 2003-08-18 16:15:10 +0000 |
---|---|---|
committer | Norikatsu Shigemura <nork@FreeBSD.org> | 2003-08-18 16:15:10 +0000 |
commit | efb928619b234d49b326a13f59a6e2ee354bf902 (patch) | |
tree | c62bd82140831e81442480b9cefc699e0c08f08d /graphics/gd/files/patch-gdtest.c | |
parent | Update to 5.0.8. As reported by Paul Szabo in (diff) |
o Main modification
graphics/gd(based on 1.8.4) -> graphics/gd1
graphics/gd2(based on 2.0.15) -> graphics/gd
graphics/p5-GD(based on 1.41) -> graphics/p5-GD1
graphics/p5-GD2(based on 2.07) -> graphics/p5-GD
japanese/gd -> japanese/gd1
japanese/gd2 -> japanese/gd
o Include some feature
WITH_XPM(w/, w/o WITHOUT_X11)
o Chase this modification
o Fix build error [1]
PR: ports/54540
Submitted by: Ports Fury
Approved by: maintainer (blanket)
Reported by: bento via kris [1]
Diffstat (limited to 'graphics/gd/files/patch-gdtest.c')
-rw-r--r-- | graphics/gd/files/patch-gdtest.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/graphics/gd/files/patch-gdtest.c b/graphics/gd/files/patch-gdtest.c new file mode 100644 index 000000000000..85c855d4db02 --- /dev/null +++ b/graphics/gd/files/patch-gdtest.c @@ -0,0 +1,81 @@ +--- gdtest.c.orig Thu Apr 25 14:16:47 2002 ++++ gdtest.c Tue Nov 6 15:53:38 2001 +@@ -84,6 +84,35 @@ + gdImageDestroy (im2); + ctx->gd_free (ctx); + ++ /* */ ++ /* Send to GIF File then Ptr */ ++ /* */ ++ sprintf(of, "%s.gif", argv[1]); ++ out = fopen(of, "wb"); ++ gdImageGif(im, out); ++ fclose(out); ++ ++ in = fopen(of, "rb"); ++ if (!in) { ++ fprintf(stderr, "GIF Output file does not exist!\n"); ++ exit(1); ++ } ++ im2 = gdImageCreateFromGif(in); ++ fclose(in); ++ ++ CompareImages("GD->GIF File->GD", ref, im2); ++ ++ unlink(of); ++ gdImageDestroy(im2); ++ ++ iptr = gdImageGifPtr(im,&sz); ++ ctx = gdNewDynamicCtx(sz,iptr); ++ im2 = gdImageCreateFromGifCtx(ctx); ++ ++ CompareImages("GD->GIF ptr->GD", ref, im2); ++ ++ gdImageDestroy(im2); ++ ctx->gd_free(ctx); + + /* */ + /* Send to GD2 File then Ptr */ +@@ -200,7 +229,30 @@ + gdImageDestroy (im2); + }; + +- unlink (of); ++ /* ++ ** Test gdImageCreateFromGifSource ++ **/ ++ ++ in = fopen(of, "rb"); ++ ++ if (!in) ++ { ++ fprintf (stderr, "GD Source: ERROR - GD Source input file does not exist - Sink may have failed!\n"); ++ }; ++ ++ imgsrc.source = freadWrapper; ++ imgsrc.context = in; ++ im2 = gdImageCreateFromGifSource(&imgsrc); ++ fclose(in); ++ ++ if (im2 == NULL) { ++ printf("GD Source (GIF): ERROR Null returned by gdImageCreateFromGifSource\n"); ++ } else { ++ CompareImages("GD Source (GIF)", ref, im2); ++ gdImageDestroy(im2); ++ }; ++ ++ unlink(of); + + /* */ + /* Test Extraction */ +@@ -266,6 +318,10 @@ + + printf ("[Merged Image has %d colours]\n", im2->colorsTotal); + CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3); ++ ++ out = fopen ("test/gdtest_merge_out.png", "wb"); ++ gdImagePng(im2, out); ++ close(out); + + gdImageDestroy (im2); + gdImageDestroy (im3); |