From a44dba20a7e99f99aeab61fee3b088d296d619ef Mon Sep 17 00:00:00 2001 From: itsjunetime Date: Fri, 7 Feb 2025 10:24:08 -0700 Subject: [PATCH] Change back to no resizing and don't include alpha channel in conversion --- src/converter.rs | 2 +- src/renderer.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/converter.rs b/src/converter.rs index b302eb4..fc2cd14 100644 --- a/src/converter.rs +++ b/src/converter.rs @@ -66,7 +66,7 @@ pub async fn run_conversion_loop( // size for the area given, so to save ratatui the work of having to // resize it, we tell them to crop it to fit. let txt_img = picker - .new_protocol(dyn_img, img_area, Resize::Scale(None)) + .new_protocol(dyn_img, img_area, Resize::None) .map_err(|e| { RenderError::Converting(format!( "Couldn't convert DynamicImage to ratatui image: {e}" diff --git a/src/renderer.rs b/src/renderer.rs index e593b31..66e0205 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -271,7 +271,7 @@ pub fn start_rendering( * ctx.pixmap.height() * u32::from(ctx.pixmap.n())) as usize; let mut pixels = Vec::with_capacity(cap); - if let Err(e) = ctx.pixmap.write_to(&mut pixels, mupdf::ImageFormat::PAM) { + if let Err(e) = ctx.pixmap.write_to(&mut pixels, mupdf::ImageFormat::PNM) { sender.send(Err(RenderError::Doc(e)))?; continue; };