1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/gd/tests/imagecreatefromstring_avif.phpt
Ben Morss e0e2e9a547 Disable strict pixi requirement for libavif >= 0.9.1
Some AVIF image generators didn't include the PixelInformationProperty
(pixi), even though strictly speaking they should. In v0.9.2, libavif
began requiring this. Let's disable it so we can read those images too.

We also remove xfail from test on FreeBSD.

Closes GH-7253.
2021-08-06 20:24:59 +02:00

30 lines
757 B
PHP

--TEST--
imagecreatefromstring() - AVIF format
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!(imagetypes() & IMG_AVIF)) {
die('skip AVIF support required');
}
?>
--FILE--
<?php
echo "Reading image whose major brand is 'avif':\n";
$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring_major_brand.avif'));
var_dump(imagesx($im));
var_dump(imagesy($im));
echo "Reading image with a compatible brand that's 'avif':\n";
$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring_compatible_brand.avif'));
var_dump(imagesx($im));
var_dump(imagesy($im));
?>
--EXPECT--
Reading image whose major brand is 'avif':
int(250)
int(375)
Reading image with a compatible brand that's 'avif':
int(480)
int(270)