Skip to content
← Work

Phodos JXL

A Rust image engine for working with JPEG XL in photo libraries and other media apps.

Source not currently publicIn development

If you’ve kept a photo collection for years, you’ve probably moved it between apps, computers, and drives. I’m building Phodos as a photo library that keeps your originals intact while making copies you can view or share. Phodos JXL handles JPEG XL image files for that library, and other apps will be able to use the same engine.

Why JPEG XL?

JPEG XL is an image format that can compress a photo without changing its pixels. It also has a way to pack an existing JPEG into a smaller file and later get back the exact original JPEG. Restoring the original file also preserves details like its metadata and the way it was encoded.

What I’m building

The foundation is a decoder, the software that turns a compressed image file into pixels an app can display. For Phodos, the next goal is to use that decoder to make viewing copies while keeping track of how the file describes the photo’s colors. Writing JPEG XL files and restoring original JPEGs are also part of the engine’s development.

When a file is cut short

If a file copy is interrupted, an app might still be able to show part of the picture. A photo library checking a copy needs the decoder to report that data is missing. A recovery tool might want whatever the decoder can still read. Phodos JXL calls these two ways of reading a file strict mode and salvage mode.

Recorded decoder test

Reading an incomplete image

The test used one image file and two cut-off versions of it.

Complete file107,899 bytes

Strict mode · accepted

One byte missing107,898 bytes

Strict mode · rejected

Shortened file53,949 bytes

Strict mode · rejected

Salvage mode · partial image data recovered

Test record and source revision

This test checks whether one file contains all the data its final frame says it needs. The decoder at this revision still used helpers from a reference implementation.

Record
ADV-TRUNC-0001
Source revision
c75a428a92db72a4b81eb9c627cd0f0b20e3735d
Test date
Unspecified in the record