imagebmp_basic.phpt 518 B

12345678910111213141516171819202122
  1. --TEST--
  2. imagebmp() - basic functionality
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('gd')) die('skip ext/gd required');
  6. if (!(imagetypes() & IMG_BMP)) die('skip BMP support required');
  7. ?>
  8. --FILE--
  9. <?php
  10. // create an image
  11. $im = imagecreate(100, 100);
  12. imagecolorallocate($im, 0, 0, 0);
  13. $white = imagecolorallocate($im, 255, 255, 255);
  14. imageline($im, 10,10, 89,89, $white);
  15. // write the md5 hash of its BMP representation
  16. ob_start();
  17. imagebmp($im);
  18. echo md5(ob_get_clean());
  19. ?>
  20. --EXPECT--
  21. d49124076771822b09fa72e168c0de56