Add AVIF, WebP and MozJPEG output encoding support#75079
Merged
adamsilverstein merged 2 commits intoJan 30, 2026
Merged
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
This commit implements output format conversion for client-side media processing, enabling generation of modern image formats (AVIF, WebP) and modern JPEG codecs (MozJPEG) during upload. Key changes: - Add TranscodeImage operation type for format conversion - Add imageOutputFormats, jpegInterlaced, pngInterlaced, gifInterlaced settings that flow from PHP REST API through the settings stack - Implement transcodeImageItem action using vipsConvertImageFormat - Update prepareItem to check format mapping and add TranscodeImage operations when needed - Add transparency check for PNG->JPEG to preserve alpha channels - Apply format conversion to generated thumbnails - Add MozJPEG optimizations (optimize_coding, quant_table) for JPEG output, providing ~10-15% smaller file sizes The implementation respects WordPress's image_editor_output_format filter for format mapping configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix blob URL memory leak using try/finally pattern for transparency check - Add format validation before ImageFormat type assertion - Improve JSDoc for Settings interface properties - Add clarifying comment for empty filename in image_editor_output_format filter Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0aae361 to
6a6427c
Compare
|
Size Change: +892 B (+0.01%) Total Size: 6.85 MB
ℹ️ View Unchanged
|
6a6427c
into
feature/client-side-media-dev
39 of 40 checks passed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements output format conversion for client-side media processing, enabling generation of modern image formats (AVIF, WebP) and MozJPEG-optimized JPEG encoding during upload.
Fixes #74364
Key changes:
imageOutputFormats,jpegInterlaced,pngInterlaced,gifInterlacedsettings flow from PHP REST API through the settings stackimage_editor_output_formatfilter for configuring output formatsoptimize_codingandquant_tableoptions for ~10-15% smaller file sizesFiles changed:
@wordpress/upload-media@wordpress/vips@wordpress/core-data@wordpress/editor@wordpress/block-editorTest plan
image_editor_output_formatfilter to map PNG → WebP🤖 Generated with Claude Code