atanunq / viuer

Rust library for displaying images in the terminal.
MIT License
241 stars 43 forks source link

Do not stretch option for kitty #46

Open DPDmancul opened 1 year ago

DPDmancul commented 1 year ago

Proposal for solving #45 for Kitty

To test:

use viuer::{Config, print_from_file};

fn main() {

    let img = "image.png";

    let conf = Config {
        absolute_offset: false,
        do_not_stretch: false,
        ..Default::default()
    };
    dbg!(conf.do_not_stretch);
    print_from_file(img, &conf).expect("Image printing failed.");

    let conf = Config {
        absolute_offset: false,
        ..Default::default()
    };
    dbg!(conf.do_not_stretch);
    print_from_file(img, &conf).expect("Image printing failed.");
}