The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
fix(studio): a card or thumbnail not drawn yet no longer prints "Error loading image"
igorgbr29bd5fa7cf72
diff --git a/src/crates/concat/src/host.rs b/src/crates/concat/src/host.rsindex e1fa92aa..23412e98 100644--- a/src/crates/concat/src/host.rs+++ b/src/crates/concat/src/host.rs@@ -427,8 +427,14 @@ pub fn image_of(frame: &concat_core::frame::Frame) -> slint::Image {slint::Image::from_rgba8(buffer)}-/// The JPEG at `path`, if it can be read, as a Slint image.+/// The picture at `path`, if it can be read, as a Slint image. A file that+/// is not there is `None` without a word: Slint prints every load that+/// fails, and a cached picture not drawn yet is the expected case, not a+/// fault.pub fn image_at(path: &std::path::Path) -> Option<slint::Image> {+ if !path.is_file() {+ return None;+ }slint::Image::load_from_path(path).ok()}diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rsindex aa04a50f..0e9d3f56 100644--- a/src/crates/concat/src/studio.rs+++ b/src/crates/concat/src/studio.rs@@ -1195,11 +1195,8 @@ fn package_art(package.folder.as_deref()- .and_then(|folder| slint::Image::load_from_path(&folder.join("preview.png")).ok())- .or_else(|| {- let card = card_paths.get(id)?;- slint::Image::load_from_path(card).ok()- })+ .and_then(|folder| image_at(&folder.join("preview.png")))+ .or_else(|| image_at(card_paths.get(id)?)).or_else(|| bundled_card(id)).unwrap_or_default()})