Skip to content

AVIF encoding not working in WordPress Docker images due to missing recommended dependency #996

@b1ink0

Description

@b1ink0

The WordPress Docker images cannot encode AVIF images using ImageMagick/Imagick, despite having AVIF decoding support. This occurs because the libheif-plugin-aomenc package (the AVIF encoder) is removed when recommended packages are stripped from the image.

When attempting to convert images to AVIF format using Imagick, the following error occurs:

no encode delegate for this image format `AVIF' @ error/constitute.c/WriteImage/1412

The queryFormats check passes for "AVIF" because the decoder is present, but encoding fails.

The issue seems to stem from the Dockerfile template's package installation process:

  1. libmagickwand-dev is installed at:

    libmagickwand-dev \

  2. Recommended packages are removed at:

    apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \

Dependency chain:

Here, libheif-plugin-dav1d is the decoder and is a hard dependency and libheif-plugin-aomdec is a encoder but it is a recommended dependency (ref: https://packages.debian.org/trixie/libheif1). It is not included in the WordPress Docker image because recommended packages are removed, causing the loss of encoder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions