From 0a952b35364eae3c4735be0a925ace71877b84b9 Mon Sep 17 00:00:00 2001 From: Andrew Yao Date: Wed, 7 Oct 2026 17:53:19 -0700 Subject: [PATCH] Web: time raw preview decodes with web_time so wasm doesn't panic load_bytes_now timed the binned demosaic with std::time::Instant, which panics on wasm32-unknown-unknown ("time not implemented on this platform"). Opening a raw in the web build aborted the decode. Use web_time::Instant, as library.rs already does. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/engine/src/files.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/files.rs b/crates/engine/src/files.rs index f4a57a6f..b60a84b1 100644 --- a/crates/engine/src/files.rs +++ b/crates/engine/src/files.rs @@ -232,7 +232,7 @@ fn load_bytes_now(bytes: std::borrow::Cow<'_, [u8]>, max_edge: usize) -> Result< raw.opcodes.list3.retain(|op| !is_lens_opcode(op)); // Previews and thumbnails bin the mosaic straight to (about) the size they need; only // larger levels (exports, 1:1) demosaic the whole sensor. - let t0 = std::time::Instant::now(); + let t0 = web_time::Instant::now(); let binned = match bin_factor(&raw, max_edge) { Some(k) => raw.develop_binned(k, HIGHLIGHT_CLIP).map_err(|e| e.to_string())?, None => None,