xref: /PHP-5.3/ext/gd/tests/xpm2jpg.phpt (revision 70650810)
1--TEST--
2xpm --> jpeg conversion test
3--SKIPIF--
4<?php
5	if (!extension_loaded('gd')) {
6		die("skip gd extension not available.");
7	}
8
9	if (!function_exists("imagejpeg")) {
10		die("skip jpeg 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 JPEG conversion: ";
21	echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
22	echo "\n";
23
24	@unlink($cwd . "/test_xpm.jpeg");
25?>
26--EXPECT--
27XPM to JPEG conversion: ok
28