You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
format: JPEG XL is the twenty fourth format, and its encoder is frugal with nothing
Adds jxl: one frame, 8 bit, RGB, written as a JPEG XL codestream inside the
container the format defines for it. width, height and quality are settings,
the picture goes up to 40 megapixels, and left alone it is the largest of a
fixed ladder that fits the size asked for, up to 640x480 - the same top rung
JPG and AVIF use, so the picture formats answer one request with one size of
picture.
Every size from the minimum of 147 B upwards is reachable, a byte at a time.
The padding travels in a free box, which is the box the container sets aside
for space that means nothing.
The second format here whose pixels are coded by somebody else's encoder. The
road AVIF surveyed was walked again rather than assumed, and three of the
answers were not the ones the survey expected.
The encoder emits a BARE codestream and cannot write a container at all - it
reads one. So the container is ours, built around its bytes. Both channels
were measured and both work: trailing bytes after a bare codestream are taken
by every reader, down to a single byte, with no dead zone. They are not used.
Trailing bytes are not a structure the format defines, only something readers
tolerate, and a free box says "nothing here" in the format's own words. The
choice costs 48 B of minimum and is written down where the measurement is.
Two readers rather than one, and that is what caught the defect worth catching:
a file type box with no compatible brand is REFUSED by libjxl and accepted by
the pure Go decoder. Had the only witness been the module we build against,
that file would have left the tool and failed on somebody else's machine. Both
readers refuse a truncated file and a corrupted one, so both are witnesses.
exiftool reads this format and accepts both, so it is not one.
The encoder is expensive where AVIF's is cheap: about 618 000 objects for one
640x480 picture against about a hundred. A flat ceiling of 128 objects cannot
describe both, and raising it would stop it saying anything about the other
twenty three, so a format may now declare its own. The check that ceiling
stands in for - whether allocation grows with the size of the FILE rather than
with the picture - is untouched and still applies to every format. Its
tolerance now scales with what a format allocates, which is zero change for
every format that allocates less than a thousand objects, and it was proved
still to catch the real defect: a write buffer moved inside its loop grows by
2018 against an allowance of 634.
Measured and worth keeping:
- the assembly is clean, unlike AVIF's. 240 picture sizes, three runs, no
crash, and identical bytes with it and without.
- the same bytes on Windows amd64, Linux amd64, emulated Linux arm64 and
macOS 26.6.2 on arm64, over five cases including an odd size and the
minimum. Thread count does not move them either, at 1 through 16 - which
mattered, because the library's default is GOMAXPROCS.
- the library's default effort is both slower and larger for these pictures,
so the lowest is used. It does not generalise and the exception is recorded.
- the ladder's SHAPE depended on how many seeds were swept. At four the one
pixel rung came out larger than the eight by six one, which would have left
rungs unreachable and the fallback wrong. The ceilings are from 256.
- planning does not code the picture: fifty plans allocate 39 kB against
19.8 MB for one write.
- no socket in the command line binary. It grows by 1 249 280 B, the window
by 1 629 067 B.
Opened in XnView MP, which reports 640x480x24 and 300.00 KiB and draws the
label, so the fidelity checklist row is filled in from a screen rather than
from a decoder.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: THIRD-PARTY-NOTICES.md
+47-2Lines changed: 47 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,14 +17,14 @@ first, so the difference is worth stating rather than leaving to be assumed.
17
17
18
18
| binary | what it is | third party code in it |
19
19
|---|---|---|
20
-
|`tfg`| the command line | the Go runtime, and **three** modules: `github.com/goccy/go-yaml`, `github.com/gen2brain/gav1d` and `golang.org/x/text`|
20
+
|`tfg`| the command line | the Go runtime, and **four** modules: `github.com/goccy/go-yaml`, `github.com/gen2brain/gav1d`, `github.com/gen2brain/jxl` and `golang.org/x/text`|
21
21
|`tfg-gui`| the desktop window | the same, plus **27** more for the graphics toolkit, one of them on Linux only |
22
22
23
23
The window is a separate binary because its toolkit needs a C compiler and
24
24
OpenGL, neither of which the command line uses. A server or a build agent
25
25
running `tfg` therefore carries none of the 27, and that is checked rather than
26
26
asserted: a guard in the source compares what the command line binary actually
0 commit comments