Skip to content

Latest commit

 

History

History
56 lines (34 loc) · 1.58 KB

README.md

File metadata and controls

56 lines (34 loc) · 1.58 KB

slide-show-rs

Rust

Show images continuously like:

example image

Usage

Before compiling, make sure that your window size is defined in .env file. For example,

WINDOW_WIDTH=1920
WINDOW_HEIGHT=1080

To reduce preprocessing time, use --release option. It makes this program much faster.

cargo run --release

By default, this app shows all images in photo/ directory. If you want to replace it, please give the app directory path as an argument like cargo run --release photo/test.

If you got error(s), please confirm support status of minifb crate (repo).

Speed

The default speed is 5.0s, that is, shown image is changed if 5.0s passes. To change this speed, please input key ⬆️ or ➡️ to increase speed by 0.5s, input key ⬇️ or ⬅️ to decrease speed by 0.5s.

Note that real speed is affected by your machine spec.

Test

In many cases such as this repo's GitHub Actions, cargo test is enough.

But, if you got NSInternalInconsistencyException (macOS) and failed to test, test must be run with --test_threads=1 option. That is, run cargo test -- --test-threads=1.

Formatter

Use clippy and rustfmt before committing changes.

cargo clippy
cargo fmt

Links

The idea of image viewer comes from: