diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2016-07-24 14:14:57 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2017-01-04 14:55:02 +0100 |
commit | 500b496f8ee345443d6101d854dd9b0197956212 (patch) | |
tree | 6525f69092df3101d4a67af8f7f0eaefcb2bc5fe /ext/gd/tests/imagebmp_basic.phpt | |
parent | d83828540e7b88f99dd8d5ed4c295e62056e5044 (diff) | |
download | php-git-500b496f8ee345443d6101d854dd9b0197956212.tar.gz |
Implement #69606: Support BMPs (added in GD 2.1.0)
We add PHP bindings for libgd's features to read and write BMP files, which
are available as of libgd 2.1.0.
As PHP's bundled libgd doesn't yet include the respective features of the
external libgd, we add these.
Diffstat (limited to 'ext/gd/tests/imagebmp_basic.phpt')
-rw-r--r-- | ext/gd/tests/imagebmp_basic.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/gd/tests/imagebmp_basic.phpt b/ext/gd/tests/imagebmp_basic.phpt new file mode 100644 index 0000000000..3493d48d60 --- /dev/null +++ b/ext/gd/tests/imagebmp_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +imagebmp() - basic functionality +--SKIPIF-- +<?php +if (!extension_loaded('gd')) die('skip ext/gd required'); +if (!(imagetypes() & IMG_BMP)) die('skip BMP support required'); +?> +--FILE-- +<?php +// create an image +$im = imagecreate(100, 100); +imagecolorallocate($im, 0, 0, 0); +$white = imagecolorallocate($im, 255, 255, 255); +imageline($im, 10,10, 89,89, $white); + +// write the md5 hash of its BMP representation +ob_start(); +imagebmp($im); +echo md5(ob_get_clean()); +?> +--EXPECT-- +d49124076771822b09fa72e168c0de56 |