Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVIF image errors #13919

Open
ve3 opened this issue Apr 9, 2024 · 3 comments
Open

AVIF image errors #13919

ve3 opened this issue Apr 9, 2024 · 3 comments

Comments

@ve3
Copy link

ve3 commented Apr 9, 2024

Description

The following code:

<?php
$image = imagecreatefromavif('image.avif');

Resulted in this output:
There are different errors.
If you downloaded image from https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Apple/multilayer_examples where file name is animals_00_multilayer_a1lx.avif
The result on Windows will be:

Warning: imagecreatefromavif(): avif error - Could not parse image: No AV1 items found

The result on Linux will be:

Notice: imagecreatefromavif(): Image's color profile is not sRGB

If you downloaded image file name animals_00_multilayer_grid_a1lx.avif
The result on Windows will be:

Warning: imagecreatefromavif(): avif error - Could not parse image: Invalid image grid

The result on Linux will be:

Notice: imagecreatefromavif(): Image's color profile is not sRGB

If you downloaded image file name animals_00_singlelayer.avif
The result on Windows will be:

Notice: imagecreatefromavif(): Image's color profile is not sRGB

The result on Linux will be:

Notice: imagecreatefromavif(): Image's color profile is not sRGB

But I expected this output instead:

\GdImage

PHP Version

PHP 8.3.1, PHP 8.3.4

Operating System

Windows 11 x64, Debian (based on Docker php:8.3-apache).

@nielsdos
Copy link
Member

nielsdos commented Apr 9, 2024

This is because the Windows builds ship an older version of libavif which does not work with these files.
We need to look into upgrading the libavif version we ship with the Windows builds.

@ve3
Copy link
Author

ve3 commented Apr 11, 2024

There is different error on Debian (Docker php:8.3-apache). Updated on the post.

@nielsdos
Copy link
Member

There is different error on Debian (Docker php:8.3-apache). Updated on the post.

The notice is non-fatal.
The transfer characteristics are sRGB for the first test tile, but the color primaries are SMPTE432.
Looking at the primaries in the CIE chromaticity diagram for SMPTE432 (https://en.wikipedia.org/wiki/DCI-P3#/media/File:CIE1931xy_gamut_comparison_of_sRGB_P3_Rec2020.svg) shows that the don't have the same primaries as sRGB. So the image isn't sRGB indeed. The notice is therefore expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants