]> granicus.if.org Git - php/commitdiff
Fixed bug #22544 (missing fix from official gd).
authorIlia Alshanetsky <iliaa@php.net>
Wed, 5 Mar 2003 15:57:28 +0000 (15:57 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 5 Mar 2003 15:57:28 +0000 (15:57 +0000)
ext/gd/libgd/gd_png.c

index 8d5effb5a2fff42dce56f5e432a9a7382c2b28d3..a5850c6511789b7af694cce4a34b8b9c5e37f49c 100644 (file)
@@ -561,9 +561,10 @@ gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile)
     }
   if (im->trueColor && (!im->saveAlphaFlag) && (transparent >= 0))
     {
-      trans_rgb_value.red = gdTrueColorGetRed (im->trueColor);
-      trans_rgb_value.green = gdTrueColorGetGreen (im->trueColor);
-      trans_rgb_value.blue = gdTrueColorGetBlue (im->trueColor);
+       /* 2.0.9: fixed by Thomas Winzig */
+      trans_rgb_value.red = gdTrueColorGetRed (im->transparent);
+      trans_rgb_value.green = gdTrueColorGetGreen (im->transparent);
+      trans_rgb_value.blue = gdTrueColorGetBlue (im->transparent);
       png_set_tRNS (png_ptr, info_ptr, 0, 0, &trans_rgb_value);
     }
   if (!im->trueColor)