diff --git a/src/main.rs b/src/main.rs index b49b113..9b1175b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -176,18 +176,18 @@ fn main() -> anyhow::Result<()> { } let mut app = App::default(); - let image = - ImageReader::open(file_path).context(format!("Failed to open image at {}", args[1]))?; + let image = ImageReader::open(file_path) + .context(format!("Failed to open image at {}", file_path.display()))?; app.file_name = file_path.file_name().unwrap().to_str().unwrap().to_string(); match image.format().unwrap() { ImageFormat::Gif => { let mut animation = Animation::default(); - let file = BufReader::new( - File::open(args[1].clone()) - .context(format!("Failed to open GIF file at {}", args[1]))?, - ); + let file = BufReader::new(File::open(file_path).context(format!( + "Failed to open GIF file at {}", + file_path.display() + ))?); let decoder = GifDecoder::new(file).context("Failed to create GIF decoder")?; let frames = decoder .into_frames()