1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/gd/tests/imagecreatefromstring_bmp.phpt
Christoph M. Becker a375d54785 Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

28 lines
1.0 KiB
PHP

--TEST--
imagecreatefromstring() - BMP format
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_BMP)) die('skip BMP support required');
?>
--FILE--
<?php
// create an image from a BMP string representation
$bmp = "\x42\x4D\x3E\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x00\x00\x28\x00"
. "\x00\x00\x0A\x00\x00\x00\x0A\x00\x00\x00\x01\x00\x08\x00\x01\x00"
. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00"
. "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF\xFF\x00\x0A\x00"
. "\x00\x00\x0A\x00\x00\x00\x07\x00\x01\x01\x01\x00\x00\x00\x06\x00"
. "\x01\x01\x01\x00\x02\x00\x00\x00\x05\x00\x01\x01\x01\x00\x03\x00"
. "\x00\x00\x04\x00\x01\x01\x01\x00\x04\x00\x00\x00\x03\x00\x01\x01"
. "\x01\x00\x05\x00\x00\x00\x02\x00\x01\x01\x01\x00\x06\x00\x00\x00"
. "\x0A\x00\x00\x00\x0A\x00\x00\x00\x00\x01";
$im = imagecreatefromstring($bmp);
include_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/imagecreatefromstring_bmp.png', $im);
?>
--EXPECT--
The images are equal.