bug24155.phpt 676 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #24155 (gdImageRotate270 rotation problem).
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!function_exists("imagerotate")) die("skip requires bundled GD library\n");
  8. ?>
  9. --FILE--
  10. <?php
  11. $dest = dirname(realpath(__FILE__)) . '/bug24155.png';
  12. @unlink($dest);
  13. $im = imagecreatetruecolor(30, 50);
  14. imagefill($im, 0, 0, (16777215 - 255));
  15. $im = imagerotate($im, 270, 255);
  16. imagepng($im, $dest);
  17. $im2 = imagecreatefrompng($dest);
  18. // Uniform fill + n x 90degrees rotation , the color value does not change
  19. $col = imagecolorat($im2, 20, 20);
  20. // 16777215 - 255 = 16776960
  21. echo "$col\n";
  22. @unlink($dest);
  23. ?>
  24. --EXPECT--
  25. 16776960