Skip to content

Commit 0cca369

Browse files
committed
fix avif test
1 parent 8c32be6 commit 0cca369

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ext/gd/tests/avif_decode_encode.phpt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,19 @@ gd
3636
echo_status(imageavif($img, $outfile, -1));
3737

3838
echo 'Encoding AVIF with illegal quality: ';
39-
echo_status(imageavif($img, $outfile, 1234));
39+
try {
40+
imageavif($img, $outfile, 1234);
41+
} catch (\ValueError $e) {
42+
echo $e->getMessage() . PHP_EOL;
43+
}
4044

4145
echo 'Encoding AVIF with illegal speed: ';
42-
echo_status(imageavif($img, $outfile, 70, 1234));
46+
47+
try {
48+
imageavif($img, $outfile, 70, 1234);
49+
} catch (\ValueError $e) {
50+
echo $e->getMessage() . PHP_EOL;
51+
}
4352

4453
echo 'Encoding AVIF losslessly... ';
4554
echo_status(imageavif($img, $outfile, 100, 0));
@@ -66,8 +75,8 @@ Default AVIF encoding: ok
6675
Encoding AVIF at quality 70: ok
6776
Encoding AVIF at quality 70 with speed 5: ok
6877
Encoding AVIF with default quality: ok
69-
Encoding AVIF with illegal quality: ok
70-
Encoding AVIF with illegal speed: ok
78+
Encoding AVIF with illegal quality: imageavif(): Argument #3 ($quality) must be between -1 and 100
79+
Encoding AVIF with illegal speed: imageavif(): Argument #4 ($speed) must be between -1 and 10
7180
Encoding AVIF losslessly... ok
7281
Decoding the AVIF we just wrote...
7382
How many pixels are different in the two images? 0

0 commit comments

Comments
 (0)