cvs: gd /libgd ISSUES /libgd/tests bug00008.c

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1160361506@cvsserver>
pajoye		Mon Oct  9 02:38:26 2006 UTC

  Added files:                 
    /gd/libgd/tests	bug00008.c 

  Modified files:              
    /gd/libgd	ISSUES 
  Log:
  - port another test for gdImageFill
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/ISSUES?r1=1.6&r2=1.7&diff_format=u
Index: gd/libgd/ISSUES
diff -u gd/libgd/ISSUES:1.6 gd/libgd/ISSUES:1.7
--- gd/libgd/ISSUES:1.6	Sun Oct  8 21:43:16 2006
+++ gd/libgd/ISSUES	Mon Oct  9 02:38:26 2006
@@ -2,8 +2,8 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 #1, Initialize values this also provides a 5x speedup in the imagefttext.phpt 
     test, because without this patch it never got cache hits (Nuno Lopes)
-#2, gdImageFill, multiple segfaults with complex patterns, transparent colors
-  or invalid color index
+#2, #8, gdImageFill, multiple segfaults with complex patterns, transparent 
+    colors or invalid color index
 #3, gdImageRectangle draws corners twice (affects rectangles with alpha 
     channel)
 #4, TrueColor transparent color not used  with GIF output (palette)

http://cvs.php.net/viewvc.cgi/gd/libgd/tests/bug00008.c?view=markup&rev=1.1
Index: gd/libgd/tests/bug00008.c
+++ gd/libgd/tests/bug00008.c
#include "gd.h"

int main()
{
 	gdImagePtr im;
	FILE *fp;
	int c0,c1,c3;
	int red, blue, white, black;

	im = gdImageCreate(50,100);
	red = gdImageColorAllocate(im, 255, 0, 0);
	blue = gdImageColorAllocate(im, 0,0,255);
	white  = gdImageColorAllocate(im, 255,255,255);
	black = gdImageColorAllocate(im, 0,0,0);
	gdImageFill(im, 0,0, black);

	gdImageLine(im, 20,20,180,20, white);
	gdImageLine(im, 20,20,20,70, blue);
	gdImageLine(im, 20,70,180,70, red);
	gdImageLine(im, 180,20,180,45, white);
	gdImageLine(im, 180,70,180,45, red);
	gdImageLine(im, 20,20,100,45, blue);
	gdImageLine(im, 20,70,100,45, blue);
	gdImageLine(im, 100,45,180,45, red);

	gdImageFill(im, 21,45, blue);
	gdImageFill(im, 100,69, red);
	gdImageFill(im, 100,21, white);

	fp = fopen("a.png", "wb");
 	gdImagePng(im, fp);
	fclose(fp);

 	/* Destroy it */
 	gdImageDestroy(im);

 	return 0;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.