diff --git a/core/src/tag_utils.rs b/core/src/tag_utils.rs index e6fdbc834..522ba80be 100644 --- a/core/src/tag_utils.rs +++ b/core/src/tag_utils.rs @@ -1,3 +1,4 @@ +use crate::backend::navigator::url_from_relative_path; use gc_arena::Collect; use std::path::Path; use std::sync::Arc; @@ -53,7 +54,12 @@ impl SwfMovie { /// Utility method to construct a movie from a file on disk. pub fn from_path>(path: P) -> Result { - let url = path.as_ref().to_string_lossy().to_owned().to_string(); + let mut url = path.as_ref().to_string_lossy().to_owned().to_string(); + let cwd = std::env::current_dir()?; + if let Ok(abs_url) = url_from_relative_path(cwd, &url) { + url = abs_url.into_string(); + } + let data = std::fs::read(path)?; Self::from_data(&data, Some(url)) }