kalle Sat Apr 25 06:22:14 2009 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/gd/libgd gd.c
Log:
MFH: Use correct data types here, and gdImageSaveAlpha for the alpha flag
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.90.2.1.2.21.2.8&r2=1.90.2.1.2.21.2.9&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.90.2.1.2.21.2.8
php-src/ext/gd/libgd/gd.c:1.90.2.1.2.21.2.9
--- php-src/ext/gd/libgd/gd.c:1.90.2.1.2.21.2.8 Thu Apr 23 16:26:17 2009
+++ php-src/ext/gd/libgd/gd.c Sat Apr 25 06:22:14 2009
@@ -26,11 +26,13 @@
#endif
#if HAVE_FABSF == 0
/* float fabsf(float x); */
+# undef fabsf
# define fabsf(x) ((float)(fabs(x)))
#endif
#if HAVE_FLOORF == 0
/* float floorf(float x);*/
-#define floorf(x) ((float)(floor(x)))
+# undef floorf
+# define floorf(x) ((float)(floor(x)))
#endif
#ifdef _OSD_POSIX /* BS2000 uses the EBCDIC char set instead of
ASCII */
@@ -3870,7 +3872,7 @@
int x, y, i, j, new_a;
float new_r, new_g, new_b;
int new_pxl, pxl=0;
- gdImagePtr srcback, srctrans;
+ gdImagePtr srcback;
typedef int (*FuncPtr)(gdImagePtr, int, int);
FuncPtr f;
@@ -3883,9 +3885,10 @@
if (srcback==NULL) {
return 0;
}
- srcback->saveAlphaFlag = 1;
- srctrans = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
- gdImageFill(srcback, 0, 0, srctrans);
+
+ gdImageSaveAlpha(srcback, 1);
+ new_pxl = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
+ gdImageFill(srcback, 0, 0, new_pxl);
gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php