xref: /php-src/ext/gd/tests/bug41442.phpt (revision 0aaad46c)
1--TEST--
2Bug #41442 (imagegd2() under output control)
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
11    if (!function_exists("imagegd2")) {
12        die("skip GD2 support unavailable");
13    }
14?>
15--FILE--
16<?php
17
18$str = file_get_contents(__DIR__.'/src.gd2');
19$res = imagecreatefromstring($str);
20
21/* string */
22ob_start();
23imagegd2($res);
24$str2 = ob_get_clean();
25var_dump(imagecreatefromstring($str2));
26
27/* file */
28$file = __DIR__."/bug41442.gd2";
29imagegd2($res, $file);
30$str2 = file_get_contents($file);
31var_dump(imagecreatefromstring($str2));
32
33@unlink($file);
34
35echo "Done\n";
36?>
37--EXPECT--
38object(GdImage)#2 (0) {
39}
40object(GdImage)#2 (0) {
41}
42Done
43