cvs: gd /libgd gd.c /libgd/tests/gdimagefilledrectangle CMakeLists.txt bug00106.c /libgd/tests/gdimagerectangle CMakeLists.txt bug00106.c

[email protected] ("Pierre-Alain Joye") Sun, 26 Aug 2007 19:46:19 -0000
Newsgroups php.gd.cvs
Message-ID <cvspajoye1188157579@cvsserver>
pajoye		Sun Aug 26 19:46:19 2007 UTC

  Modified files:              
    /gd/libgd	gd.c 
    /gd/libgd/tests/gdimagefilledrectangle	bug00106.c CMakeLists.txt 
    /gd/libgd/tests/gdimagerectangle	bug00106.c CMakeLists.txt 
  Log:
  - MFB: #106, gdImageRectangle draws 1x1 rectangles as 1x3 rectangles
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd.c?r1=1.67&r2=1.68&diff_format=u
Index: gd/libgd/gd.c
diff -u gd/libgd/gd.c:1.67 gd/libgd/gd.c:1.68
--- gd/libgd/gd.c:1.67	Wed Aug  8 19:51:06 2007
+++ gd/libgd/gd.c	Sun Aug 26 19:46:19 2007
@@ -1,4 +1,4 @@
-/* $Id: gd.c,v 1.67 2007/08/08 19:51:06 mattias Exp $ */
+/* $Id: gd.c,v 1.68 2007/08/26 19:46:19 pajoye Exp $ */
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -2102,6 +2102,11 @@
 	int half1 = 1;
 	int t;
 
+	if (x1 == x2 && y1 == y2 && thick == 1) {
+			gdImageSetPixel(im, x1, y1, color);
+			return;
+	}
+
 	if (y2 < y1) {
 		t=y1;
 		y1 = y2;
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefilledrectangle/bug00106.c?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/gdimagefilledrectangle/bug00106.c
diff -u /dev/null gd/libgd/tests/gdimagefilledrectangle/bug00106.c:1.2
--- /dev/null	Sun Aug 26 19:46:19 2007
+++ gd/libgd/tests/gdimagefilledrectangle/bug00106.c	Sun Aug 26 19:46:19 2007
@@ -0,0 +1,28 @@
+#include <gd.h>
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	FILE *fp;
+	int c1,c2,c3,c4;
+
+	im = gdImageCreateTrueColor(10,10);
+	if (!im) {
+		return 1;
+	}
+
+	gdImageFilledRectangle(im, 1,1, 1,1, 0x50FFFFFF);
+	c1 = gdImageGetTrueColorPixel(im, 1, 1);
+	c2 = gdImageGetTrueColorPixel(im, 2, 1);
+	c3 = gdImageGetTrueColorPixel(im, 1, 2);
+	c4 = gdImageGetTrueColorPixel(im, 2, 2);
+	gdImageDestroy(im);
+	if (0x005e5e5e == c1 && 0x0 == c2 &&
+			0x0 == c3 && 0x0 == c4) {
+		return 0;
+	} else {
+		return 1;
+	}
+}
+
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagefilledrectangle/CMakeLists.txt?r1=1.2&r2=1.3&diff_format=u
Index: gd/libgd/tests/gdimagefilledrectangle/CMakeLists.txt
diff -u gd/libgd/tests/gdimagefilledrectangle/CMakeLists.txt:1.2 gd/libgd/tests/gdimagefilledrectangle/CMakeLists.txt:1.3
--- gd/libgd/tests/gdimagefilledrectangle/CMakeLists.txt:1.2	Sun May  6 19:53:05 2007
+++ gd/libgd/tests/gdimagefilledrectangle/CMakeLists.txt	Sun Aug 26 19:46:19 2007
@@ -1,6 +1,7 @@
 SET(TESTS_FILES
 	bug00004
 	bug00078
+	bug00106
 )
 
 FOREACH(test_name ${TESTS_FILES})
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagerectangle/bug00106.c?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/gdimagerectangle/bug00106.c
diff -u /dev/null gd/libgd/tests/gdimagerectangle/bug00106.c:1.2
--- /dev/null	Sun Aug 26 19:46:19 2007
+++ gd/libgd/tests/gdimagerectangle/bug00106.c	Sun Aug 26 19:46:19 2007
@@ -0,0 +1,29 @@
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+	gdImagePtr im;
+	FILE *fp;
+	int c1,c2,c3,c4;
+
+	im = gdImageCreateTrueColor(10,10);
+
+	if (!im) {
+		return 1;
+	}
+
+	gdImageRectangle(im, 1,1, 1,1, 0x50FFFFFF);
+	c1 = gdImageGetTrueColorPixel(im, 1, 1);
+	c2 = gdImageGetTrueColorPixel(im, 2, 1);
+	c3 = gdImageGetTrueColorPixel(im, 1, 2);
+	c4 = gdImageGetTrueColorPixel(im, 2, 2);
+	gdImageDestroy(im);
+
+	if (0x005e5e5e == c1 && 0x0 == c2 &&
+	 0x0 == c3 && 0x0 == c4) {
+	 	return 0;
+	} else {
+		return 1;
+	}
+}
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/gdimagerectangle/CMakeLists.txt?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/gdimagerectangle/CMakeLists.txt
diff -u gd/libgd/tests/gdimagerectangle/CMakeLists.txt:1.1 gd/libgd/tests/gdimagerectangle/CMakeLists.txt:1.2
--- gd/libgd/tests/gdimagerectangle/CMakeLists.txt:1.1	Tue Jan 23 23:57:54 2007
+++ gd/libgd/tests/gdimagerectangle/CMakeLists.txt	Sun Aug 26 19:46:19 2007
@@ -1,4 +1,10 @@
+SET(TESTS_FILES
+	bug00003
+	bug00106
+)
 
-add_executable(bug00003 bug00003.c)
-target_link_libraries (bug00003 gdTest ${GD_LIB})
-ADD_TEST(bug00003 ${EXECUTABLE_OUTPUT_PATH}/bug00003)
+FOREACH(test_name ${TESTS_FILES})
+	add_executable(${test_name} "${test_name}.c")
+	target_link_libraries (${test_name} gdTest ${GD_LIB})
+	ADD_TEST(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
+ENDFOREACH(test_name)