dotCMS / dotCMS/core

Add JPEG XL (jxl) image filter backed by libvips

Open
#36,223 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale Team : Platform Type : Task
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Now that libvips (vips-ffm) is integrated into core, we should expose a JPEG XL encoder as a libvips-backed image filter, mirroring the existing AVIF filter.

JPEG XL (.jxl) is a modern image format that the legacy pure-JVM (AWT/TwelveMonkeys) engine cannot produce. It typically yields smaller files than JPEG at equal quality and supports mathematically lossless encoding. libvips encodes it via its libjxl delegate, inferred from the .jxl output extension.

URL contract: filter=jxl&jxl_q=75 (also aliased as filter=jpegxl), with optional jxl_lossless and jxl_effort (1-9) parameters - matching the parameter convention of the other libvips filters.

This is a libvips-only capability with no legacy equivalent - exactly like avif and smartcrop. It is registered only in VipsImageFilterApiImpl, so it is selectable only when the libvips engine is active (IMAGE_API_USE_LIBVIPS=true and native libvips is present, resolved via ImageEngine.resolve()). When libvips is disabled the legacy engine has no knowledge of the jxl/jpegxl keys, so the filter is simply unavailable (no error). Because there is no JVM fallback for JPEG XL, no VipsLegacyFilters entry is added.

Acceptance Criteria

  • New VipsJpegXlImageFilter encodes images to .jxl via the libvips libjxl delegate
  • Supports q (0-100 quality, default 75), lossless (present = lossless), and effort (1-9, default 7) parameters under the jxl_ prefix
  • Registered under both jxl and jpegxl keys in VipsImageFilterApiImpl (libvips-only block)
  • Filter is available only when libvips is enabled and available; legacy engine does not expose it
  • No legacy/AWT fallback is wired (JPEG XL has no pure-JVM equivalent)
  • Parity test validates JPEG XL output magic bytes and skips cleanly when the host libvips lacks the libjxl delegate

Priority

Medium

Additional Context

Mirrors VipsAvifImageFilter (dotCMS/src/main/java/com/dotmarketing/image/vips/). Requires the host libvips build to include the libjxl delegate; if absent the request fails like AVIF when libheif/AV1 is missing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing VipsAvifImageFilter in dotCMS/src/main/java/com/dotmarketing/image/vips/ with VipsImageFilterApiImpl, then inspect the existing parity tests and ImageEngine.resolve() behavior. Done means both filter keys work only with an available libvips libjxl delegate, the q/lossless/effort parameters are covered, JPEG XL magic bytes are validated, and the test skips cleanly when libjxl is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.