mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-02 08:01:47 -04:00
Change back to no resizing and don't include alpha channel in conversion
This commit is contained in:
+1
-1
@@ -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}"
|
||||
|
||||
+1
-1
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user