Change back to no resizing and don't include alpha channel in conversion

This commit is contained in:
itsjunetime
2025-02-07 10:24:08 -07:00
parent d6102de3c6
commit a44dba20a7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ pub async fn run_conversion_loop(
// size for the area given, so to save ratatui the work of having to // size for the area given, so to save ratatui the work of having to
// resize it, we tell them to crop it to fit. // resize it, we tell them to crop it to fit.
let txt_img = picker let txt_img = picker
.new_protocol(dyn_img, img_area, Resize::Scale(None)) .new_protocol(dyn_img, img_area, Resize::None)
.map_err(|e| { .map_err(|e| {
RenderError::Converting(format!( RenderError::Converting(format!(
"Couldn't convert DynamicImage to ratatui image: {e}" "Couldn't convert DynamicImage to ratatui image: {e}"
+1 -1
View File
@@ -271,7 +271,7 @@ pub fn start_rendering(
* ctx.pixmap.height() * u32::from(ctx.pixmap.n())) * ctx.pixmap.height() * u32::from(ctx.pixmap.n()))
as usize; as usize;
let mut pixels = Vec::with_capacity(cap); 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)))?; sender.send(Err(RenderError::Doc(e)))?;
continue; continue;
}; };