summaryrefslogtreecommitdiff
path: root/ext/gd/tests/xpm2jpg.phpt
blob: 3df491ce44effacda8d1217a2e6c8e00059edf8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
xpm --> jpeg conversion test
--SKIPIF--
<?php 
	if (!extension_loaded('gd')) {
		die("skip gd extension not available.");
	}
	if (!GD_BUNDLED) {
		die("skip external GD libraries always fail");
	}
	if (!function_exists("imagejpeg")) {
		die("skip jpeg support unavailable");
	}
	if (!function_exists("imagecreatefromxpm")) {
		die("skip xpm read support unavailable");
	}
?>
--FILE--
<?php
	$cwd = dirname(__FILE__);

	echo "XPM to JPEG conversion: ";
	echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
	echo "\n";
	
	@unlink($cwd . "/test_xpm.jpeg");
?>
--EXPECT--
XPM to JPEG conversion: ok