gtauri: Tauri v2 gallery harness WORKING on emulator
Chromium owns scroll/compositor/lazy-load/image-cache; Rust owns scan/SQLite/thumbnail-decode behind a gallery:// custom protocol. Hard-won gotchas (see in-code comments): - Android: no native custom-scheme support → wry rewrites the URL to http://gallery.localhost/... (custom_protocol_workaround). The JS MUST request that form; the handler receives the reverted gallery://localhost/... and must strip the authority. - tauri_build::build() in build.rs must run UNCONDITIONALLY (build scripts run on the host: a cfg(target_os) gate silently disables it, which skips the rustc-cfg=mobile emission → no mobile_entry_point → .so with no JNI symbols → UnsatisfiedLinkError). - build.rs must list frontend files for rerun-if-changed (a dir-level directive only watches the dir mtime, not content edits) — the .so bakes the frontend at compile time and cargo otherwise ships stale UI with a 'successful' build. - logcat drops ~75% of lines under load: use the file trace. - fetch() is CORS-restricted (page origin http://tauri.localhost); <img> is not — add ACAO:* anyway. Emulator (5853 real files): grid renders, lazy thumbs via gallery:// with on-disk cache (87 files 35-72KB), FR log clean at 60Hz, viewer opens full-res with compositor-only pan/zoom. The single 'broken' cell is a 17-byte fake test JPEG (correct behavior).
1
harnesses/gtauri/.tauriignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
frontend/dist/img/
|
||||
4539
harnesses/gtauri/Cargo.lock
generated
Normal file
27
harnesses/gtauri/Cargo.toml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[package]
|
||||
name = "gtauri"
|
||||
version = "0.1.0"
|
||||
description = "gallery on Tauri"
|
||||
authors = ["gmp"]
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "gtauri_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-runtime-wry = "2"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
log = { version = "0.4", features = ["std"] }
|
||||
http = "1"
|
||||
# gallery engine (shared with the egui build):
|
||||
rusqlite = { version = "0.41", features = ["bundled"] }
|
||||
turbojpeg = { version = "1.5.1", features = ["cmake"] }
|
||||
kamadak-exif = "0.6"
|
||||
sha1 = "0.11"
|
||||
image = { version = "0.25", default-features = false, features = ["png"] }
|
||||
BIN
harnesses/gtauri/app-icon.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
27
harnesses/gtauri/build.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// tauri::generate_context!() embeds `frontendDist` at compile time. Without
|
||||
// rerun directives cargo does NOT rebuild the .so when frontend files change
|
||||
// (observed: stale grid code survived a "successful" rebuild). Directory-level
|
||||
// rerun-if-changed only tracks the dir mtime (add/remove/rename, NOT content
|
||||
// edits), so list every file explicitly.
|
||||
fn walk(p: &std::path::Path) {
|
||||
for e in std::fs::read_dir(p).unwrap() {
|
||||
let e = e.unwrap();
|
||||
let path = e.path();
|
||||
if path.is_dir() {
|
||||
walk(&path);
|
||||
} else {
|
||||
println!("cargo:rerun-if-changed={}", path.display());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
walk(std::path::Path::new("frontend/dist"));
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json");
|
||||
|
||||
// tauri_build::build() inspects the TARGET env var itself (build scripts
|
||||
// run on the HOST, so a cfg(target_os) gate would disable it). For
|
||||
// android targets it emits `cargo:rustc-cfg=mobile`, which is what
|
||||
// activates `#[cfg_attr(mobile, tauri::mobile_entry_point)]`.
|
||||
tauri_build::build();
|
||||
}
|
||||
11
harnesses/gtauri/capabilities/default.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
"identifier": "default",
|
||||
"description": "tttest: FR batching + lifecycle logs from the webview",
|
||||
"windows": [
|
||||
"main"
|
||||
],
|
||||
"permissions": [
|
||||
"core:default"
|
||||
]
|
||||
}
|
||||
BIN
harnesses/gtauri/frontend/dist/img/000.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/gtauri/frontend/dist/img/001.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/gtauri/frontend/dist/img/002.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/003.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/004.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/005.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/006.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/007.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/008.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/gtauri/frontend/dist/img/009.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/010.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/011.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/012.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/013.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/gtauri/frontend/dist/img/014.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/015.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/016.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/017.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/018.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/019.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/020.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/021.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/022.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/023.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/024.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/025.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/026.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/027.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/028.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/029.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/gtauri/frontend/dist/img/030.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/031.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/032.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/033.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/034.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/035.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/036.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/037.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/038.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/gtauri/frontend/dist/img/039.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/040.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/gtauri/frontend/dist/img/041.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/042.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/043.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/044.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/045.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/046.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/047.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/048.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/049.jpg
vendored
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
harnesses/gtauri/frontend/dist/img/050.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/051.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/052.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/053.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/054.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/055.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/056.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/057.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/058.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/gtauri/frontend/dist/img/059.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/060.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/061.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/gtauri/frontend/dist/img/062.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/gtauri/frontend/dist/img/063.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/064.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/065.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/066.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/067.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/068.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/069.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/070.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/071.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/072.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/073.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/074.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/075.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/076.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/077.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/078.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/079.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/080.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/081.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/082.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/083.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/gtauri/frontend/dist/img/084.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/085.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/086.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/087.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/gtauri/frontend/dist/img/088.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/089.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/090.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/091.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/gtauri/frontend/dist/img/092.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/gtauri/frontend/dist/img/093.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |