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