feat(image): add JPEG XL (jxl) image filter backed by libvips#36224
feat(image): add JPEG XL (jxl) image filter backed by libvips#36224wezell wants to merge 1 commit into
Conversation
Adds a libvips-only JPEG XL encoder filter, mirroring the existing AVIF filter. Encodes via libvips' libjxl delegate (inferred from the .jxl extension) with q/lossless/effort parameters under the jxl_ prefix. Registered under both "jxl" and "jpegxl" keys in VipsImageFilterApiImpl, so it is only reachable when the libvips engine is active (IMAGE_API_USE_LIBVIPS=true and native libvips available, via ImageEngine.resolve()). The legacy engine has no knowledge of these keys, so the filter is simply unavailable when libvips is disabled. No VipsLegacyFilters fallback is wired since JPEG XL has no pure-JVM equivalent. Adds a parity test validating the JPEG XL output signature that skips cleanly when the host libvips lacks the libjxl delegate. Fixes #36223 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @wezell's task in 58s —— View job Rollback Safety Analysis
Result: ✅ Safe to Roll Back All three changed files are pure application-layer code — no database schema, no Elasticsearch mapping, no content model, no stored procedures, and no API contract changes.
Rollback behavior: If this PR is deployed and then rolled back, Label added: |
🤖 Bedrock Review —
|
What
Adds a JPEG XL (
.jxl) image filter backed by libvips, mirroring the existing AVIF filter. JPEG XL is a modern format the legacy pure-JVM (AWT/TwelveMonkeys) engine cannot produce; libvips encodes it via itslibjxldelegate.URL contract:
filter=jxl&jxl_q=75(also aliased asfilter=jpegxl), with optionaljxl_losslessandjxl_effort(1–9).How
VipsJpegXlImageFilter— new filter extendingVipsImageFilter, encoding to.jxlwithQ(quality, default 75),lossless(default off), andeffort(default 7). Modeled directly onVipsAvifImageFilter.VipsImageFilterApiImpl— registers the filter underjxlandjpegxlin the "libvips-only capabilities with no legacy equivalent" block, next toavif/smartcrop.VipsParityTest— adds a test that validates the JPEG XL output signature (raw codestreamFF 0AorJXLISO-BMFF box) and skips cleanly when the host libvips lacks the libjxl delegate.Only available when libvips is enabled
ImageEngine.resolve()returns the libvips engine only whenIMAGE_API_USE_LIBVIPS=trueand native libvips is available. Thejxl/jpegxlkeys live solely inVipsImageFilterApiImpl— the legacyImageFilterApiImplhas no knowledge of them, so when libvips is disabled the filter simply doesn't resolve (no error). Because JPEG XL has no pure-JVM equivalent, noVipsLegacyFiltersfallback entry is added (same approach asavif).Testing
./mvnw compile -pl :dotcms-corepasses.VipsParityTest#jxl_encoder_produces_valid_jxlvalidates the output; itAssume-skips on hosts whose libvips lacks libjxl, keeping CI green.Fixes #36223
🤖 Generated with Claude Code