rasmus          Thu Jul 31 09:23:59 2008 UTC

  Modified files:              
    /php-src/ext/gd/libgd       gd.c gd_png.c 
  Log:
  Fix for bug #45030
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd.c?r1=1.114&r2=1.115&diff_format=u
Index: php-src/ext/gd/libgd/gd.c
diff -u php-src/ext/gd/libgd/gd.c:1.114 php-src/ext/gd/libgd/gd.c:1.115
--- php-src/ext/gd/libgd/gd.c:1.114     Sun Nov  4 23:57:07 2007
+++ php-src/ext/gd/libgd/gd.c   Thu Jul 31 09:23:59 2008
@@ -2613,6 +2613,7 @@
                                green /= spixels;
                                blue /= spixels;
                                alpha /= spixels;
+                               alpha += 0.5;
                        }
                        if ( alpha_sum != 0.0f) {
                                if( contrib_sum != 0.0f) {
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gd_png.c?r1=1.24&r2=1.25&diff_format=u
Index: php-src/ext/gd/libgd/gd_png.c
diff -u php-src/ext/gd/libgd/gd_png.c:1.24 php-src/ext/gd/libgd/gd_png.c:1.25
--- php-src/ext/gd/libgd/gd_png.c:1.24  Wed May 16 22:16:21 2007
+++ php-src/ext/gd/libgd/gd_png.c       Thu Jul 31 09:23:59 2008
@@ -689,7 +689,12 @@
                                         */
                                        a = gdTrueColorGetAlpha(thisPixel);
                                        /* Andrew Hull: >> 6, not >> 7! (gd 
2.0.5) */
-                                       *pOutputRow++ = 255 - ((a << 1) + (a >> 
6));
+                                       if (a == 127) {
+                                               *pOutputRow++ = 0;
+                                       } else {
+                                               *pOutputRow++ = 255 - ((a << 1) 
+ (a >> 6));
+                                       }
+
                                }
                        }
                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to