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
6675Encoding AVIF at quality 70: ok
6776Encoding AVIF at quality 70 with speed 5: ok
6877Encoding 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
7180Encoding AVIF losslessly... ok
7281Decoding the AVIF we just wrote...
7382How many pixels are different in the two images? 0
0 commit comments