Skip to content

AVIF image errors #13919

Closed
winlibs/libavif
#3

Description

@ve3

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).

Activity

  1. ndossche commented on Apr 9, 2024

    @ndossche
    Member

    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.

  2. ve3 commented on Apr 11, 2024

    @ve3
    Author

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

  3. ndossche commented on Apr 11, 2024

    @ndossche
    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.

  4. self-assigned this
    on Sep 11, 2024
  5. cmb69 commented on Sep 11, 2024

    @cmb69
    Member

    winlibs/libavif#3 would fix this issue.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions