xref: /PHP-7.4/ext/gd/tests/xpm2gd.phpt (revision 26dfce7f)
1--TEST--
2xpm --> gd1/gd2 conversion test
3--SKIPIF--
4<?php
5	if (!extension_loaded('gd')) {
6		die("skip gd extension not available.");
7	}
8
9	if (!function_exists("imagecreatefromxpm")) {
10		die("skip xpm read support unavailable");
11	}
12?>
13--FILE--
14<?php
15	$cwd = __DIR__;
16
17	echo "XPM to GD1 conversion: ";
18	echo imagegd(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd1") ? 'ok' : 'failed';
19	echo "\n";
20
21	echo "XPM to GD2 conversion: ";
22	echo imagegd2(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.gd2") ? 'ok' : 'failed';
23	echo "\n";
24
25	@unlink($cwd . "/test_xpm.gd1");
26	@unlink($cwd . "/test_xpm.gd2");
27?>
28--EXPECT--
29XPM to GD1 conversion: ok
30XPM to GD2 conversion: ok
31