tpng 0.1.0

A small tool that prints truecolor png renderings to the terminal using unicode block characters
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use tpng::Image;
use std::env;
use std::path::PathBuf;
use std::fs;
use std::error::Error;

fn run() -> Result<(), Box<dyn Error>> {
    let path_string = env::args().nth(1).ok_or("usage: tpng <img_path>")?;
    let path = fs::canonicalize(PathBuf::from(&path_string))?;
    println!("{}", Image::new(&path)?);
    Ok(())
}

fn main() { if let Err(e) = run() { eprintln!("Error: {e}"); } }