diff --git a/crates/effects/src/ocio/lut.rs b/crates/effects/src/ocio/lut.rs index e1fbf0ffe..98cd71199 100644 --- a/crates/effects/src/ocio/lut.rs +++ b/crates/effects/src/ocio/lut.rs @@ -284,7 +284,10 @@ pub fn load_file(src: &str) -> Option> { parse_file(src, "") } else { let ext = std::path::Path::new(src_t).extension().and_then(std::ffi::OsStr::to_str).unwrap_or(""); - crate::utility::read_text_file(std::path::Path::new(src_t)).ok().and_then(|t| parse_file(&t, ext)) + crate::utility::read_text_file(std::path::Path::new(src_t)) + .map_err(|e| log::warn!("OCIO file transform not loaded: {e}")) + .ok() + .and_then(|t| parse_file(&t, ext)) } .map(Arc::new); if let Ok(mut m) = cache.lock() { diff --git a/crates/effects/src/utility.rs b/crates/effects/src/utility.rs index b93698c33..a8947e3c6 100644 --- a/crates/effects/src/utility.rs +++ b/crates/effects/src/utility.rs @@ -346,15 +346,21 @@ pub fn load_lut(src: &str) -> Option> { return v.clone(); } let inline = src.contains('\n') || src.contains("LUT_"); - let parsed = if inline { parse_cube(src) } else { read_text_file(Path::new(src.trim())).ok().and_then(|t| parse_cube(&t)) }.map(Arc::new); + let parsed = if inline { + parse_cube(src) + } else { + read_text_file(Path::new(src.trim())).map_err(|e| log::warn!("LUT not loaded: {e}")).ok().and_then(|t| parse_cube(&t)) + } + .map(Arc::new); if let Ok(mut m) = cache.lock() { m.insert(src.to_string(), parsed.clone()); } parsed } -/// Largest text file an effect reads (a LUT, an OCIO config, Mocha shape data). -const MAX_TEXT_FILE_BYTES: u64 = 256 << 20; +/// Largest text file an effect reads (a LUT, an OCIO config, Mocha shape data): 1 GiB, over the +/// ~0.45 GB a 256³ `.cube` takes with six decimals, so no supported LUT is refused. +const MAX_TEXT_FILE_BYTES: u64 = 1 << 30; /// A text file an effect parameter or a saved project names: only a regular file, and only up to /// [`MAX_TEXT_FILE_BYTES`] (`/dev/zero` or a FIFO would never end).