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