Annotation of embedaddon/php/ext/gd/tests/bug27582_1.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color)
                      3: --SKIPIF--
                      4: <?php
                      5:         if (!extension_loaded('gd')) die("skip gd extension not available\n");
                      6: ?>
                      7: --FILE--
                      8: <?php
                      9: /* $id$ */
                     10: $dest = dirname(realpath(__FILE__)) . '/bug27582.png';
                     11: @unlink($dest);
                     12: $im = ImageCreateTrueColor(10, 10);
                     13: imagealphablending($im, true);
                     14: imagesavealpha($im, true);
                     15: $bordercolor=ImageColorAllocateAlpha($im, 0, 0, 0, 2);
                     16: $color = ImageColorAllocateAlpha($im, 0, 0, 0, 1);
                     17: ImageFillToBorder($im, 5, 5, $bordercolor, $color);
                     18: imagepng($im, $dest);
                     19: 
                     20: $im2 = imagecreatefrompng($dest);
                     21: $col = imagecolorat($im2, 5, 5);
                     22: $color = imagecolorsforindex($im2, $col);
                     23: echo $color['alpha'];
                     24: @unlink($dest);
                     25: ?>
                     26: --EXPECT--
                     27: 1

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>