miniview 0.4.0

Display an image within a (graphical) window. Callable from a CLI interface.
Documentation

miniview

'mini' as in, it can't do much =)

Display an image within a (graphical) window.

Install

With cargo install: cargo install --force miniview

Pre build binary: see releases

Usage (binary)

Usage Linux example Windows example (cmd.exe)
miniview <PATH_TO_IMAGE> miniview image.png miniview image.png
miniview --from-path <PATH_TO_IMAGE> miniview --from-path image.png miniview --from-path image.png
miniview --from-stdin-path echo image.png | miniview --from-stdin-path echo image.png | miniview --from-stdin-path
miniview --from-stdin-bytes cat image.png | miniview --from-stdin-bytes type image.png | miniview --from-stdin-bytes

Flags & Options

Flag/Option Description
--fullscreen Set the window to fullscreen
--allow-window-resizing Allow the window to resize (doesn't resize the image!)
--close-after <n> Close the window after n milliseconds

Keyboard shortcuts

Press ESC to exit the image window.

Usage example (library)

use miniview::config::ConfigBuilder;
use std::time::Duration;

fn main() {
    let config =
        ConfigBuilder::from_path(concat!(env!("CARGO_MANIFEST_DIR"), "/resources/plant.jpg"))
            .set_fullscreen(true)
            .set_lazy_window(false)
            .build();

    let controls = MiniView::show(config).expect("unable to create miniview");

    // do some important other work!
    std::thread::sleep(Duration::from_millis(1000));

    let closed = controls.close();
    assert!(closed.is_ok());
}

Suggestions, Questions, Bugs

Feel free to open an issue :mailbox_with_mail: if you have a suggestion, a question or found a bug =).

🎸 🎺 🎻 🎷