[Proposal / discussion] webp_transform: serve JPEG XL (`image/jxl`) to clients that support it
Les mainteneurs répondent en général sous 2 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- Active
- Stack technique
- cpp
- Domaine
- networking
Piste de recherche
Start by reviewing the webp_transform plugin and its current image/webp negotiation path, then compare the three options described in the issue. The issue is complete when the project chooses an approach, defines opt-in and precedence behavior, and agrees on dependency and encoder limits; it is currently a proposal rather than an implementation task.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
This is a proposal for discussion, not a request to merge.
All three browser engines are turning on JPEG XL decoding by default. Chrome plans to enable it in 155 on desktop, Android and WebView. Firefox plans to enable it in 158, moved from 157. Safari 17+ has decoded still images since 2023. Each engine adds image/jxl to its image Accept header when support is on (Chromium, Gecko, WebKit). So webp_transform could negotiate JPEG XL the same way it negotiates image/webp today.
Why JPEG XL fits this plugin
When the origin image is a JPEG, libjxl can recompress it losslessly. It repacks the JPEG's existing DCT coefficients instead of decoding to pixels. The result is about 20% smaller, and the original JPEG can be rebuilt bit for bit. Today's JPEG to WebP path is a lossy re-encode.
One public data point is in ImageMagick/ImageMagick#8992. There, cjxl -j 1 recompressed an 837 KB JPEG to 655 KB. Encoding the same image losslessly from pixels produced 3.17 MB, so a lossless encode from pixels can't replace recompression. A lossy encode from pixels would be much smaller, but like WebP it can't be reversed.
The obstacle
Lossless recompression goes through the libjxl call JxlEncoderAddJPEGFrame. Neither ImageMagick nor libvips calls it: both decode to pixels and encode with JxlEncoderAddImageFrame. A reply on ImageMagick/ImageMagick#8354 points out that ImageMagick decodes every input to pixels and does not keep the compressed form. So waiting for ImageMagick to add JPEG recompression may not get us there.
Options
- Re-encode pixels with ImageMagick's existing JXL coder.
- No new ATS dependency, but ImageMagick must be built with libjxl.
- This is a lossy re-encode like WebP, so it misses the main benefit, and the encoder is slower.
- Call libjxl directly, for JPEG input only.
- A small, optional code path. PNG and WebP handling stay as they are.
- Adds libjxl (BSD-3) as an optional build dependency. libjxl in turn needs highway and brotli, and it bundles skcms (or can use lcms2) for color management.
- Distro packages are old: EPEL 9 ships 0.7.2, while the libjxl README asks users to "update to v0.12 ASAP due to numerous security fixes". Operators would probably build libjxl themselves.
- Defer until users ask for it, or until a library ATS already uses supports JPEG recompression.
Any of these would need three things:
- Opt-in. For example, a
convert_to_jxlargument, so existing deployments see no change. - A precedence rule. Every browser that accepts JPEG XL also sends
image/webp, so the plugin must pick one. - Encoder limits. Cap memory use and avoid a thread pool per request, because the transform runs inline on the transaction's thread.
Question
Would the project accept libjxl as an optional dependency of webp_transform (option 2), or would it prefer option 1 or 3?
- Langage dominant
- C++
- Étoiles
- 2k
- Forks
- 903
- Merge moyen
- 4 j 4 h
- PR mergées (30 j)
- 135
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOPeut-être pris @NginxL l’a pris aujourd’hui. OuverteBug Good First Issue IOBuffer Network
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/trafficserver#14220 ·
Les mainteneurs répondent en général sous 2 jours
-
MallocAllocator does not check for allocation failurePeut-être pris @umrndem l’a pris aujourd’hui. OuverteBug Core Good First Issue
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/trafficserver#14218 · 2 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
THREAD_ALLOC dereferences a null thread while THREAD_FREE falls back to the global allocatorOuverteBug Event System Threads
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/trafficserver#14217 ·
Les mainteneurs répondent en général sous 2 jours
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodPeut-être pris @rajeetvk l’a pris il y a 1 jour. OuverteBug Event System Good First Issue TS API
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/trafficserver#14214 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
HostDBContinuation::init memsets a polymorphic ActionPeut-être pris @ANMOLSCRIPT l’a pris aujourd’hui. OuverteBug Good First Issue HostDB
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
apache/trafficserver#14204 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de apache/trafficserver
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 2 jours
-
bug data-types
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
ClickHouse/clickhouse-cpp#645 ·
Les mainteneurs répondent en général sous 1 jour
-
bug compatibility difficulty:easy prio:normal
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
NatronGitHub/openfx-misc#524 ·
Les mainteneurs répondent en général sous 1 jour
-
[内容提案] 现在C++模块的CMake支持有更新,需要进行同步Ouvertedocumentation enhancement help wanted P0
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Les mainteneurs répondent en général sous 1 jour
-
Type: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
openscad/openscad#7360 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour