Show images continuously like:
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).
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.
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
.
Use clippy and rustfmt before committing changes.
cargo clippy
cargo fmt
The idea of image viewer comes from: