bug64641.phpt 774 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. --TEST--
  2. Bug #64641 (imagefilledpolygon doesn't draw horizontal line)
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.2', '<')) {
  8. die("skip test requires GD 2.2.2 or higher");
  9. }
  10. ?>
  11. --FILE--
  12. <?php
  13. require_once __DIR__ . '/similarity.inc';
  14. $im = imagecreatetruecolor(640, 480);
  15. $points = array(
  16. 100, 100,
  17. 100, 200,
  18. 100, 300
  19. );
  20. imagefilledpolygon($im, $points, 0xFFFF00);
  21. $points = array(
  22. 300, 200,
  23. 400, 200,
  24. 500, 200
  25. );
  26. imagefilledpolygon($im, $points, 0xFFFF00);
  27. $ex = imagecreatefrompng(__DIR__ . '/bug64641.png');
  28. if (($diss = calc_image_dissimilarity($ex, $im)) < 1e-5) {
  29. echo "IDENTICAL";
  30. } else {
  31. echo "DISSIMILARITY: $diss";
  32. }
  33. imagedestroy($ex);
  34. imagedestroy($im);
  35. ?>
  36. --EXPECT--
  37. IDENTICAL