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