Home  |  Linux  | Mysql  | PHP  | XML
From:Takeshi Abe Date:Thu Aug 14 04:41:57 2008
Subject:cvs: gd /libgd/src gdxpm.c /libgd/tests CMakeLists.txt Makefile.am
tabe		Thu Aug 14 10:41:57 2008 UTC

  Modified files:              
    /gd/libgd/src	gdxpm.c 
    /gd/libgd/tests	CMakeLists.txt Makefile.am 
  Log:
  fixed FS#166:
  * added test subdirectory 'xpm'
  
  
http://cvs.php.net/viewvc.cgi/gd/libgd/src/gdxpm.c?r1=1.10&r2=1.11&diff_format=u
Index: gd/libgd/src/gdxpm.c
diff -u gd/libgd/src/gdxpm.c:1.10 gd/libgd/src/gdxpm.c:1.11
--- gd/libgd/src/gdxpm.c:1.10	Fri Dec 21 23:08:30 2007
+++ gd/libgd/src/gdxpm.c	Thu Aug 14 10:41:57 2008
@@ -29,7 +29,7 @@
 {
 	XpmInfo info;
 	XpmImage image;
-	int i, j, k, number;
+	int i, j, k, number, len;
 	char buf[5];
 	gdImagePtr im = 0;
 	int *pointer;
@@ -42,10 +42,6 @@
 		return 0;
 	}
 
-	if(!(im = gdImageCreate(image.width, image.height))) {
-		return 0;
-	}
-
 	number = image.ncolors;
 	if(overflow2(sizeof(int), number)) {
 		return 0;
@@ -56,17 +52,30 @@
 		return (0);
 	}
 
+	if(!(im = gdImageCreate(image.width, image.height))) {
+		gdFree(colors);
+		return 0;
+	}
+
 	for(i = 0; i < number; i++) {
-		switch(strlen(image.colorTable[i].c_color)) {
+		if(strcmp(image.colorTable[i].c_color, "None") == 0) {
+		  colors[i] = gdImageGetTransparent(im);
+		  if(colors[i] == -1) colors[i] = gdImageColorAllocate(im, 0, 0, 0);
+		  if(colors[i] != -1) gdImageColorTransparent(im, colors[i]);
+		  continue;
+		}
+		len = strlen(image.colorTable[i].c_color);
+		if(len < 1 || image.colorTable[i].c_color[0] != '#') continue;
+		switch(len) {
 			case 4:
-				buf[1] = '\0';
-				buf[0] = image.colorTable[i].c_color[1];
+				buf[2] = '\0';
+				buf[0] = buf[1] = image.colorTable[i].c_color[1];
 				red = strtol(buf, NULL, 16);
 
-				buf[0] = image.colorTable[i].c_color[3];
+				buf[0] = buf[1] = image.colorTable[i].c_color[2];
 				green = strtol(buf, NULL, 16);
 
-				buf[0] = image.colorTable[i].c_color[5];
+				buf[0] = buf[1] = image.colorTable[i].c_color[3];
 				blue = strtol(buf, NULL, 16);
 			break;
 
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/CMakeLists.txt?r1=1.7&r2=1.8&diff_format=u
Index: gd/libgd/tests/CMakeLists.txt
diff -u gd/libgd/tests/CMakeLists.txt:1.7 gd/libgd/tests/CMakeLists.txt:1.8
--- gd/libgd/tests/CMakeLists.txt:1.7	Mon May  5 08:47:23 2008
+++ gd/libgd/tests/CMakeLists.txt	Thu Aug 14 10:41:57 2008
@@ -43,6 +43,7 @@
 		gdimagefill
 		gdimagefilltoborder
 		freetype
+		xpm
 	)
 
 	IF (WIN32)
http://cvs.php.net/viewvc.cgi/gd/libgd/tests/Makefile.am?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/tests/Makefile.am
diff -u gd/libgd/tests/Makefile.am:1.1 gd/libgd/tests/Makefile.am:1.2
--- gd/libgd/tests/Makefile.am:1.1	Sat May 10 20:19:27 2008
+++ gd/libgd/tests/Makefile.am	Thu Aug 14 10:41:57 2008
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
 AUTOMAKE_OPTIONS = foreign 1.7
 
-SUBDIRS = gd2 gdimagecolordeallocate gdimagecolortransparent gdimagefill gdimagefilltoborder gdtest jpeg gdimagearc gdimagecolorexact gdimagecopy gdimagefilledellipse gdimageline gdtiled freetype gdimagecolorclosest gdimagecolorresolve gdimagecopyrotated gdimagefilledrectangle gdimagerectangle gif png
+SUBDIRS = gd2 gdimagecolordeallocate gdimagecolortransparent gdimagefill gdimagefilltoborder gdtest jpeg gdimagearc gdimagecolorexact gdimagecopy gdimagefilledellipse gdimageline gdtiled freetype gdimagecolorclosest gdimagecolorresolve gdimagecopyrotated gdimagefilledrectangle gdimagerectangle gif png xpm
 
 EXTRA_DIST = CMakeLists.txt
 


Navigate in group php.gd.cvs at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants