xref: /PHP-8.3/ext/gd/tests/bug53640.phpt (revision a375d547)
1--TEST--
2Bug #53640 (XBM images require width to be multiple of 8)
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7if (!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);
14imagecolorallocate($im, 0, 0, 0); // background
15$white = imagecolorallocate($im, 255, 255, 255);
16imagefilledrectangle($im, 2, 2, 6, 6, $white);
17imagexbm($im, NULL);
18?>
19--EXPECT--
20#define image_width 9
21#define image_height 9
22static unsigned char image_bits[] = {
23  0xFF, 0x01, 0xFF, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01,
24  0x83, 0x01, 0xFF, 0x01, 0xFF, 0x01};
25