Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Set the Medium PDFQuality render configure to 50 pixels to prevent a …
Browse files Browse the repository at this point in the history
…crash with Medium profile: render_preview_page
  • Loading branch information
tuancoltech committed Dec 13, 2023
1 parent ad5ae9f commit 132ffec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use log::debug;

static PDFIUM: OnceCell<Pdfium> = OnceCell::new(); // static initializers must impl Sync + Send

#[derive(Debug)]
pub enum PDFQuality {
High,
Medium,
Expand Down Expand Up @@ -42,7 +43,7 @@ where
debug!("render_preview_page PDF 2");
let render_cfg = match quailty {
PDFQuality::High => render_cfg.set_target_width(2000),
PDFQuality::Medium => render_cfg,
PDFQuality::Medium => render_cfg.thumbnail(50),
PDFQuality::Low => render_cfg.thumbnail(50),
}
.rotate_if_landscape(PdfBitmapRotation::Degrees90, true);
Expand Down

0 comments on commit 132ffec

Please sign in to comment.