From d223d85236185e19994bfda6e6cf0448e8ff1cb8 Mon Sep 17 00:00:00 2001 From: arabian Date: Tue, 6 Jan 2026 05:25:55 +0300 Subject: [PATCH] fix: now colorgram-cli reads file correctly --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index cfd8cf1..1ea36e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use clap::Parser; use colorgram::extract; use std::{ error::Error, + fs, path::{PathBuf, absolute}, }; @@ -31,10 +32,9 @@ fn main() -> Result<(), Box> { assert!(input_path.is_file(), "Input path is not a file"); assert!(colors_amount > 0, "Colors amount must be greater than zero"); - let img = image::open(input_path)?; - let buf = img.as_bytes(); + let buf = fs::read(input_path)?; - match extract(buf, colors_amount) { + match extract(&buf, colors_amount) { Ok(colors) => { for color in colors { let style = Style::new()