bug79615.phpt 387 B

123456789101112131415161718
  1. --TEST--
  2. Bug #79615 (Wrong GIF header written in GD GIFEncode)
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $im = imagecreate(3, 3); // 3x3, 9 colors, 4 bits per pixel
  8. for ($x = 0; $x < 3; $x++) {
  9. for ($y = 0; $y < 3; $y++) {
  10. imagesetpixel($im, $x, $y, imagecolorallocate($im, $x, $y, 0));
  11. }
  12. }
  13. ob_start();
  14. imagegif($im);
  15. echo decbin(ord(ob_get_clean()[0xA]));
  16. ?>
  17. --EXPECT--
  18. 10110011