Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
39ee08c
Add initial core VIPS integration, tests, and local-env hooks
nickchomey Feb 15, 2026
dca1845
Refine VIPS capability detection and clean debug-data loading
nickchomey Feb 15, 2026
84784a5
Expand VIPS parity with GD/Imagick behavior and tests
nickchomey Feb 15, 2026
4ae8f52
Incorporate beneficial MIME support improvements from VIPS fork
nickchomey Feb 15, 2026
0f101fe
Fix stream wrapper registration to check if already registered
nickchomey Feb 16, 2026
701d20a
Add alpha preservation tests and remove test_directory_creation (Imag…
nickchomey Feb 16, 2026
a58b726
PHPCS: Fix coding standard violations in WP_Image_Editor_Vips
nickchomey Sep 25, 2026
d33a372
PHPStan: Fix static analysis errors in WP_Image_Editor_Vips
nickchomey Sep 25, 2026
1689761
Composer: Move jcupitt/vips out of runtime requirements
nickchomey Sep 25, 2026
b9132fc
Media: Register VIPS image editor last instead of first
nickchomey Sep 25, 2026
2e9fdbc
VIPS: Fix temp file leak in encoder support probe
nickchomey Sep 25, 2026
652f320
Update API: Report VIPS JPEG XL support instead of hardcoding false
nickchomey Sep 25, 2026
2d6d53f
Update API: Load VIPS editor safely and gate reporting on a working b…
nickchomey Sep 25, 2026
31c5705
Admin: Fix VIPS capability detection in debug data and site health
nickchomey Sep 25, 2026
9dedb56
VIPS: Remove redundant destructor nulling
nickchomey Sep 25, 2026
f14855a
Docs: Update @since tags for the VIPS image editor
nickchomey Sep 25, 2026
7c77bd8
Local env: Document VIPS container dependencies
nickchomey Sep 25, 2026
e73b763
Local env: Resolve the VIPS compose file from the repo root
nickchomey Sep 25, 2026
da3867a
Tests: Assert VIPS flip behaviour instead of internals
nickchomey Sep 25, 2026
40c1b49
Local env: Build the VIPS image on env:start
nickchomey Sep 25, 2026
7c2c35b
Media: Prefer the VIPS editor when available
nickchomey Sep 25, 2026
b86cabf
VIPS: Honour the image_strip_meta filter
nickchomey Sep 25, 2026
b54aef6
Tests: Cover repeated reads from a single VIPS editor instance
nickchomey Sep 25, 2026
6f9c2b0
Local env: Give the VIPS image its own tag and build it in one layer
nickchomey Sep 25, 2026
aee40ce
Vendor jcupitt/vips and psr/log into src/wp-includes
nickchomey Sep 25, 2026
afe4630
Local env: Default the php-vips installer to the latest release
nickchomey Sep 25, 2026
4d91a7b
Tests: Cover the image editor fallback when libvips is unavailable
nickchomey Sep 25, 2026
5053415
Vips: Strip metadata only when the image is resized, matching Imagick
nickchomey Sep 25, 2026
3207cef
Vips: Document the FFI and libvips requirement
nickchomey Sep 25, 2026
6e7a279
Tests: Explain what the editor fallback tests distinguish
nickchomey Sep 25, 2026
2f5763d
Local env: Add the HEIC and AVIF encoders to the VIPS image
nickchomey Sep 25, 2026
c7dd394
Vips: Fix infinite recursion when loading HEIC and AVIF images
nickchomey Sep 25, 2026
b397a79
Vendor: Record the vendored php-vips ref and commit in the autoloader
nickchomey Sep 25, 2026
939c31e
Local env: Give the CLI container libvips too
nickchomey Sep 25, 2026
3cac63b
Vips: Handle lossless WebP quality like the other editors
nickchomey Sep 25, 2026
1f7fb41
Vips: Probe encoder support in memory instead of through a temp file
nickchomey Sep 25, 2026
a645c46
Vips: Apply the EXIF orientation with autorot() so no stale tag remains
nickchomey Sep 25, 2026
a71e9db
Vips: Add _resize() and make_subsize()
nickchomey Sep 25, 2026
c730360
Tests: Cover EXIF orientation removal on rotate for Vips
nickchomey Sep 25, 2026
e4f8943
Vips: Reset the EXIF orientation when rotating or flipping
nickchomey Sep 25, 2026
7f6d755
Tests: Cover directory creation when saving for Vips
nickchomey Sep 25, 2026
22fa831
Tests: Cover 16-bit and palette images for Vips
nickchomey Sep 25, 2026
45d17b9
Vips: Keep paletted PNGs paletted when saving
nickchomey Sep 25, 2026
7acdd1b
Vips: Build multi_resize on make_subsize
nickchomey Sep 26, 2026
f9b1747
Vips: Compress PNGs like the Imagick editor
nickchomey Sep 26, 2026
0bbef64
Vips: Honour the image_max_bit_depth filter
nickchomey Sep 26, 2026
c4ced60
Vips: Only read EXIF when the extension is available
nickchomey Sep 26, 2026
a64084a
Site Health: Describe VIPS as the preferred image editor
nickchomey Sep 26, 2026
ad2144f
Vips: Query the save suffixes before probing encoders
nickchomey Sep 26, 2026
2d3b1d2
Vips: Fold the mime support helpers together
nickchomey Sep 26, 2026
553a07a
Vips: Stop listing JPEG XL as a supported format
nickchomey Sep 26, 2026
405f35e
Vips: Simplify the mime support check
nickchomey Sep 26, 2026
e98bbf9
Vips: Cache the save suffix list in a property
nickchomey Sep 26, 2026
6083de0
Tests: Cover streaming of lossless WebP and paletted PNG for Vips
nickchomey Sep 26, 2026
084e31a
Vips: Share the save options between saving and streaming
nickchomey Sep 26, 2026
4bb837c
Vips: reorder some methods
nickchomey Sep 26, 2026
8a51aef
Vips: Determine the environment support once
nickchomey Sep 26, 2026
ebd6d5c
Tests: Cover the resized flag after generating sub-sizes
nickchomey Sep 26, 2026
b3093e8
Vips: Restore the resized flag in make_subsize
nickchomey Sep 26, 2026
df19ed3
Vips: Memoize the environment check without a property
nickchomey Sep 26, 2026
6f8f8e5
Vips: Make the bit depth helper static
nickchomey Sep 26, 2026
e2b1021
Vips: Require libvips 8.13
nickchomey Oct 7, 2026
7d931dc
Vips: Add a filterable resampling kernel
nickchomey Oct 7, 2026
726a01b
Vips: Optimise JPEG Huffman coding
nickchomey Oct 7, 2026
9b303c5
Vips: Apply image_save_progressive as interlace
nickchomey Oct 7, 2026
202c6ab
Vips: Default AVIF encoding to effort 3
nickchomey Oct 7, 2026
c33d647
Vips: Reject truncated images on load
nickchomey Oct 7, 2026
9a10a3a
Vips: Restrict loaders and block untrusted ones
nickchomey Oct 7, 2026
f073cb3
Vips: Cap the decoded pixel count
nickchomey Oct 7, 2026
5c04394
Vips: Require libvips 8.15
nickchomey Oct 7, 2026
8de1551
Vips: Keep colour and descriptive profiles when stripping
nickchomey Oct 7, 2026
8c7f69a
Vips: Remove metadata libvips 8.16 drops but 8.15 keeps
nickchomey Oct 7, 2026
cc571ea
Vips: Reference the image_save_progressive filter documentation
nickchomey Oct 7, 2026
efe53ee
Vips: Test that truncated images are rejected
nickchomey Oct 7, 2026
5063bc5
Vips: Test saving as AVIF
nickchomey Oct 7, 2026
4c465b7
Vips: Test that rotating moves the pixels
nickchomey Oct 7, 2026
a978d04
Vips: Test both flip axes
nickchomey Oct 7, 2026
c450076
Vips: Test the minimum libvips version
nickchomey Oct 7, 2026
908df80
Vips: Support libvips 8.13, using the `keep` mask only where it exists
nickchomey Oct 7, 2026
77053b8
Vips: Decide the metadata reduction in one place
nickchomey Oct 7, 2026
f3e49a2
Vips: Test that resizing an animated GIF saves one frame
nickchomey Oct 7, 2026
e498404
Vips: Test the truncation case fail_on is responsible for
nickchomey Oct 7, 2026
ce422e7
Vips: Explain the pixel cap instead of citing a format limit
nickchomey Oct 12, 2026
4072bd4
Vips: Match Imagick on failed stream reads and WebP quality 100
nickchomey Oct 12, 2026
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"ext-curl": "*",
"ext-dom": "*",
"ext-exif": "*",
"ext-ffi": "*",
"ext-fileinfo": "*",
"ext-filter": "*",
"ext-ftp": "*",
Expand Down
31 changes: 31 additions & 0 deletions docker-compose.vips.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
php:
# The VIPS image gets its own tag. Building it over the base image's tag would
# overwrite the base, so each rebuild would stack another layer on the previous
# build's output instead of on the base. The overlayfs layer limit is low enough
# that a couple of rebuilds would then break both the build and container creation.
image: wordpressdevelop/php-vips:${LOCAL_PHP-latest}

build:
context: .
dockerfile: tools/local-env/php-vips/Dockerfile
args:
LOCAL_PHP: ${LOCAL_PHP-latest}

# `up` only builds when the image is missing, and the base image is always present,
# so without this the VIPS image would never be built and the VIPS tests would skip.
pull_policy: build

cli:
# WP-CLI image operations (`wp media regenerate`, `wp media import`) run in this
# container, so it needs the same backend. It gets its own tag for the same reason as
# the php service above.
image: wordpressdevelop/cli-vips:${LOCAL_PHP-latest}

build:
context: .
dockerfile: tools/local-env/cli-vips/Dockerfile
args:
LOCAL_PHP: ${LOCAL_PHP-latest}

pull_policy: build
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<exclude-pattern>/src/wp-includes/PHPMailer/*</exclude-pattern>
<exclude-pattern>/src/wp-includes/Requests/*</exclude-pattern>
<exclude-pattern>/src/wp-includes/php-ai-client/*</exclude-pattern>
<exclude-pattern>/src/wp-includes/php-vips/*</exclude-pattern>
<exclude-pattern>/src/wp-includes/SimplePie/*</exclude-pattern>
<exclude-pattern>/src/wp-includes/sodium_compat/*</exclude-pattern>
<exclude-pattern>/src/wp-includes/Text/*</exclude-pattern>
Expand Down
60 changes: 60 additions & 0 deletions src/wp-admin/includes/class-wp-debug-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,22 @@ private static function get_wp_server(): array {
'debug' => $imagick_loaded,
);

$ffi_loaded = extension_loaded( 'ffi' );

$fields['ffi_availability'] = array(
'label' => __( 'Is the PHP FFI extension available?' ),
'value' => ( $ffi_loaded ? __( 'Yes' ) : __( 'No' ) ),
'debug' => $ffi_loaded,
);

$vips_loaded = class_exists( 'Jcupitt\\Vips\\Image' );

$fields['vips_availability'] = array(
'label' => __( 'Is the libvips PHP library available?' ),
'value' => ( $vips_loaded ? __( 'Yes' ) : __( 'No' ) ),
'debug' => $vips_loaded,
);

// Opcode Cache.
if ( function_exists( 'opcache_get_status' ) ) {
$opcache_status = @opcache_get_status( false ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Warning emitted in failure case.
Expand Down Expand Up @@ -664,6 +680,20 @@ private static function get_wp_media(): array {
'value' => ( $imagick_version ) ? $imagick_version : __( 'Not available' ),
);

$vips_version = $not_available;
if ( class_exists( 'Jcupitt\\Vips\\Config' ) ) {
try {
$vips_version = Jcupitt\Vips\Config::version();
} catch ( Exception $e ) {
$vips_version = __( 'Unable to determine' );
}
}

$fields['vips_version'] = array(
'label' => __( 'libvips version' ),
'value' => $vips_version,
);

// Get the PHP ini directive values.
$file_uploads = ini_get( 'file_uploads' );
$post_max_size = ini_get( 'post_max_size' );
Expand Down Expand Up @@ -794,6 +824,36 @@ private static function get_wp_media(): array {
);
}

if ( extension_loaded( 'ffi' ) && ! class_exists( 'WP_Image_Editor_Vips' ) ) {
require_once ABSPATH . WPINC . '/class-wp-image-editor.php';
require_once ABSPATH . WPINC . '/class-wp-image-editor-vips.php';
}

if ( class_exists( 'WP_Image_Editor_Vips' ) && WP_Image_Editor_Vips::test() ) {
$vips_image_formats = array();
$vips_formats = array(
'JPEG' => 'image/jpeg',
'PNG' => 'image/png',
'GIF' => 'image/gif',
'WebP' => 'image/webp',
'HEIC' => 'image/heic',
'AVIF' => 'image/avif',
);

foreach ( $vips_formats as $vips_label => $vips_mime_type ) {
if ( WP_Image_Editor_Vips::supports_mime_type( $vips_mime_type ) ) {
$vips_image_formats[] = $vips_label;
}
}

if ( ! empty( $vips_image_formats ) ) {
$fields['vips_formats'] = array(
'label' => __( 'libvips supported file formats' ),
'value' => implode( ', ', $vips_image_formats ),
);
}
}

// Get Ghostscript information, if available.
if ( function_exists( 'exec' ) ) {
$gs = exec( 'gs --version' );
Expand Down
9 changes: 9 additions & 0 deletions src/wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,15 @@ public function get_test_php_extensions() {
'required' => false,
'fallback_for' => 'zip',
),
/*
* VIPS is the preferred image editor when it is available, so its result is
* always reported rather than only being checked when another editor has
* already failed. It has no fallback itself because it is the first choice.
*/
'vips' => array(
'extension' => 'ffi',
'required' => false,
),
);

/**
Expand Down
9 changes: 5 additions & 4 deletions src/wp-includes/class-wp-image-editor-imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIAN
/**
* Filters whether to strip metadata from images when they're resized.
*
* This filter only applies when resizing using the Imagick editor since GD
* always strips profiles by default.
* This filter only applies when resizing using the Imagick or VIPS editors,
* since GD always strips profiles by default.
*
* @since 4.5.0
*
Expand Down Expand Up @@ -790,8 +790,9 @@ protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIAN
/**
* Filters the maximum bit depth of resized images.
*
* This filter only applies when resizing using the Imagick editor since GD
* does not support getting or setting bit depth.
* This filter applies when resizing using the Imagick or VIPS editors. GD does
* not support getting or setting bit depth, and VIPS can only honour it for the
* encoders that accept a bit depth.
*
* Use this to adjust the maximum bit depth of resized images.
*
Expand Down
Loading
Loading