Install libvips JPEG XL support and require it at startup (part of #222) #226

Open
clawbot wants to merge 1 commits from issue-222-jxl-build-support into next
Collaborator

Part 1 of 3 of #222: libvips' JPEG XL support is installed wherever pixa is compiled, tested or run, and pixad does not start without it. JPEG XL is not yet a format in URLs, detection or the docs; that is part 2.

  • script/bootstrap --cgo installs vips-jxl when its package manager is apk: on Alpine, libvips' JPEG XL loader and saver are a package of their own. The nix and brew libvips include them, as does apt's on Debian 12 and 13 and Ubuntu 24.04.
  • The runtime stage of the Dockerfile installs vips-jxl.
  • imgcache.NewService calls the new imageprocessor.CheckJPEGXLSupport before it builds the image processor. That asks govips whether libvips has the JPEG XL loader, and otherwise returns an error naming the fix: install vips-jxl on Alpine, or use a libvips built with libjxl. imageprocessor.New is unchanged.
  • New tests, in a new file, check the support and save an image as JPEG XL with govips and load it back. No existing test changed.

Disclosures:

  • No automated test covers the refusal to start, as the test phase has the support; it was checked by hand by removing vips-jxl from a container of the built image.
  • script/bootstrap looks up its package manager for this only where apk exists, as on apt the lookup also updates the package lists.
  • apt's libvips on Ubuntu 22.04 (8.12) has no JPEG XL support, so pixad will not start there.
  • brew was checked only against the formula, which depends on jpeg-xl, not on a Mac.

Model: opus-5-5

Part 1 of 3 of https://git.eeqj.de/sneak/pixa/issues/222: libvips' JPEG XL support is installed wherever pixa is compiled, tested or run, and `pixad` does not start without it. JPEG XL is not yet a format in URLs, detection or the docs; that is part 2. - `script/bootstrap --cgo` installs `vips-jxl` when its package manager is apk: on Alpine, libvips' JPEG XL loader and saver are a package of their own. The nix and brew libvips include them, as does apt's on Debian 12 and 13 and Ubuntu 24.04. - The runtime stage of the `Dockerfile` installs `vips-jxl`. - `imgcache.NewService` calls the new `imageprocessor.CheckJPEGXLSupport` before it builds the image processor. That asks govips whether libvips has the JPEG XL loader, and otherwise returns an error naming the fix: install `vips-jxl` on Alpine, or use a libvips built with libjxl. `imageprocessor.New` is unchanged. - New tests, in a new file, check the support and save an image as JPEG XL with govips and load it back. No existing test changed. Disclosures: - No automated test covers the refusal to start, as the test phase has the support; it was checked by hand by removing `vips-jxl` from a container of the built image. - `script/bootstrap` looks up its package manager for this only where `apk` exists, as on apt the lookup also updates the package lists. - apt's libvips on Ubuntu 22.04 (8.12) has no JPEG XL support, so `pixad` will not start there. - brew was checked only against the formula, which depends on `jpeg-xl`, not on a Mac. Model: opus-5-5
clawbot added the needs-review label 2026-10-08 03:44:15 +02:00
clawbot self-assigned this 2026-10-08 03:44:15 +02:00
Author
Collaborator

Review failed: needs rework.

  1. Existing tests are modified: TestMain and every call to imageprocessor.New in internal/imageprocessor/imageprocessor_internal_test.go (from line 21), internal/imageprocessor/max_concurrent_processing_internal_test.go (from line 122) and internal/imgcache/max_concurrent_processing_internal_test.go:64, because New now returns an error. The repo's CLAUDE.md requires the owner's explicit approval to change an existing test, and none is on record. Acceptable: New and initVips keep their current signatures, the JPEG XL check is a separate small function that imgcache.NewService calls before it builds the processor (so pixad still refuses to start), and no existing test changes. New tests are fine.

  2. internal/imageprocessor/imageprocessor.go:23: the operator sees only Failed to start: libvips lacks JPEG XL support, which names what is missing but not how to get it. Acceptable: the message also names the fix, for example the vips-jxl package on Alpine, or a libvips built with libjxl.

  3. script/bootstrap:157: the vips-jxl install checks for the apk command itself instead of using the package manager the script picked (nix, apt, brew, then apk, as its header says). On an Alpine host with nix, libvips comes from nix, yet this still runs apk add vips-jxl, which installs Alpine's libvips as well and fails for a user who is not root. Acceptable: install vips-jxl only when the script's chosen package manager is apk.

Model: opus-5-5

Review failed: needs rework. 1. Existing tests are modified: `TestMain` and every call to `imageprocessor.New` in `internal/imageprocessor/imageprocessor_internal_test.go` (from line 21), `internal/imageprocessor/max_concurrent_processing_internal_test.go` (from line 122) and `internal/imgcache/max_concurrent_processing_internal_test.go:64`, because `New` now returns an error. The repo's `CLAUDE.md` requires the owner's explicit approval to change an existing test, and none is on record. Acceptable: `New` and `initVips` keep their current signatures, the JPEG XL check is a separate small function that `imgcache.NewService` calls before it builds the processor (so pixad still refuses to start), and no existing test changes. New tests are fine. 2. `internal/imageprocessor/imageprocessor.go:23`: the operator sees only `Failed to start: libvips lacks JPEG XL support`, which names what is missing but not how to get it. Acceptable: the message also names the fix, for example the `vips-jxl` package on Alpine, or a libvips built with libjxl. 3. `script/bootstrap:157`: the `vips-jxl` install checks for the `apk` command itself instead of using the package manager the script picked (nix, apt, brew, then apk, as its header says). On an Alpine host with nix, libvips comes from nix, yet this still runs `apk add vips-jxl`, which installs Alpine's libvips as well and fails for a user who is not root. Acceptable: install `vips-jxl` only when the script's chosen package manager is apk. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-08 05:12:20 +02:00
clawbot added 1 commit 2026-10-08 05:32:25 +02:00
script/bootstrap --cgo installs vips-jxl when the package manager it
uses is apk, as Alpine's vips package lacks JPEG XL support; the nix
and brew libvips include it, as does apt's from Debian 12 and Ubuntu
24.04 on. The runtime stage of the Dockerfile installs vips-jxl too.

imgcache.NewService calls the new imageprocessor.CheckJPEGXLSupport
before it builds the image processor and fails with its error, which
names the fix, so pixad does not start without the support. JPEG XL
becomes the default output later in the issue. New tests check the
support and save an image as JPEG XL with govips and load it back.

Model: opus-5-5
clawbot force-pushed issue-222-jxl-build-support from 0969cf43bb to 0e345482bc 2026-10-08 05:32:25 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-08 05:55:34 +02:00
Some checks are pending
check / check (push) Waiting to run
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin issue-222-jxl-build-support:issue-222-jxl-build-support
git checkout issue-222-jxl-build-support
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/pixa#226