xref: /php-src/ext/gd/tests/createfromgd2.phpt (revision 0aaad46c)
1--TEST--
2imagecreatefromgd2
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7    if (!GD_BUNDLED && version_compare(GD_VERSION, '2.3.3', '>=')) {
8        die("skip test requires GD 2.3.2 or older");
9    }
10        if (!function_exists('imagecreatefromgd2')) die("skip gd extension not available\n");
11?>
12--FILE--
13<?php
14$file = __DIR__ . '/src.gd2';
15
16$im2 = imagecreatefromgd2($file);
17echo 'test create from gd2: ';
18echo imagecolorat($im2, 4,4) == 0xffffff ? 'ok' : 'failed';
19echo "\n";
20
21$im3 = imagecreatefromgd2part($file, 4,4, 2,2);
22echo 'test create from gd2 part: ';
23echo imagecolorat($im2, 4,4) == 0xffffff ? 'ok' : 'failed';
24echo "\n";
25?>
26--EXPECT--
27test create from gd2: ok
28test create from gd2 part: ok
29