[PR #25599] feat: jxl browser support detection #18309

Open
opened 2026-02-05 16:36:15 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/25599
Author: @nicosemp
Created: 1/28/2026
Status: 🔄 Open

Base: mainHead: nicosemp/feat-jxl-browser-support-detection


📝 Commits (1)

  • f1021e1 feat: jxl browser support detection

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 web/src/lib/utils/asset-utils.ts (+10 -1)

📄 Description

Description

Besides Safari, other browsers support (or are adding support) to JPEG XL images. One example is Zen Browser, which inherited the flag from Firefox's upstream and enabled it by default.
This means that adding support for more and more browsers one by one can be problematic.

At the same time, there is an easy and fast way to detect whether a browser supports JPEG XL images. It involves creating an Image object, assigning a minimal image/jxl payload to its src and monitoring the async loading with an event listener.

Fixes # (issue)

How Has This Been Tested?

  • Run this test code from any browser's console:
const img = new Image();
img.addEventListener('load', () => alert('yes'));
img.addEventListener('error', () => alert('no'));
img.src = 'data:image/jxl;base64,/woIAAAMABKIAgC4AF3lEgA=';

It will show an alert with:

  • yes if supported, expected in these browsers as of 2026-01-28:
    • Safari
    • Zen Browser
    • Firefox, with the image.jxl.enabled set to true in about:config. Otherwise no
  • no if not supported

Screenshots (if appropriate)

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
    • I'm not sure how a test could check this change, but I'm happy to add any specific test if required
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

No LLM.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/25599 **Author:** [@nicosemp](https://github.com/nicosemp) **Created:** 1/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `nicosemp/feat-jxl-browser-support-detection` --- ### 📝 Commits (1) - [`f1021e1`](https://github.com/immich-app/immich/commit/f1021e1c5d628c00982a1c41f69e530214ed79f3) feat: jxl browser support detection ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `web/src/lib/utils/asset-utils.ts` (+10 -1) </details> ### 📄 Description ## Description <!--- Describe your changes in detail --> <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> Besides Safari, other browsers support (or are adding support) to JPEG XL images. One example is Zen Browser, which inherited the flag from Firefox's upstream and enabled it by default. This means that adding support for more and more browsers one by one can be problematic. At the same time, there is an easy and fast way to detect whether a browser supports JPEG XL images. It involves creating an Image object, assigning a minimal `image/jxl` payload to its `src` and monitoring the async loading with an event listener. Fixes # (issue) ## How Has This Been Tested? <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> - [x] Run this test code from any browser's console: ```js const img = new Image(); img.addEventListener('load', () => alert('yes')); img.addEventListener('error', () => alert('no')); img.src = 'data:image/jxl;base64,/woIAAAMABKIAgC4AF3lEgA='; ``` It will show an alert with: - `yes` if supported, expected in these browsers as of 2026-01-28: - Safari - Zen Browser - Firefox, with the `image.jxl.enabled` set to `true` in `about:config`. Otherwise no - `no` if not supported <details><summary><h2>Screenshots (if appropriate)</h2></summary> <!-- Images go below this line. --> </details> <!-- API endpoint changes (if relevant) ## API Changes The `/api/something` endpoint is now `/api/something-else` --> ## Checklist: - [x] I have performed a self-review of my own code - [x] I have made corresponding changes to the documentation if applicable - [x] I have no unrelated changes in the PR. - [x] I have confirmed that any new dependencies are strictly necessary. - [x] I have written tests for new code (if applicable) - I'm not sure how a test could check this change, but I'm happy to add any specific test if required - [x] I have followed naming conventions/patterns in the surrounding code - [x] All code in `src/services/` uses repositories implementations for database calls, filesystem operations, etc. - [x] All code in `src/repositories/` is pretty basic/simple and does not have any immich specific logic (that belongs in `src/services/`) ## Please describe to which degree, if any, an LLM was used in creating this pull request. No LLM. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 16:36:15 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#18309