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

Enable AVIF support in GD #152

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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