From 83180f20c701126cfbc385dc348d0d008d105546 Mon Sep 17 00:00:00 2001 From: Leo Fidjeland Date: Sun, 20 Sep 2026 14:55:28 +0200 Subject: [PATCH] Add imagemagick-heic to the Alpine variants Alpine packages ImageMagick's coders separately and the base "imagemagick" package ships none of them, so on the Alpine images Imagick::queryFormats('AVIF') is empty, WP_Image_Editor_Imagick::supports_mime_type('image/avif') returns false, and _wp_image_editor_choose() falls back to WP_Image_Editor_GD. That fallback is lossy: GD's imageavif() discards the ICC profile and tags the output sRGB, so uploads carrying Adobe RGB or Display P3 profiles get reinterpreted as sRGB and render desaturated. Nothing errors, which makes it easy to miss - the AVIF files are produced successfully, just without their colour information. AV1 encoding needs no new dependency: libheif-aom comes in with imagemagick-heic, and libavif/aom-libs are already present for GD's --with-avif. The image grows 3 MB, from 310.4 MB to 313.4 MB. Verified against latest/php8.3/fpm-alpine: a JPEG carrying a 560-byte Adobe RGB profile round-trips through AVIF with the profile intact. --- Dockerfile.template | 3 +++ beta/php8.2/fpm-alpine/Dockerfile | 3 +++ beta/php8.3/fpm-alpine/Dockerfile | 3 +++ beta/php8.4/fpm-alpine/Dockerfile | 3 +++ beta/php8.5/fpm-alpine/Dockerfile | 3 +++ latest/php8.2/fpm-alpine/Dockerfile | 3 +++ latest/php8.3/fpm-alpine/Dockerfile | 3 +++ latest/php8.4/fpm-alpine/Dockerfile | 3 +++ latest/php8.5/fpm-alpine/Dockerfile | 3 +++ 9 files changed, 27 insertions(+) diff --git a/Dockerfile.template b/Dockerfile.template index 232c84cd56..220294b08f 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; {{ ) else ( -}} RUN set -eux; \ diff --git a/beta/php8.2/fpm-alpine/Dockerfile b/beta/php8.2/fpm-alpine/Dockerfile index 7544b329b1..0bf26931f5 100644 --- a/beta/php8.2/fpm-alpine/Dockerfile +++ b/beta/php8.2/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/beta/php8.3/fpm-alpine/Dockerfile b/beta/php8.3/fpm-alpine/Dockerfile index 7da28f68b4..4e77364c18 100644 --- a/beta/php8.3/fpm-alpine/Dockerfile +++ b/beta/php8.3/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/beta/php8.4/fpm-alpine/Dockerfile b/beta/php8.4/fpm-alpine/Dockerfile index a2589705df..b830739273 100644 --- a/beta/php8.4/fpm-alpine/Dockerfile +++ b/beta/php8.4/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/beta/php8.5/fpm-alpine/Dockerfile b/beta/php8.5/fpm-alpine/Dockerfile index 10f35de50a..1c81c171b0 100644 --- a/beta/php8.5/fpm-alpine/Dockerfile +++ b/beta/php8.5/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/latest/php8.2/fpm-alpine/Dockerfile b/latest/php8.2/fpm-alpine/Dockerfile index 7544b329b1..0bf26931f5 100644 --- a/latest/php8.2/fpm-alpine/Dockerfile +++ b/latest/php8.2/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/latest/php8.3/fpm-alpine/Dockerfile b/latest/php8.3/fpm-alpine/Dockerfile index 7da28f68b4..4e77364c18 100644 --- a/latest/php8.3/fpm-alpine/Dockerfile +++ b/latest/php8.3/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/latest/php8.4/fpm-alpine/Dockerfile b/latest/php8.4/fpm-alpine/Dockerfile index a2589705df..b830739273 100644 --- a/latest/php8.4/fpm-alpine/Dockerfile +++ b/latest/php8.4/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions) diff --git a/latest/php8.5/fpm-alpine/Dockerfile b/latest/php8.5/fpm-alpine/Dockerfile index 10f35de50a..1c81c171b0 100644 --- a/latest/php8.5/fpm-alpine/Dockerfile +++ b/latest/php8.5/fpm-alpine/Dockerfile @@ -15,6 +15,9 @@ RUN set -eux; \ ghostscript \ # Alpine package for "imagemagick" contains ~120 .so files, see: https://github.com/docker-library/wordpress/pull/497 imagemagick \ +# Alpine packages ImageMagick's coders separately; without this Imagick reports no AVIF +# support and WordPress silently falls back to GD, which discards ICC profiles + imagemagick-heic \ ; # install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)