xref: /PHP-8.0/ext/gd/tests/gif2jpg.phpt (revision c5401854)
1--TEST--
2gif --> 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("imagecreatefromgif")) {
13        die("skip gif read support unavailable");
14    }
15?>
16--FILE--
17<?php
18    $cwd = __DIR__;
19
20    echo "GIF to JPEG conversion: ";
21    echo imagejpeg(imagecreatefromgif($cwd . "/conv_test.gif"), $cwd . "/test_gif.jpeg") ? 'ok' : 'failed';
22    echo "\n";
23
24    @unlink($cwd . "/test_gif.jpeg");
25?>
26--EXPECT--
27GIF to JPEG conversion: ok
28