Skip to content

Commit

Permalink
Enable AVIF support in GD (#152)
Browse files Browse the repository at this point in the history
* Enable AVIF support in GD.

* Bad copy/paste.

---------

Co-authored-by: desrosj <desrosj@git.wordpress.org>
  • Loading branch information
desrosj and desrosj authored Oct 8, 2024
1 parent d622b00 commit 6bcbe05
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions images/8.1/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libavif-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get upgrade openssl -y; \
update-ca-certificates --fresh; \
sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \
locale-gen; \
\
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr --with-avif=/usr; \
\
docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \
\
Expand Down
4 changes: 2 additions & 2 deletions images/8.2/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libavif-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get upgrade openssl -y; \
update-ca-certificates --fresh; \
sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \
locale-gen; \
\
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr --with-avif=/usr; \
\
docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \
\
Expand Down
4 changes: 2 additions & 2 deletions images/8.3/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libavif-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get upgrade openssl -y; \
update-ca-certificates --fresh; \
sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \
locale-gen; \
\
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr --with-avif=/usr; \
\
docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \
\
Expand Down
4 changes: 2 additions & 2 deletions images/8.4/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libwebp-dev libavif-dev libzip-dev libmemcached-dev unzip libmagickwand-dev ghostscript libonig-dev locales sudo rsync libxslt-dev git; \
apt-get upgrade openssl -y; \
update-ca-certificates --fresh; \
sed -i 's/^# *\(\(ru_RU\|fr_FR\|de_DE\|es_ES\|ja_JP\).UTF-8\)/\1/' /etc/locale.gen; \
locale-gen; \
\
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr; \
docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr --with-avif=/usr; \
\
docker-php-ext-install gd opcache mysqli zip exif intl mbstring xml xsl; \
\
Expand Down
12 changes: 7 additions & 5 deletions update.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
'8.1' => array(
'php' => array(
'base_name' => 'php:8.1-fpm',
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libavif-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ),
'pecl_extensions' => array( 'memcached-3.2.0', 'xdebug-3.3.2', 'imagick' ),
'composer' => true,
Expand All @@ -100,7 +100,7 @@
'8.2' => array(
'php' => array(
'base_name' => 'php:8.2-fpm',
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libavif-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ),
'pecl_extensions' => array( 'memcached-3.2.0', 'xdebug-3.3.2', 'imagick' ),
'composer' => true,
Expand All @@ -114,7 +114,7 @@
'8.3' => array(
'php' => array(
'base_name' => 'php:8.3-fpm',
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libavif-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ),
'pecl_extensions' => array( 'xdebug-3.3.2' ),
'composer' => true,
Expand All @@ -128,7 +128,7 @@
'8.4' => array(
'php' => array(
'base_name' => 'php:8.4-rc-fpm',
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'apt' => array( 'libjpeg-dev', 'libpng-dev', 'libwebp-dev', 'libavif-dev', 'libzip-dev', 'libmemcached-dev', 'unzip', 'libmagickwand-dev', 'ghostscript', 'libonig-dev', 'locales', 'sudo', 'rsync', 'libxslt-dev' ),
'extensions' => array( 'gd', 'opcache', 'mysqli', 'zip', 'exif', 'intl', 'mbstring', 'xml', 'xsl' ),
'pecl_extensions' => array(),
'composer' => true,
Expand Down Expand Up @@ -408,7 +408,9 @@
if ( in_array( 'gd', $config['extensions'], true ) ) {
$install_extensions .= " \\\n\t\\\n\t";

if ( version_compare( $version, '7.4' ) >= 0 ) {
if ( version_compare( $version, '8.1' ) >= 0 ) {
$install_extensions .= "docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr --with-avif=/usr;";
} elseif ( version_compare( $version, '7.4' ) >= 0 ) {
$install_extensions .= "docker-php-ext-configure gd --enable-gd --with-jpeg=/usr --with-webp=/usr;";
} else {
$install_extensions .= "docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr;";
Expand Down

0 comments on commit 6bcbe05

Please sign in to comment.