xref: /php-src/ext/gd/tests/xpm2jpg.phpt (revision a375d547)
1--TEST--
2xpm --> jpeg conversion test
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7    if (!function_exists("imagejpeg")) {
8        die("skip jpeg support unavailable");
9    }
10    if (!function_exists("imagecreatefromxpm")) {
11        die("skip xpm read support unavailable");
12    }
13?>
14--FILE--
15<?php
16    $cwd = __DIR__;
17
18    echo "XPM to JPEG conversion: ";
19    echo imagejpeg(imagecreatefromxpm($cwd . "/conv_test.xpm"), $cwd . "/test_xpm.jpeg") ? 'ok' : 'failed';
20    echo "\n";
21
22    @unlink($cwd . "/test_xpm.jpeg");
23?>
24--EXPECT--
25XPM to JPEG conversion: ok
26