libgd00191.phpt 601 B

123456789101112131415161718192021222324
  1. --TEST--
  2. libgd FS#191 (A circle becomes square)
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!GD_BUNDLED) die("skip requires bundled GD library\n");
  8. ?>
  9. --FILE--
  10. <?php
  11. $im = imagecreatetruecolor(100, 100);
  12. imagefilledrectangle($im, 0, 0, 100, 100, imagecolorallocate($im, 255, 255, 255));
  13. imagesetthickness($im, 20);
  14. imagefilledellipse($im, 30, 50, 20, 20, imagecolorallocate($im, 0, 0, 0));
  15. $index = imagecolorat($im, 12, 28);
  16. $arr = imagecolorsforindex($im, $index);
  17. if ($arr['red'] == 255 && $arr['green'] == 255 && $arr['blue'] == 255) {
  18. echo "Ok";
  19. } else {
  20. echo "failed";
  21. }
  22. ?>
  23. --EXPECT--
  24. Ok