From 99c3f2f6bab41b2197c493a0bfae1103d60dccc6 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 14 Sep 2026 20:06:49 +0930 Subject: [PATCH] Default image driver to vips Switch IMAGE_DRIVER default from gd to vips in config/image.php and the shipped .env examples. libvips is faster, lower-memory, and has strong WebP/AVIF support; both libvips and the php-vips extension ship in the official Docker image. ImageDriverManager already maps 'vips' to the installed Intervention Vips driver, so no code change is needed. .env.testing stays on gd because the CI test runners install the gd extension, not php-vips. --- .env.docker.example | 2 +- .env.example | 2 +- config/image.php | 12 ++++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.env.docker.example b/.env.docker.example index 07695379a..34adca7a0 100644 --- a/.env.docker.example +++ b/.env.docker.example @@ -17,7 +17,7 @@ ENABLE_CONFIG_CACHE="true" INSTANCE_DISCOVER_PUBLIC="true" # Media Configuration -IMAGE_DRIVER=gd # vips, gd, imagick +IMAGE_DRIVER=vips # vips, gd, imagick PF_OPTIMIZE_IMAGES="true" IMAGE_QUALITY="80" MAX_PHOTO_SIZE="15000" diff --git a/.env.example b/.env.example index b812bd2d4..0c3ce2156 100644 --- a/.env.example +++ b/.env.example @@ -13,7 +13,7 @@ ENABLE_CONFIG_CACHE="true" INSTANCE_DISCOVER_PUBLIC="true" # Media Configuration -IMAGE_DRIVER=gd # vips, gd, imagick +IMAGE_DRIVER=vips # vips, gd, imagick PF_OPTIMIZE_IMAGES="true" IMAGE_QUALITY="80" MAX_PHOTO_SIZE="15000" diff --git a/config/image.php b/config/image.php index 2df5066b3..f8ba7ad07 100644 --- a/config/image.php +++ b/config/image.php @@ -7,17 +7,21 @@ return [ | Image Driver |-------------------------------------------------------------------------- | - | Intervention Image supports “GD Library” and “Imagick” to process images - | internally. Depending on your PHP setup, you can choose one of them. + | Intervention Image supports "libvips", "GD Library" and "Imagick" to + | process images internally. Depending on your PHP setup, you can choose + | one of them. libvips is the default: it is significantly faster and uses + | far less memory than GD/Imagick, and has strong support for modern + | formats such as WebP and AVIF. It requires the php-vips extension and + | libvips to be installed (both ship in the official Pixelfed image). | | Included options: + | - vips = \Intervention\Image\Drivers\Vips\Driver::class | - gd = \Intervention\Image\Drivers\Gd\Driver::class | - imagick = \Intervention\Image\Drivers\Imagick\Driver::class - | - vips = \Intervention\Image\Drivers\vips\Driver::class | */ - 'driver' => env('IMAGE_DRIVER', 'gd'), + 'driver' => env('IMAGE_DRIVER', 'vips'), /* |--------------------------------------------------------------------------