bug36697.phpt 656 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #36697 (TrueColor transparency with GIF palette output).
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $dest = __DIR__ . "/36697.gif";
  8. $im = imagecreatetruecolor(192, 36);
  9. $trans_color = imagecolorallocate($im, 255, 0, 0);
  10. $color = imagecolorallocate($im, 255, 255, 255);
  11. imagecolortransparent($im, $trans_color);
  12. imagefilledrectangle($im, 0,0, 192,36, $trans_color);
  13. $c = imagecolorat($im, 191,35);
  14. imagegif($im, $dest);
  15. imagedestroy($im);
  16. $im = imagecreatefromgif($dest);
  17. $c = imagecolorat($im, 191, 35);
  18. $colors = imagecolorsforindex($im, $c);
  19. echo $colors['red'] . ' ' . $colors['green'] . ' ' . $colors['blue'];
  20. @unlink($dest);
  21. ?>
  22. --EXPECT--
  23. 255 0 0