Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Building from source

Toolchain

Install Rust with rustup. The repository pins its toolchain in rust-toolchain.toml: Rust 1.99.1 with the rustfmt and clippy components. Inside the checkout, rustup selects that version and downloads it on first use, so there is nothing to configure. If your rustup is set up not to install toolchains automatically, run rustup toolchain install once in the repository.

CI uses the same pinned version.

Running the app

git clone https://gitlab.com/julienbltt/image-toolkit.git
cd image-toolkit
cargo run --release

Always use release builds to actually use the app: image decoding is much slower in debug builds. The binary is written to target/release/image-toolkit (image-toolkit.exe on Windows).

The runtime requirements of the prebuilt binaries apply to your own builds too: on Linux, a Vulkan or OpenGL driver, an X11 or Wayland session, and xdg-desktop-portal for the folder picker.

Everyday commands

cargo check                                   # fast validation
cargo test                                    # unit tests
cargo clippy --all-targets -- -D warnings     # lints; CI fails on any warning
cargo fmt                                     # formatting (CI runs cargo fmt --check)

Cargo.lock is committed and CI builds with --locked: commit it whenever a dependency or the version changes.

The unit tests need no test data. A larger check decodes every photo of a local folder, kept out of the repository; it is ignored by default:

IMAGE_TOOLKIT_SAMPLES=/path/to/photos cargo test --release sample_corpus -- --ignored --nocapture

Coding rules

The coding guidelines are in rules.md at the repository root. In short: correctness and clarity first, no panicking shortcuts such as unwrap(), errors are handled rather than discarded, full-word names, and comments only to explain a non-obvious why.

Working on this documentation

This book lives in docs/ and is built with mdBook 0.5 (a later major version may reject the configuration):

cargo install mdbook --version 0.5.4 --locked
mdbook serve docs --open    # live preview, rebuilt on every change
mdbook build docs           # output in docs/book/ (ignored by git)

The Changelog page includes CHANGELOG.md from the repository root, so it is edited there. The published site is only rebuilt for releases (see Releasing), so build the book locally after changing it: a broken page would otherwise go unnoticed until the next release.