bug53640.phpt 637 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #53640 (XBM images require width to be multiple of 8)
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.3', '<')) {
  8. die("skip test requires GD 2.2.3 or higher");
  9. }
  10. ?>
  11. --FILE--
  12. <?php
  13. $im = imagecreate(9, 9);
  14. imagecolorallocate($im, 0, 0, 0); // background
  15. $white = imagecolorallocate($im, 255, 255, 255);
  16. imagefilledrectangle($im, 2, 2, 6, 6, $white);
  17. imagexbm($im, NULL);
  18. ?>
  19. --EXPECT--
  20. #define image_width 9
  21. #define image_height 9
  22. static unsigned char image_bits[] = {
  23. 0xFF, 0x01, 0xFF, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01,
  24. 0x83, 0x01, 0xFF, 0x01, 0xFF, 0x01};