Skip to content

Commit 8ea035d

Browse files
committed
Add tests and test images
1 parent 302baab commit 8ea035d

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--TEST--
2+
imagecreatefromstring() - AVIF format
3+
--EXTENSIONS--
4+
gd
5+
--SKIPIF--
6+
<?php
7+
if (!(imagetypes() & IMG_AVIF)) {
8+
die('skip AVIF support required');
9+
}
10+
?>
11+
--FILE--
12+
<?php
13+
echo "Reading image whose major brand is 'avif':\n";
14+
$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring_major_brand.avif'));
15+
var_dump(imagesx($im));
16+
var_dump(imagesy($im));
17+
18+
echo "Reading image with a compatible brand that's 'avif':\n";
19+
$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring_compatible_brand.avif'));
20+
var_dump(imagesx($im));
21+
var_dump(imagesy($im));
22+
?>
23+
--EXPECT--
24+
Reading image whose major brand is 'avif':
25+
int(250)
26+
int(375)
27+
Reading image with a compatible brand that's 'avif':
28+
int(480)
29+
int(270)
Binary file not shown.
Binary file not shown.

ext/standard/tests/image/getimagesize.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,19 @@ array(16) {
3939
["mime"]=>
4040
string(9) "image/bmp"
4141
}
42+
["test1pix.avif"]=>
43+
array(5) {
44+
[0]=>
45+
int(0)
46+
[1]=>
47+
int(0)
48+
[2]=>
49+
int(19)
50+
[3]=>
51+
string(20) "width="0" height="0""
52+
["mime"]=>
53+
string(10) "image/avif"
54+
}
4255
["test12pix.webp"]=>
4356
array(6) {
4457
[0]=>
1.25 KB
Binary file not shown.

0 commit comments

Comments
 (0)