We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 780a828 + 0ed956d commit a6d1844Copy full SHA for a6d1844
ext/gd/tests/gh13774.phpt
@@ -0,0 +1,25 @@
1
+--TEST--
2
+GH-13774 (Restore Warning instead of Fatal Error in gd_webp.c)
3
+--EXTENSIONS--
4
+gd
5
+--SKIPIF--
6
+<?php
7
+$support = gd_info();
8
+if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
9
+ print 'skip webp support not available';
10
+}
11
+?>
12
+--FILE--
13
14
+$empty_webp = __DIR__ . "/gh13774.webp";
15
+file_put_contents($empty_webp, "");
16
+$im = imagecreatefromwebp($empty_webp);
17
+var_dump($im);
18
19
+--CLEAN--
20
+<?php unlink(__DIR__ . "/gh13774.webp")?>
21
+--EXPECTF--
22
+Warning: imagecreatefromwebp(): gd-webp cannot get webp info in %s on line %d
23
+
24
+Warning: imagecreatefromwebp(): "%s" is not a valid WEBP file in %s on line %d
25
+bool(false)
0 commit comments