xref: /PHP-8.2/ext/gd/tests/gh13774.phpt (revision 6d0db528)
1--TEST--
2GH-13774 (Restore Warning instead of Fatal Error in gd_webp.c)
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7$support = gd_info();
8if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
9    print 'skip webp support not available';
10}
11?>
12--FILE--
13<?php
14$empty_webp = __DIR__ . "/gh13774.webp";
15file_put_contents($empty_webp, "");
16$im = imagecreatefromwebp($empty_webp);
17var_dump($im);
18?>
19--CLEAN--
20<?php unlink(__DIR__ . "/gh13774.webp")?>
21--EXPECTF--
22Warning: imagecreatefromwebp(): gd-webp cannot get webp info in %s on line %d
23
24Warning: imagecreatefromwebp(): "%s" is not a valid WEBP file in %s on line %d
25bool(false)
26