[fix]: Use os_str on mupdf::FilePath such for builds on windows
This commit is contained in:
parent
f1b1c053c7
commit
29de582f84
4 changed files with 7 additions and 6 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -4689,6 +4689,7 @@ dependencies = [
|
|||
"mupdf-sys",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"serde",
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ rapidfuzz = "0.5.0"
|
|||
# femtovg = { version = "0.16.0", features = ["wgpu"] }
|
||||
# wgpu = "26.0.1"
|
||||
# mupdf = "0.5.0"
|
||||
mupdf = { version = "0.6.0", git = "https://github.com/messense/mupdf-rs" }
|
||||
mupdf = { version = "0.6.0", git = "https://github.com/messense/mupdf-rs", features = ["serde"] }
|
||||
tar = "0.4.44"
|
||||
zstd = "0.13.3"
|
||||
fastrand = "2.3.0"
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ impl From<PathBuf> for Presentation {
|
|||
.to_str()
|
||||
.unwrap_or_default()
|
||||
{
|
||||
"pdf" => Document::open(&value.as_path()).map_or(
|
||||
"pdf" => Document::open(&value.as_os_str()).map_or(
|
||||
PresKind::Pdf {
|
||||
starting_index: 0,
|
||||
ending_index: 0,
|
||||
|
|
@ -189,7 +189,7 @@ impl ServiceTrait for Presentation {
|
|||
};
|
||||
let background = Background::try_from(self.path.clone()).into_diagnostic()?;
|
||||
debug!(?background);
|
||||
let document = Document::open(background.path.as_path()).into_diagnostic()?;
|
||||
let document = Document::open(background.path.as_os_str()).into_diagnostic()?;
|
||||
debug!(?document);
|
||||
let pages = document.pages().into_diagnostic()?;
|
||||
debug!(?pages);
|
||||
|
|
@ -321,7 +321,7 @@ impl Model<Presentation> {
|
|||
} else {
|
||||
let path = PathBuf::from(presentation.path);
|
||||
|
||||
Document::open(path.as_path()).map_or(
|
||||
Document::open(path.as_os_str()).map_or(
|
||||
PresKind::Generic,
|
||||
|document| {
|
||||
document.page_count().map_or(
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ impl PresentationEditor {
|
|||
fn update_entire_presentation(&mut self, presentation: &Presentation) {
|
||||
self.presentation = Some(presentation.clone());
|
||||
self.title.clone_from(&presentation.title);
|
||||
self.document = Document::open(&presentation.path.as_path()).ok();
|
||||
self.document = Document::open(&presentation.path.as_os_str()).ok();
|
||||
self.page_count = self.document.as_ref().and_then(|doc| doc.page_count().ok());
|
||||
warn!("changing presentation");
|
||||
let pages = if let PresKind::Pdf {
|
||||
|
|
@ -573,7 +573,7 @@ fn get_pages(
|
|||
range: impl RangeBounds<i32>,
|
||||
presentation_path: impl AsRef<Path>,
|
||||
) -> Option<Vec<Handle>> {
|
||||
let document = Document::open(presentation_path.as_ref()).ok()?;
|
||||
let document = Document::open(presentation_path.as_ref().as_os_str()).ok()?;
|
||||
let pages = document.pages().ok()?;
|
||||
Some(
|
||||
pages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue