gtauri: pure-push watching only; one emit per burst; live swipe preview
Watch de-duplication (per the plan review): FileObserver (inotify,
push) and MediaStore ContentObserver (URI push) are the ONLY change
detectors. Removed: the 100 ms recv_timeout tick, the fast_dir_sig
mtime-diff watcher, collect_watched_dirs, changed_dirs, dir_sig,
rescan_subtrees, and the 5-minute full-rescan timer thread.
watch_files now blocks on the push channel; on Android each wake
coalesces ~50 ms so a burst of N file events becomes one payload
batch, one SQLite connection, and ONE grid emit (verified on the
emulator: 20-file copy = 1-2 emits, 20-file delete = 1 emit,
single add still lands in ~75-95 ms).
FileObserver rewritten: recursive registration (Pictures/DCIM tree,
cap 5000 dirs) and self-extending — a CREATE/MOVED_TO on a directory
spawns a new observer for it, so new albums are watched too.
tif/tiff added to the image filter.
Dead code removed (the Tauri port never wired them): scan::walk,
walk_dir_nostats, walk_dir_into, mtime_ns, decode_jpeg (full-size),
images::thumb_png, db::set_thumb, db::list_entries, db::count,
db::delete_by_media_id; Thumb shrunk to {rgb,width,height} (the
grid is uniform squares; the viewer uses full-res). Tests now
compile (tempfile dev-dependency was missing — the test module
never built) and were fixed to match the current API.
Viewer: live swipe preview — while a horizontal drag is in flight at
fit scale, the picture being swiped in renders on the page strip
(second <img>, its grid thumb, a ~1 ms mem hit) and tracks the
finger, so there is no blank side. On commit the primary image takes
over from exactly where the preview was; on snap-back the preview
slides back with the tween. Verified on the emulator (two images
visible mid-drag, clean slide home).
Not re-verified: 120 Hz jank (per instruction — measure once when
settled). Desktop paths untouched (deferred).
43
harnesses/gtauri/Cargo.lock
generated
|
|
@ -790,6 +790,16 @@ dependencies = [
|
|||
"typeid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fallible-iterator"
|
||||
version = "0.3.0"
|
||||
|
|
@ -1223,6 +1233,7 @@ dependencies = [
|
|||
"tauri",
|
||||
"tauri-build",
|
||||
"tauri-runtime-wry",
|
||||
"tempfile",
|
||||
"turbojpeg",
|
||||
]
|
||||
|
||||
|
|
@ -1917,6 +1928,12 @@ dependencies = [
|
|||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
|
||||
|
||||
[[package]]
|
||||
name = "litemap"
|
||||
version = "0.8.3"
|
||||
|
|
@ -2790,6 +2807,19 @@ dependencies = [
|
|||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "1.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.23"
|
||||
|
|
@ -3559,6 +3589,19 @@ dependencies = [
|
|||
"toml 1.1.8+spec-1.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||
dependencies = [
|
||||
"fastrand",
|
||||
"getrandom 0.4.3",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tendril"
|
||||
version = "0.5.1"
|
||||
|
|
|
|||
|
|
@ -30,3 +30,6 @@ image = { version = "0.25", default-features = false, features = ["png", "webp",
|
|||
# Android uses the MediaStore ContentObserver instead — see MainActivity.kt.
|
||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
notify = "8"
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3"
|
||||
|
|
|
|||
59
harnesses/gtauri/frontend/dist/index.html
vendored
|
|
@ -63,7 +63,7 @@
|
|||
touch-action: none;
|
||||
}
|
||||
#viewer.open { display: block; }
|
||||
#vimg {
|
||||
#vimg, #vimg2 {
|
||||
position: absolute; left: 50%; top: 50%;
|
||||
max-width: none;
|
||||
transform-origin: 0 0;
|
||||
|
|
@ -96,6 +96,7 @@
|
|||
</div>
|
||||
<div id="viewer">
|
||||
<div id="vload"></div>
|
||||
<img id="vimg2" alt="">
|
||||
<img id="vimg" alt="">
|
||||
<div id="vclose">×</div>
|
||||
</div>
|
||||
|
|
@ -108,6 +109,7 @@ const band = document.getElementById("band");
|
|||
const stext = document.getElementById("stext");
|
||||
const viewer = document.getElementById("viewer");
|
||||
const vimg = document.getElementById("vimg");
|
||||
const vimg2 = document.getElementById("vimg2");
|
||||
const vload = document.getElementById("vload");
|
||||
|
||||
const COLS = 3, GAP = 4, PAD = 4, BUFFER_ROWS = 12;
|
||||
|
|
@ -383,6 +385,42 @@ let viewerId = null, vFullTimer = null, vFullDone = false, vFullSeq = 0;
|
|||
|
||||
let slideFrom = null; // pending slide start offset for a swiped-in image
|
||||
|
||||
/* Live swipe preview: while a horizontal drag is in flight at fit
|
||||
scale, the picture being swiped IN renders on the page strip
|
||||
(vimg2) and follows the finger — no blank side. Its grid thumb is
|
||||
a mem hit (~1 ms) in the common case (the grid already requested
|
||||
its neighbors' thumbs). */
|
||||
let nav = null; // {id, dir(+1 = right/next, -1 = left/prev), w, h, scale, ready}
|
||||
function navSet(id, dir) {
|
||||
if (nav && nav.id === id) return;
|
||||
navHide();
|
||||
if (id == null) return;
|
||||
nav = { id, dir, w: 0, h: 0, scale: 1, ready: false };
|
||||
vimg2.style.visibility = "hidden";
|
||||
vimg2.onload = () => {
|
||||
if (!nav || nav.id !== id || vimg2.naturalWidth <= 2) return;
|
||||
nav.w = vimg2.naturalWidth; nav.h = vimg2.naturalHeight;
|
||||
nav.scale = Math.min(innerWidth / nav.w, innerHeight / nav.h);
|
||||
nav.ready = true;
|
||||
vimg2.style.width = nav.w + "px";
|
||||
vimg2.style.height = nav.h + "px";
|
||||
vimg2.style.visibility = "visible";
|
||||
navLayout();
|
||||
};
|
||||
vimg2.src = "http://gallery.localhost/thumb/" + id;
|
||||
}
|
||||
function navHide() {
|
||||
nav = null;
|
||||
vimg2.style.visibility = "hidden";
|
||||
}
|
||||
function navLayout() {
|
||||
if (!nav || !nav.ready) return;
|
||||
const s = nav.scale;
|
||||
vimg2.style.transform =
|
||||
"translate(" + (vTx + nav.dir * innerWidth - nav.w * s / 2) + "px," +
|
||||
(0 - nav.h * s / 2) + "px) scale(" + s + ")";
|
||||
}
|
||||
|
||||
function fitViewer(w, h) {
|
||||
base.w = w; base.h = h;
|
||||
vScale = Math.min(innerWidth / w, innerHeight / h);
|
||||
|
|
@ -421,6 +459,7 @@ function tryShow(id, url, isFull) {
|
|||
|
||||
function openViewer(id, fromX) {
|
||||
viewerId = id;
|
||||
navHide(); // the incoming image takes over from the preview
|
||||
slideFrom = (fromX == null) ? null : fromX;
|
||||
vFullDone = false;
|
||||
vScale = 1; vTx = 0; vTy = 0;
|
||||
|
|
@ -453,6 +492,7 @@ function openViewer(id, fromX) {
|
|||
function closeViewer() {
|
||||
viewerId = null;
|
||||
vFullDone = false;
|
||||
navHide();
|
||||
if (vFullTimer) { clearInterval(vFullTimer); vFullTimer = null; }
|
||||
viewer.classList.remove("open");
|
||||
vimg.src = "";
|
||||
|
|
@ -487,7 +527,8 @@ function applyTransform() {
|
|||
}
|
||||
|
||||
/// Ease-out tween of the view transform to (tx, ty) over `ms`.
|
||||
function tweenTo(tx, ty, ms) {
|
||||
/// The swipe preview (if any) tracks the primary image each frame.
|
||||
function tweenTo(tx, ty, ms, onDone) {
|
||||
if (tween) cancelAnimationFrame(tween.raf);
|
||||
const x0 = vTx, y0 = vTy, t0 = performance.now();
|
||||
const step = (now) => {
|
||||
|
|
@ -496,8 +537,9 @@ function tweenTo(tx, ty, ms) {
|
|||
vTx = x0 + (tx - x0) * e;
|
||||
vTy = y0 + (ty - y0) * e;
|
||||
applyTransform();
|
||||
navLayout();
|
||||
if (t < 1) tween.raf = requestAnimationFrame(step);
|
||||
else { tween = null; vTx = tx; vTy = ty; }
|
||||
else { tween = null; vTx = tx; vTy = ty; if (onDone) onDone(); }
|
||||
};
|
||||
tween = { raf: requestAnimationFrame(step) };
|
||||
}
|
||||
|
|
@ -519,6 +561,7 @@ viewer.addEventListener("pointerdown", (e) => {
|
|||
pts.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
||||
if (pts.size === 2) {
|
||||
gesture = null;
|
||||
navHide(); // pinch cancels the swipe preview
|
||||
const [a, b] = [...pts.values()];
|
||||
pinchMid = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
||||
pinchDist = Math.hypot(a.x - b.x, a.y - b.y);
|
||||
|
|
@ -551,7 +594,15 @@ viewer.addEventListener("pointermove", (e) => {
|
|||
const w = innerWidth;
|
||||
vTx = Math.abs(dx) > w ? Math.sign(dx) * (w + (Math.abs(dx) - w) * 0.4) : dx;
|
||||
vTy = 0;
|
||||
// Live preview of the picture being swiped in (page strip).
|
||||
if (Math.abs(dx) > 24) {
|
||||
const dir = dx < 0 ? +1 : -1;
|
||||
const i = ids.indexOf(viewerId);
|
||||
const ni = i + dir;
|
||||
navSet(ni >= 0 && ni < ids.length ? ids[ni] : null, dir);
|
||||
}
|
||||
applyTransform();
|
||||
navLayout();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -591,7 +642,7 @@ const endPt = (e) => {
|
|||
const w = innerWidth;
|
||||
if (dx < -w * 0.25 || g.vx < -0.35) navigate(+1);
|
||||
else if (dx > w * 0.25 || g.vx > 0.35) navigate(-1);
|
||||
else tweenTo(0, 0, 120); // not far enough: snap back
|
||||
else tweenTo(0, 0, 120, navHide); // not far enough: snap back
|
||||
}
|
||||
gesture = null;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@ import java.util.concurrent.Executors
|
|||
|
||||
class MainActivity : TauriActivity() {
|
||||
private var observer: ContentObserver? = null
|
||||
private val fileObservers = mutableListOf<FileObserver>()
|
||||
// One FileObserver per watched directory (inotify has no recursive
|
||||
// mode on Android). Touches come from onCreate (main) and from new-
|
||||
// dir CREATE events (observer threads) — hence synchronized.
|
||||
private val fileObservers =
|
||||
java.util.Collections.synchronizedList(mutableListOf<FileObserver>())
|
||||
|
||||
// MediaStore event path: the OS tells us WHICH URI changed; we query
|
||||
// that one row (~ms) and hand the result to Rust via a payload file +
|
||||
|
|
@ -79,48 +83,95 @@ class MainActivity : TauriActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val IMAGE_EXTS = setOf(
|
||||
"jpg", "jpeg", "png", "webp", "heic", "heif", "bmp", "tif", "tiff"
|
||||
)
|
||||
}
|
||||
|
||||
private fun isImageFile(f: java.io.File): Boolean = f.extension.lowercase() in IMAGE_EXTS
|
||||
|
||||
private fun startFileObservers() {
|
||||
val roots = listOf(
|
||||
android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_PICTURES),
|
||||
android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DCIM)
|
||||
)
|
||||
for (root in roots) {
|
||||
if (root != null && root.exists()) {
|
||||
val dirs = mutableListOf(root)
|
||||
root.listFiles()?.forEach { if (it.isDirectory) dirs.add(it) }
|
||||
for (dir in dirs) {
|
||||
try {
|
||||
val observer = object : FileObserver(dir.absolutePath, CLOSE_WRITE or DELETE or MOVED_TO or MOVED_FROM) {
|
||||
override fun onEvent(event: Int, path: String?) {
|
||||
if (path.isNullOrEmpty()) return
|
||||
if (path.startsWith(".")) return
|
||||
val fullPath = java.io.File(dir, path).absolutePath
|
||||
val ext = fullPath.substringAfterLast('.', "").lowercase()
|
||||
val imageExts = setOf("jpg", "jpeg", "png", "webp", "heic", "heif", "bmp")
|
||||
if (!imageExts.contains(ext)) return
|
||||
if (root != null) watchDirTree(root)
|
||||
}
|
||||
synchronized(fileObservers) {
|
||||
android.util.Log.i("gallery-ms", "file observers: " + fileObservers.size)
|
||||
}
|
||||
}
|
||||
|
||||
/** Watch `root` and, recursively, every existing subdirectory. */
|
||||
private fun watchDirTree(root: java.io.File) {
|
||||
val stack = ArrayDeque<java.io.File>()
|
||||
stack.add(root)
|
||||
var processed = 0
|
||||
while (stack.isNotEmpty() && processed < 5000) {
|
||||
val dir = stack.removeFirst()
|
||||
if (watchDir(dir)) {
|
||||
dir.listFiles()?.forEach {
|
||||
if (it.isDirectory && !it.name.startsWith(".")) stack.add(it)
|
||||
}
|
||||
}
|
||||
processed++
|
||||
}
|
||||
}
|
||||
|
||||
/** Start one FileObserver on `dir`. Returns true when the dir exists.
|
||||
* A photo event in this dir becomes a payload line pushed to Rust:
|
||||
* CLOSE_WRITE / MOVED_TO → A (added or finished being written)
|
||||
* DELETE / MOVED_FROM → D_PATH (removed)
|
||||
* CREATE / MOVED_TO on a DIRECTORY → new observer (the tree grows
|
||||
* so nested and later-created dirs are pushed too).
|
||||
*/
|
||||
private fun watchDir(dir: java.io.File): Boolean {
|
||||
if (!dir.isDirectory) return false
|
||||
try {
|
||||
val observer = object : FileObserver(
|
||||
dir.absolutePath,
|
||||
CREATE or CLOSE_WRITE or DELETE or MOVED_TO or MOVED_FROM
|
||||
) {
|
||||
override fun onEvent(event: Int, path: String?) {
|
||||
if (path.isNullOrEmpty() || path.startsWith(".")) return
|
||||
val f = java.io.File(dir, path)
|
||||
when (event and FileObserver.ALL_EVENTS) {
|
||||
FileObserver.CREATE, FileObserver.MOVED_TO -> {
|
||||
if (f.isDirectory) {
|
||||
watchDir(f)
|
||||
} else if (isImageFile(f)) {
|
||||
fsExecutor.execute {
|
||||
when (event and FileObserver.ALL_EVENTS) {
|
||||
FileObserver.CLOSE_WRITE, FileObserver.MOVED_TO -> {
|
||||
val f = java.io.File(fullPath)
|
||||
if (f.exists() && f.length() > 0) {
|
||||
deliver("A|0|$fullPath|${f.length()}")
|
||||
}
|
||||
}
|
||||
FileObserver.DELETE, FileObserver.MOVED_FROM -> {
|
||||
deliver("D_PATH|$fullPath")
|
||||
}
|
||||
if (f.exists() && f.length() > 0) {
|
||||
deliver("A|0|${f.absolutePath}|${f.length()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
observer.startWatching()
|
||||
fileObservers.add(observer)
|
||||
} catch (e: Exception) {
|
||||
android.util.Log.w("gallery-ms", "FileObserver error: " + e)
|
||||
FileObserver.CLOSE_WRITE -> {
|
||||
if (isImageFile(f)) {
|
||||
fsExecutor.execute {
|
||||
if (f.exists() && f.length() > 0) {
|
||||
deliver("A|0|${f.absolutePath}|${f.length()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FileObserver.DELETE, FileObserver.MOVED_FROM -> {
|
||||
if (isImageFile(f)) {
|
||||
fsExecutor.execute { deliver("D_PATH|${f.absolutePath}") }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
observer.startWatching()
|
||||
fileObservers.add(observer)
|
||||
return true
|
||||
} catch (e: Exception) {
|
||||
android.util.Log.w("gallery-ms", "FileObserver error: " + e)
|
||||
return false
|
||||
}
|
||||
}
|
||||
/** Handle ONE changed URI: query that exact MediaStore row.
|
||||
|
|
|
|||
|
|
@ -217,16 +217,6 @@ pub fn upsert_ms(
|
|||
Ok(changed)
|
||||
}
|
||||
|
||||
/// Delete the row for a MediaStore `_id` (the row is gone from
|
||||
/// MediaStore — the media file was removed). Returns rows affected.
|
||||
pub fn delete_by_media_id(
|
||||
conn: &mut Connection,
|
||||
media_id: i64,
|
||||
) -> Result<usize, rusqlite::Error> {
|
||||
let n = conn.execute("DELETE FROM items WHERE media_id = ?1", params![media_id])?;
|
||||
Ok(n)
|
||||
}
|
||||
|
||||
/// Record a MediaStore id → path mapping (every add event, even for
|
||||
/// size-0 mid-write rows that don't get an items row).
|
||||
pub fn map_media(
|
||||
|
|
@ -282,46 +272,10 @@ pub fn unmap_media(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Number of rows in the DB.
|
||||
pub fn count(conn: &mut Connection) -> Result<i64, rusqlite::Error> {
|
||||
let n: i64 = conn.query_row("SELECT COUNT(*) FROM items", [], |r| r.get(0))?;
|
||||
Ok(n)
|
||||
}
|
||||
|
||||
/// All known entries, newest first.
|
||||
pub fn list_entries(conn: &mut Connection) -> Result<Vec<Entry>, rusqlite::Error> {
|
||||
let mut st = conn.prepare("SELECT path, mtime, size FROM items ORDER BY mtime DESC, path ASC")?;
|
||||
let rows = st.query_map([], |r| {
|
||||
Ok(Entry { path: r.get(0)?, mtime: r.get(1)?, size: r.get(2)? })
|
||||
})?;
|
||||
let mut out = Vec::new();
|
||||
for row in rows {
|
||||
out.push(row?);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// Update the derived thumbnail columns once the pool has finished a job.
|
||||
pub fn set_thumb(
|
||||
conn: &mut Connection,
|
||||
path: &str,
|
||||
width: i64,
|
||||
height: i64,
|
||||
orientation: i64,
|
||||
thumb_path: &str,
|
||||
) -> Result<(), rusqlite::Error> {
|
||||
conn.execute(
|
||||
"UPDATE items SET width = ?2, height = ?3, orientation = ?4, thumb_path = ?5 \
|
||||
WHERE path = ?1",
|
||||
params![path, width, height, orientation, thumb_path],
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::scan::{walk, Entry};
|
||||
use crate::scan::{walk_stream, Entry};
|
||||
|
||||
fn entry(path: &str, mtime: i64, size: i64) -> Entry {
|
||||
Entry { path: path.into(), mtime, size }
|
||||
|
|
@ -347,21 +301,25 @@ mod tests {
|
|||
.unwrap();
|
||||
assert_eq!((i, u, d), (1, 1, 1));
|
||||
|
||||
let list = list_entries(&mut conn).unwrap();
|
||||
let paths: Vec<&str> = list.iter().map(|e| e.path.as_str()).collect();
|
||||
assert_eq!(paths, vec!["/a/1.jpg", "/a/3.jpg"]);
|
||||
let paths: Vec<String> = {
|
||||
let mut st = conn.prepare("SELECT path FROM items ORDER BY path").unwrap();
|
||||
st.query_map([], |r| r.get::<_, String>(0))
|
||||
.unwrap()
|
||||
.collect::<Result<_, _>>()
|
||||
.unwrap()
|
||||
};
|
||||
assert_eq!(paths, vec!["/a/1.jpg".to_string(), "/a/3.jpg".to_string()]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn set_thumb_updates_row_and_invalidation() {
|
||||
fn mtime_change_invalidates_derived_columns() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let mut conn = open(&dir.path().join("t.db")).unwrap();
|
||||
apply(&mut conn, &[entry("/a/1.jpg", 1, 10)]).unwrap();
|
||||
set_thumb(&mut conn, "/a/1.jpg", 8000, 6016, 6, "/cache/abc.jpg").unwrap();
|
||||
let thumb: String = conn
|
||||
.query_row("SELECT thumb_path FROM items WHERE path = '/a/1.jpg'", [], |r| r.get(0))
|
||||
.unwrap();
|
||||
assert_eq!(thumb, "/cache/abc.jpg");
|
||||
conn.execute(
|
||||
"UPDATE items SET thumb_path = '/cache/abc.jpg' WHERE path = '/a/1.jpg'", [],
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
// mtime change → apply() invalidates the derived columns.
|
||||
let (i, u, d) = apply(&mut conn, &[entry("/a/1.jpg", 2, 12)]).unwrap();
|
||||
|
|
@ -382,13 +340,12 @@ mod tests {
|
|||
|
||||
let db_dir = tempfile::tempdir().unwrap();
|
||||
let mut conn = open(&db_dir.path().join("t.db")).unwrap();
|
||||
let entries = walk(&[dir.path().to_path_buf()], &|_| {}).unwrap();
|
||||
let entries = walk_stream(&[dir.path().to_path_buf()], &|_| {}).unwrap();
|
||||
let (i, u, d) = apply(&mut conn, &entries).unwrap();
|
||||
assert_eq!((i, u, d), (2, 0, 0));
|
||||
|
||||
let list = list_entries(&mut conn).unwrap();
|
||||
assert_eq!(list.len(), 2);
|
||||
assert!(list.iter().all(|e| e.path.contains(dir.path().to_str().unwrap())));
|
||||
let n: i64 = conn.query_row("SELECT COUNT(*) FROM items", [], |r| r.get(0)).unwrap();
|
||||
assert_eq!(n, 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -405,9 +362,13 @@ mod tests {
|
|||
// Second row for a different id.
|
||||
upsert_ms(&mut conn, "/x/b.jpg", 100, 10, 8).unwrap();
|
||||
|
||||
assert_eq!(path_by_media_id(&mut conn, 7).unwrap().as_deref(), Some("/x/a.jpg"));
|
||||
assert_eq!(delete_by_media_id(&mut conn, 7).unwrap(), 1);
|
||||
assert_eq!(delete_by_media_id(&mut conn, 7).unwrap(), 0); // idempotent
|
||||
assert_eq!(count(&mut conn).unwrap(), 1);
|
||||
// Delete path: resolve id → path, delete by path (production
|
||||
// sequence), idempotent on the second pass.
|
||||
let path = path_for_media(&mut conn, 7).unwrap().unwrap();
|
||||
assert_eq!(path, "/x/a.jpg");
|
||||
assert_eq!(delete_by_path(&mut conn, &path).unwrap(), 1);
|
||||
assert_eq!(path_for_media(&mut conn, 7).unwrap(), None);
|
||||
let n: i64 = conn.query_row("SELECT COUNT(*) FROM items", [], |r| r.get(0)).unwrap();
|
||||
assert_eq!(n, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,26 +28,6 @@ pub struct Thumb {
|
|||
pub rgb: Vec<u8>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
/// Source dimensions after orientation is applied (full resolution).
|
||||
pub src_width: u32,
|
||||
pub src_height: u32,
|
||||
/// EXIF orientation 1..8 (1 = none).
|
||||
pub orientation: u8,
|
||||
}
|
||||
|
||||
/// Decode a file at full (1/1) size to RGBA8. Used only for small JPEGs in the
|
||||
/// disk cache on a cache hit.
|
||||
pub fn decode_jpeg(path: &Path) -> Result<Thumb, String> {
|
||||
let data = std::fs::read(path).map_err(|e| format!("read {}: {e}", path.display()))?;
|
||||
let (rgb, w, h) = decode_jpeg_scaled(&data, ScalingFactor::ONE)?;
|
||||
Ok(Thumb {
|
||||
rgb,
|
||||
width: w,
|
||||
height: h,
|
||||
src_width: w,
|
||||
src_height: h,
|
||||
orientation: 1,
|
||||
})
|
||||
}
|
||||
|
||||
/// Decode JPEG bytes at a fixed scaling factor to RGB8.
|
||||
|
|
@ -117,7 +97,7 @@ pub fn generic_decode(path: &Path, target: u32) -> Result<Thumb, String> {
|
|||
.map_err(|e| format!("decode {}: {e}", path.display()))?;
|
||||
let rgb = img.to_rgb8();
|
||||
let (w, h) = (rgb.width(), rgb.height());
|
||||
Ok(fit_to_target(rgb.into_raw(), w, h, target, w, h, 1))
|
||||
Ok(fit_to_target(rgb.into_raw(), w, h, target))
|
||||
}
|
||||
|
||||
fn thumb_jpeg(path: &Path, target: u32) -> Result<Thumb, String> {
|
||||
|
|
@ -132,19 +112,7 @@ fn thumb_jpeg(path: &Path, target: u32) -> Result<Thumb, String> {
|
|||
let scale = pick_scale(src_w.max(src_h), target);
|
||||
let (rgb, w, h) = decode_jpeg_scaled(&data, scale)?;
|
||||
let (rgb, w, h) = apply_orientation(rgb, w, h, orientation);
|
||||
Ok(fit_to_target(rgb, w, h, target, src_w, src_h, orientation))
|
||||
}
|
||||
|
||||
fn thumb_png(path: &Path, target: u32) -> Result<Thumb, String> {
|
||||
let img = image::ImageReader::open(path)
|
||||
.map_err(|e| format!("open {}: {e}", path.display()))?
|
||||
.with_guessed_format()
|
||||
.map_err(|e| e.to_string())?
|
||||
.decode()
|
||||
.map_err(|e| format!("png decode: {e}"))?;
|
||||
let rgb = img.to_rgb8();
|
||||
let (w, h) = (rgb.width(), rgb.height());
|
||||
Ok(fit_to_target(rgb.into_raw(), w, h, target, w, h, 1))
|
||||
Ok(fit_to_target(rgb, w, h, target))
|
||||
}
|
||||
|
||||
/// Largest shrink (1/8, 1/4, 1/2) whose result is still >= `target` on the
|
||||
|
|
@ -206,15 +174,7 @@ pub fn apply_orientation(rgb: Vec<u8>, w: u32, h: u32, orientation: u8) -> (Vec<
|
|||
}
|
||||
|
||||
/// Fit into the `target` box (aspect preserved, no upscaling).
|
||||
fn fit_to_target(
|
||||
rgb: Vec<u8>,
|
||||
w: u32,
|
||||
h: u32,
|
||||
target: u32,
|
||||
src_w: u32,
|
||||
src_h: u32,
|
||||
orientation: u8,
|
||||
) -> Thumb {
|
||||
fn fit_to_target(rgb: Vec<u8>, w: u32, h: u32, target: u32) -> Thumb {
|
||||
let (w, h, rgb) = if w.max(h) > target {
|
||||
let (nw, nh) = if w >= h {
|
||||
(target, (h as f64 * target as f64 / w as f64).max(1.0).round() as u32)
|
||||
|
|
@ -228,5 +188,5 @@ fn fit_to_target(
|
|||
} else {
|
||||
(w, h, rgb)
|
||||
};
|
||||
Thumb { rgb, width: w, height: h, src_width: src_w, src_height: src_h, orientation }
|
||||
Thumb { rgb, width: w, height: h }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ fn init_logcat() {
|
|||
Level::Info => 4,
|
||||
_ => 3,
|
||||
};
|
||||
let mut s = format!("{}\0", record.args());
|
||||
let s = format!("{}\0", record.args());
|
||||
unsafe {
|
||||
__android_log_write(prio, b"gtauri\0".as_ptr(), s.as_ptr());
|
||||
}
|
||||
|
|
@ -751,9 +751,11 @@ impl Drop for RescanGuard {
|
|||
|
||||
/// Full rescan: walk the roots, diff against the DB (insert new /
|
||||
/// update changed / delete removed), refresh META, emit the list.
|
||||
/// Used by the startup scan AND the 5-minute reconciliation pass.
|
||||
/// The ONLY full pass: the startup baseline that builds/refreshes the
|
||||
/// DB from disk. Live changes after that arrive as pushes (Kotlin
|
||||
/// FileObserver / MediaStore ContentObserver payloads).
|
||||
/// If the walk fails, nothing is applied — an error is not "those
|
||||
/// files are gone"; the next pass retries.
|
||||
/// files are gone"; the next launch retries.
|
||||
fn rescan(app: &tauri::AppHandle) {
|
||||
let _guard = RescanGuard::new();
|
||||
let entries = match walk_once(app) {
|
||||
|
|
@ -800,129 +802,6 @@ fn mtime_ns(m: &std::fs::Metadata) -> i64 {
|
|||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
/// Tree signature: (dir, mtime) for every directory under the roots.
|
||||
/// Verified on the phone: Android's FUSE DOES update a directory's
|
||||
/// mtime when files are added/removed inside it (stat before/after a
|
||||
/// copy showed the change). Cost per tick: one stat per DIRECTORY and
|
||||
/// one readdir per directory — no per-FILE stat. (The old version
|
||||
/// called is_dir() on every entry: 10k stats per second on a 10k-file
|
||||
/// Camera dir, which put a 10 s I/O floor under every event.)
|
||||
fn dir_sig(roots: &[PathBuf]) -> HashMap<PathBuf, i64> {
|
||||
let mut out = HashMap::new();
|
||||
let mut stack: Vec<PathBuf> = roots.iter().filter(|r| r.is_dir()).cloned().collect();
|
||||
while let Some(dir) = stack.pop() {
|
||||
let Ok(m) = std::fs::metadata(&dir) else { continue };
|
||||
out.insert(dir.clone(), mtime_ns(&m));
|
||||
match std::fs::read_dir(&dir) {
|
||||
Ok(rd) => {
|
||||
for ent in rd.flatten() {
|
||||
let p = ent.path();
|
||||
// file_type() uses the d_type from getdents (no
|
||||
// syscall); is_dir() would stat the entry.
|
||||
let Ok(ft) = ent.file_type() else { continue };
|
||||
if ft.is_symlink() || !ft.is_dir() {
|
||||
continue;
|
||||
}
|
||||
if p.file_name().map_or(false, |n| n.to_string_lossy().starts_with('.')) {
|
||||
continue;
|
||||
}
|
||||
stack.push(p);
|
||||
}
|
||||
}
|
||||
// A directory we cannot read this tick: skip it; the next
|
||||
// tick or the full pass will pick up anything that changed.
|
||||
Err(_) => {}
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Above 2000 files, stat'ing every file on FUSE costs tens of seconds;
|
||||
/// for such directories a change event is handled readdir-only (adds and
|
||||
/// deletes are still detected exactly; in-place edits wait for the
|
||||
/// periodic full pass). Small directories are walked with stat so edits
|
||||
/// are caught too.
|
||||
const BIG_DIR: usize = 2000;
|
||||
|
||||
/// Incremental rescan limited to the changed directory subtrees.
|
||||
/// Everything outside the changed trees keeps its DB metadata, so the
|
||||
/// walk cost is proportional to the change, not the library.
|
||||
fn rescan_subtrees(app: &tauri::AppHandle, changed: &[PathBuf]) {
|
||||
let mut conn = match db::open(&db::db_path()) {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
log::warn!("incr db: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let existing = match db::list_entries(&mut conn) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
log::warn!("incr list: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let mut fresh: Vec<scan::Entry> = Vec::new();
|
||||
for d in changed {
|
||||
let prefix = d.to_string_lossy().into_owned() + "/";
|
||||
let under: Vec<&scan::Entry> =
|
||||
existing.iter().filter(|e| e.path.starts_with(&prefix)).collect();
|
||||
let known: HashMap<&str, &scan::Entry> =
|
||||
under.iter().map(|e| (e.path.as_str(), *e)).collect();
|
||||
if under.len() <= BIG_DIR {
|
||||
// Small: full walk with stat — adds, deletes AND edits.
|
||||
if let Err(e) = scan::walk_dir_into(d, &mut fresh) {
|
||||
tr(&format!("incr: walk {d:?} FAILED ({e}) — not applying"));
|
||||
log::warn!("incr walk failed: {e}");
|
||||
return; // a failed subtree must not be applied as empty
|
||||
}
|
||||
} else {
|
||||
// Huge: readdir-only. New files get stat'd; known files keep
|
||||
// their DB mtime/size (an in-place edit there is caught by
|
||||
// the 5-minute full pass).
|
||||
if let Err(e) = scan::walk_dir_nostats(d, &mut |p| {
|
||||
let ps = p.to_string_lossy();
|
||||
let entry = match known.get(ps.as_ref()) {
|
||||
Some(old) => scan::Entry {
|
||||
path: ps.into_owned(),
|
||||
mtime: old.mtime,
|
||||
size: old.size,
|
||||
},
|
||||
None => match std::fs::metadata(p) {
|
||||
Ok(md) => scan::Entry {
|
||||
path: ps.into_owned(),
|
||||
mtime: mtime_ns(&md),
|
||||
size: md.len() as i64,
|
||||
},
|
||||
Err(_) => return, // file vanished mid-walk — normal race
|
||||
},
|
||||
};
|
||||
fresh.push(entry);
|
||||
}) {
|
||||
tr(&format!("incr: walk {d:?} FAILED ({e}) — not applying"));
|
||||
log::warn!("incr walk failed: {e}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
let mut all = existing
|
||||
.into_iter()
|
||||
.filter(|e| !changed.iter().any(|d| e.path.starts_with(&*(d.to_string_lossy().into_owned() + "/"))))
|
||||
.collect::<Vec<_>>();
|
||||
let added = fresh.len();
|
||||
all.extend(fresh);
|
||||
if let Err(e) = db::apply(&mut conn, &all) {
|
||||
log::warn!("incr apply: {e}");
|
||||
return;
|
||||
}
|
||||
if let Err(e) = load_meta(&mut conn) {
|
||||
log::warn!("incr meta: {e}");
|
||||
return;
|
||||
}
|
||||
emit_files(app, false, all.len());
|
||||
tr(&format!("watch: incr changed={} fresh={added}", changed.len()));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// MediaStore fast path (Android). MainActivity's ContentObserver gets
|
||||
// the CHANGED URI(s) directly from the OS; it queries that exact row
|
||||
|
|
@ -939,10 +818,12 @@ fn rescan_subtrees(app: &tauri::AppHandle, changed: &[PathBuf]) {
|
|||
/// line was applied (the watch loop uses this to decide whether the
|
||||
/// OS event was fully handled by the payload path).
|
||||
#[cfg(target_os = "android")]
|
||||
fn apply_mediasotre_payload(app: &tauri::AppHandle) -> bool {
|
||||
// Consume every pending .ms_recent.* event file (oldest first).
|
||||
fn apply_mediasotre_payload(app: &tauri::AppHandle) {
|
||||
// Consume every pending .ms_recent.* event file (oldest first) in ONE
|
||||
// connection and emit ONCE: a burst of N changed files is one DB
|
||||
// batch and one grid update, not N of each.
|
||||
let dir = external_files_dir();
|
||||
let Ok(rd) = std::fs::read_dir(&dir) else { return false };
|
||||
let Ok(rd) = std::fs::read_dir(&dir) else { return };
|
||||
let mut files: Vec<std::path::PathBuf> = rd
|
||||
.flatten()
|
||||
.filter(|e| {
|
||||
|
|
@ -953,10 +834,18 @@ fn apply_mediasotre_payload(app: &tauri::AppHandle) -> bool {
|
|||
.map(|e| e.path())
|
||||
.collect();
|
||||
if files.is_empty() {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
files.sort();
|
||||
let mut applied = false;
|
||||
let mut conn = match db::open(&db::db_path()) {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
log::warn!("mediastore db: {e}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let mut changed = 0usize;
|
||||
let mut removed = 0usize;
|
||||
for f in files {
|
||||
let name = f.file_name().map(|s| s.to_string_lossy().into_owned()).unwrap_or_default();
|
||||
let Ok(text) = std::fs::read_to_string(&f) else { continue };
|
||||
|
|
@ -965,25 +854,24 @@ fn apply_mediasotre_payload(app: &tauri::AppHandle) -> bool {
|
|||
continue;
|
||||
}
|
||||
tr(&format!("mediastore event {name}: {} lines", text.lines().count()));
|
||||
applied |= mediastore_apply(app, &text);
|
||||
let (c, r) = apply_lines(&mut conn, &text);
|
||||
changed += c;
|
||||
removed += r;
|
||||
}
|
||||
applied
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
fn apply_mediasotre_payload(_app: &tauri::AppHandle) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
||||
let mut conn = match db::open(&db::db_path()) {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
log::warn!("mediastore db: {e}");
|
||||
return false;
|
||||
if changed + removed > 0 {
|
||||
tr(&format!("mediastore applied +{changed} -{removed}"));
|
||||
if let Err(e) = load_meta(&mut conn) {
|
||||
log::warn!("mediastore meta: {e}");
|
||||
}
|
||||
};
|
||||
emit_files(app, false, META.read().unwrap().len());
|
||||
}
|
||||
}
|
||||
|
||||
/// Apply one batch of payload lines to an already-open connection.
|
||||
/// Returns (adds, removals). No DB open, no emit — the caller batches
|
||||
/// and emits once per wake.
|
||||
#[cfg(target_os = "android")]
|
||||
fn apply_lines(conn: &mut db::Connection, text: &str) -> (usize, usize) {
|
||||
let mut changed = 0usize;
|
||||
let mut removed = 0usize;
|
||||
for line in text.lines() {
|
||||
|
|
@ -1002,7 +890,7 @@ fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
|||
// event must be resolvable even for rows created by a
|
||||
// filesystem walk (no media_id) or never created at all
|
||||
// (the size-0 mid-write row below).
|
||||
if let Err(e) = db::map_media(&mut conn, id, path) {
|
||||
if let Err(e) = db::map_media(conn, id, path) {
|
||||
log::warn!("mediastore map: {e}");
|
||||
}
|
||||
// Trust the DISK, not the provider row: the scanner can
|
||||
|
|
@ -1011,7 +899,7 @@ fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
|||
// size (content change resets the decode state).
|
||||
let Ok(md) = std::fs::metadata(path) else { continue };
|
||||
let mtime = mtime_ns(&md);
|
||||
match db::upsert_ms(&mut conn, path, mtime, md.len() as i64, id) {
|
||||
match db::upsert_ms(conn, path, mtime, md.len() as i64, id) {
|
||||
Ok(content_changed) => {
|
||||
// Row id → the rowid is what the grid/queue use;
|
||||
// clear decode-failure state only after a real
|
||||
|
|
@ -1040,7 +928,7 @@ fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
|||
// filesystem walk, which doesn't store the media id.
|
||||
"D" => {
|
||||
let Ok(id) = f.next().unwrap_or("").parse::<i64>() else { continue };
|
||||
let path = match db::path_for_media(&mut conn, id) {
|
||||
let path = match db::path_for_media(conn, id) {
|
||||
Ok(p) => p,
|
||||
Err(e) => {
|
||||
log::warn!("mediastore dlookup: {e}");
|
||||
|
|
@ -1059,13 +947,13 @@ fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
|||
{
|
||||
FAILS.lock().unwrap().remove(&rid);
|
||||
}
|
||||
if let Ok(n) = db::delete_by_path(&mut conn, &path) {
|
||||
if let Ok(n) = db::delete_by_path(conn, &path) {
|
||||
removed += n;
|
||||
if n > 0 {
|
||||
tr(&format!("mediastore del id={id} {path}"));
|
||||
}
|
||||
}
|
||||
let _ = db::unmap_media(&mut conn, id);
|
||||
let _ = db::unmap_media(conn, id);
|
||||
}
|
||||
}
|
||||
"D_PATH" => {
|
||||
|
|
@ -1080,7 +968,7 @@ fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
|||
{
|
||||
FAILS.lock().unwrap().remove(&rid);
|
||||
}
|
||||
if let Ok(n) = db::delete_by_path(&mut conn, path) {
|
||||
if let Ok(n) = db::delete_by_path(conn, path) {
|
||||
removed += n;
|
||||
if n > 0 {
|
||||
tr(&format!("mediastore del path={path}"));
|
||||
|
|
@ -1090,27 +978,13 @@ fn mediastore_apply(app: &tauri::AppHandle, text: &str) -> bool {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
if changed + removed > 0 {
|
||||
tr(&format!("mediastore applied +{changed} -{removed}"));
|
||||
if let Err(e) = load_meta(&mut conn) {
|
||||
log::warn!("mediastore meta: {e}");
|
||||
}
|
||||
emit_files(app, false, META.read().unwrap().len());
|
||||
}
|
||||
changed + removed > 0
|
||||
(changed, removed)
|
||||
}
|
||||
|
||||
/// Watcher wake events.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
enum WEvent {
|
||||
/// The OS said the filesystem changed (ContentObserver on Android,
|
||||
/// inotify/FSEvents on desktop).
|
||||
Fs,
|
||||
/// Periodic full-pass timer.
|
||||
Full,
|
||||
}
|
||||
|
||||
static WATCH_TX: LazyLock<Mutex<Option<mpsc::Sender<WEvent>>>> =
|
||||
/// One unit per "the OS said the filesystem changed" push (Kotlin
|
||||
/// FileObserver / MediaStore ContentObserver on Android, inotify/FSEvents
|
||||
/// on desktop).
|
||||
static WATCH_TX: LazyLock<Mutex<Option<mpsc::Sender<()>>>> =
|
||||
LazyLock::new(|| Mutex::new(None));
|
||||
|
||||
/// Android: called by MainActivity's ContentObserver via JNI (and after
|
||||
|
|
@ -1124,7 +998,7 @@ pub extern "system" fn Java_wow_gmp_gallery_MainActivity_nativeFsChange(
|
|||
_obj: *mut std::ffi::c_void,
|
||||
) {
|
||||
if let Some(tx) = WATCH_TX.lock().unwrap().as_ref() {
|
||||
let _ = tx.send(WEvent::Fs);
|
||||
let _ = tx.send(());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1160,154 +1034,49 @@ fn spawn_fs_watcher(tx: mpsc::Sender<WEvent>) {
|
|||
});
|
||||
}
|
||||
|
||||
fn collect_watched_dirs(roots: &[PathBuf]) -> HashSet<PathBuf> {
|
||||
let mut dirs = HashSet::new();
|
||||
for r in roots {
|
||||
if r.is_dir() {
|
||||
dirs.insert(r.clone());
|
||||
if let Ok(rd) = std::fs::read_dir(r) {
|
||||
for ent in rd.flatten() {
|
||||
if let Ok(ft) = ent.file_type() {
|
||||
if ft.is_dir() {
|
||||
let p = ent.path();
|
||||
if !p.file_name().map_or(false, |n| n.to_string_lossy().starts_with('.')) {
|
||||
dirs.insert(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Ok(mut conn) = db::open(&db::db_path()) {
|
||||
if let Ok(entries) = db::list_entries(&mut conn) {
|
||||
for e in entries {
|
||||
if let Some(parent) = std::path::Path::new(&e.path).parent() {
|
||||
dirs.insert(parent.to_path_buf());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dirs
|
||||
}
|
||||
|
||||
fn fast_dir_sig(dirs: &HashSet<PathBuf>) -> HashMap<PathBuf, i64> {
|
||||
let mut out = HashMap::new();
|
||||
for d in dirs {
|
||||
if let Ok(m) = std::fs::metadata(d) {
|
||||
out.insert(d.clone(), mtime_ns(&m));
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Diff two dir-mtime signatures: dirs added, removed, or changed.
|
||||
fn changed_dirs(
|
||||
old: &HashMap<PathBuf, i64>,
|
||||
next: &HashMap<PathBuf, i64>,
|
||||
) -> Vec<PathBuf> {
|
||||
let mut v: Vec<PathBuf> = next
|
||||
.iter()
|
||||
.filter(|(d, t)| old.get(d.as_path()) != Some(t))
|
||||
.map(|(d, _)| d.clone())
|
||||
.collect();
|
||||
for d in old.keys() {
|
||||
if !next.contains_key(d) {
|
||||
v.push(d.clone());
|
||||
}
|
||||
}
|
||||
v
|
||||
}
|
||||
|
||||
/// Live file watching — EVENT-DRIVEN, no tree polling:
|
||||
/// - Android: MainActivity's MediaStore ContentObserver → JNI → this
|
||||
/// thread (camera saves, media-scanner indexing, indexed writes).
|
||||
/// - Desktop: inotify/FSEvents via `notify` on the scan roots.
|
||||
/// - On wake: coalesce the burst, debounce for the write to settle,
|
||||
/// diff dir mtimes (a few stats), and rescan ONLY the changed
|
||||
/// subtrees. A 5-minute full pass is the safety net (in-place edits
|
||||
/// in the huge dir, anything the OS never reported).
|
||||
/// - The 1 s recv timeout doubles as a cheap secondary detector
|
||||
/// (dir-mtime diff, ~0.05 ms): raw out-of-band copies that the media
|
||||
/// scanner hasn't indexed yet are still caught within ~1 s.
|
||||
/// Live file watching — PURE PUSH, zero polling:
|
||||
/// - Android: MainActivity's FileObserver (kernel inotify, every watched
|
||||
/// directory) and MediaStore ContentObserver each write a payload line
|
||||
/// and push one unit here via JNI. This thread blocks on recv() and
|
||||
/// consumes the payload batch the instant a push lands. It burns zero
|
||||
/// CPU while idle and does no directory statting at all.
|
||||
/// - Desktop: inotify/FSEvents via `notify` on the scan roots; a burst is
|
||||
/// coalesced and answered with a full rescan (desktop is secondary).
|
||||
/// There is no periodic re-scan: the startup walk is the only full pass
|
||||
/// (it rebuilds the DB baseline), and every live change arrives as a push.
|
||||
fn watch_files(app: tauri::AppHandle) {
|
||||
let (tx, rx) = mpsc::channel::<WEvent>();
|
||||
let (tx, rx) = mpsc::channel::<()>();
|
||||
*WATCH_TX.lock().unwrap() = Some(tx.clone());
|
||||
std::thread::spawn(move || {
|
||||
loop {
|
||||
std::thread::sleep(std::time::Duration::from_secs(300));
|
||||
let _ = tx.send(WEvent::Full);
|
||||
}
|
||||
});
|
||||
#[cfg(not(target_os = "android"))]
|
||||
spawn_fs_watcher(tx);
|
||||
|
||||
let mut watched_dirs = collect_watched_dirs(&scan::roots());
|
||||
let mut sig = fast_dir_sig(&watched_dirs);
|
||||
let mut baseline = true;
|
||||
let mut last_dir_refresh = std::time::Instant::now();
|
||||
let mut last_full = std::time::Instant::now();
|
||||
|
||||
loop {
|
||||
let woke = match rx.recv_timeout(std::time::Duration::from_millis(100)) {
|
||||
Ok(e) => Some(e),
|
||||
Err(mpsc::RecvTimeoutError::Timeout) => None,
|
||||
Err(mpsc::RecvTimeoutError::Disconnected) => break,
|
||||
};
|
||||
let do_full = matches!(woke, Some(WEvent::Full));
|
||||
if let Some(WEvent::Fs) = woke {
|
||||
#[cfg(target_os = "android")]
|
||||
{
|
||||
match rx.recv() {
|
||||
Ok(()) => {
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
// Coalesce the burst, let the writes settle, coalesce
|
||||
// again, then rescan (desktop has no payload channel).
|
||||
while rx.try_recv().is_ok() {}
|
||||
std::thread::sleep(std::time::Duration::from_millis(600));
|
||||
while rx.try_recv().is_ok() {}
|
||||
rescan(&app);
|
||||
continue;
|
||||
}
|
||||
// Android: wait out an in-flight walk (startup baseline
|
||||
// only) — a delete applied before its DB apply would be
|
||||
// re-added by the walk's stale snapshot.
|
||||
while RESCANNING.load(std::sync::atomic::Ordering::Relaxed) {
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
}
|
||||
// Coalesce the burst: pushes for N copied files land a
|
||||
// few ms apart; give the stragglers 50 ms to arrive so
|
||||
// the whole batch is one connection + ONE emit, not N.
|
||||
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||
while rx.try_recv().is_ok() {}
|
||||
apply_mediasotre_payload(&app);
|
||||
continue;
|
||||
}
|
||||
#[cfg(not(target_os = "android"))]
|
||||
{
|
||||
while rx.try_recv().is_ok() {}
|
||||
std::thread::sleep(std::time::Duration::from_millis(600));
|
||||
while rx.try_recv().is_ok() {}
|
||||
}
|
||||
}
|
||||
if do_full {
|
||||
tr("watch: full rescan (5min)");
|
||||
rescan(&app);
|
||||
watched_dirs = collect_watched_dirs(&scan::roots());
|
||||
sig = fast_dir_sig(&watched_dirs);
|
||||
last_full = std::time::Instant::now();
|
||||
continue;
|
||||
}
|
||||
|
||||
// Refresh watched dirs periodically (every 30s) to pick up new subdirs
|
||||
if last_dir_refresh.elapsed() >= std::time::Duration::from_secs(30) {
|
||||
watched_dirs = collect_watched_dirs(&scan::roots());
|
||||
last_dir_refresh = std::time::Instant::now();
|
||||
}
|
||||
|
||||
// MediaStore event path (Android): MainActivity drops a one-line
|
||||
// payload per changed URI and wakes us via nativeFsChange.
|
||||
let _applied_ms = if RESCANNING.load(std::sync::atomic::Ordering::Relaxed) {
|
||||
false
|
||||
} else {
|
||||
apply_mediasotre_payload(&app)
|
||||
};
|
||||
|
||||
// Fast directory mtime-diff watch (Android and desktop): catches
|
||||
// out-of-band filesystem adds/removes within ~1 second without
|
||||
// scanning 10k files.
|
||||
let next = fast_dir_sig(&watched_dirs);
|
||||
let changed = if baseline {
|
||||
baseline = false;
|
||||
Vec::new()
|
||||
} else {
|
||||
changed_dirs(&sig, &next)
|
||||
};
|
||||
sig = next;
|
||||
|
||||
if !changed.is_empty() {
|
||||
tr(&format!("watch: {} changed dir(s)", changed.len()));
|
||||
rescan_subtrees(&app, &changed);
|
||||
watched_dirs = collect_watched_dirs(&scan::roots());
|
||||
sig = fast_dir_sig(&watched_dirs);
|
||||
Err(_) => break,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1419,9 +1188,8 @@ pub fn run() {
|
|||
// Warm the first two screens before Chromium's lazy loader gets
|
||||
// to them (it requests ~30 at once; we'd rather be ahead).
|
||||
set_prefetch_window(0, 36);
|
||||
// (The startup MediaStore fast path is triggered by
|
||||
// MainActivity.onCreate — it pushes via
|
||||
// nativeMediaStoreResults ~1.5 s in.)
|
||||
// (MainActivity.onCreate's startup catch-up pushes any
|
||||
// recently indexed media as a payload ~1.5 s in.)
|
||||
spawn_scan(handle.clone());
|
||||
// New photos appear in the grid ~2 s after being written.
|
||||
std::thread::spawn(move || watch_files(handle));
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@
|
|||
//! - a **per-file failure is skipped** — a file vanishing between
|
||||
//! readdir and stat is a normal race on an actively used
|
||||
//! directory (the user deleting while we walk), not a walk
|
||||
//! failure. Aborting on this killed deletion detection: every
|
||||
//! incremental rescan of a busy 10k-file directory aborted.
|
||||
//! Both walks (with-stat and readdir-only) filter to image
|
||||
//! extensions: library directories hold thousands of videos, and
|
||||
//! enumerating them would inject non-image rows into the DB.
|
||||
//! failure. Aborting on this killed deletion detection: a rescan
|
||||
//! of a busy 10k-file directory aborted on the first deleted file.
|
||||
//! The walk filters to image extensions: library directories hold
|
||||
//! thousands of videos too, and enumerating them would inject
|
||||
//! non-image rows into the DB (phantom blank cells, count swings).
|
||||
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
|
@ -81,17 +81,14 @@ fn file_metadata(p: &Path) -> io::Result<(i64, i64)> {
|
|||
Ok((mtime, md.len() as i64))
|
||||
}
|
||||
|
||||
/// Recursively collect all image entries below `roots`.
|
||||
/// `on_progress(n)` is called every 512 files found.
|
||||
/// Recursively collect all image entries below `roots`, streaming
|
||||
/// progress: `on_batch(&entries)` receives ALL entries collected so far
|
||||
/// every 512 new files, so the UI can show results while the scan is
|
||||
/// still running (first launch must not wait for the full DB build).
|
||||
/// `on_batch(&entries)` receives ALL entries collected so far every
|
||||
/// 512 new files, so the UI can show results while the scan is still
|
||||
/// running (first launch must not wait for the full DB build).
|
||||
/// Any filesystem error fails the walk (see module docs).
|
||||
pub fn walk(roots: &[PathBuf], on_progress: &dyn Fn(usize)) -> io::Result<Vec<Entry>> {
|
||||
walk_stream(roots, &|batch| on_progress(batch.len()))
|
||||
}
|
||||
|
||||
/// Like `walk`, but streams progress: `on_batch(&entries)` receives ALL
|
||||
/// entries collected so far every 512 new files, so the UI can show
|
||||
/// results while the scan is still running (first launch must not wait
|
||||
/// for the full DB build).
|
||||
pub fn walk_stream(
|
||||
roots: &[PathBuf],
|
||||
on_batch: &dyn Fn(&[Entry]),
|
||||
|
|
@ -105,53 +102,6 @@ pub fn walk_stream(
|
|||
Ok(out)
|
||||
}
|
||||
|
||||
/// Full walk (with stat) of ONE directory subtree.
|
||||
pub fn walk_dir_into(dir: &Path, out: &mut Vec<Entry>) -> io::Result<()> {
|
||||
if dir.is_dir() {
|
||||
walk_dir(dir, out, &|_| {})?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Readdir-only walk (NO per-file stat) of ONE directory subtree — for
|
||||
/// huge FUSE directories where stat'ing every file costs ~30 s; the
|
||||
/// caller supplies metadata for new files and keeps DB metadata for
|
||||
/// known ones.
|
||||
///
|
||||
/// FILTERS TO IMAGE EXTENSIONS (critical: a library directory holds
|
||||
/// thousands of videos too — enumerating them would inject non-image
|
||||
/// rows into the DB: phantom blank grid cells and count swings).
|
||||
/// A read_dir error fails the walk; per-file failures (file vanishing
|
||||
/// mid-walk — a normal race) are skipped.
|
||||
pub fn walk_dir_nostats(dir: &Path, cb: &mut dyn FnMut(&Path)) -> io::Result<()> {
|
||||
if !dir.is_dir() {
|
||||
return Ok(());
|
||||
}
|
||||
let mut stack = vec![dir.to_path_buf()];
|
||||
while let Some(d) = stack.pop() {
|
||||
for ent in std::fs::read_dir(&d)? {
|
||||
let ent = ent?;
|
||||
let p = ent.path();
|
||||
let Ok(ft) = ent.file_type() else { continue };
|
||||
if ft.is_dir() {
|
||||
if p.is_symlink() {
|
||||
continue;
|
||||
}
|
||||
if p.file_name().map_or(false, |n| n.to_string_lossy().starts_with('.')) {
|
||||
continue;
|
||||
}
|
||||
stack.push(p);
|
||||
} else if ft.is_file() {
|
||||
let ps = p.to_string_lossy();
|
||||
if is_image_path(&ps) {
|
||||
cb(&p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Full stat walk. Error semantics: a read_dir error fails the walk
|
||||
/// (the result would be incomplete — must never be applied); per-file
|
||||
/// failures (a file vanishing between readdir and stat — a normal race
|
||||
|
|
@ -221,7 +171,7 @@ mod tests {
|
|||
std::fs::write(dir.path().join("c.txt"), b"x").unwrap();
|
||||
std::fs::create_dir_all(dir.path().join("d")).unwrap();
|
||||
std::fs::write(dir.path().join("d").join("e.heic"), b"x").unwrap();
|
||||
let out = walk(&[dir.path().to_path_buf()], &|_| {}).unwrap();
|
||||
let out = walk_stream(&[dir.path().to_path_buf()], &|_| {}).unwrap();
|
||||
assert_eq!(out.len(), 3);
|
||||
assert!(out.iter().all(|e| e.size == 1));
|
||||
}
|
||||
|
|
@ -231,7 +181,7 @@ mod tests {
|
|||
let dir = tempfile::tempdir().unwrap();
|
||||
make_tree(dir.path(), 5000, 8);
|
||||
let t = std::time::Instant::now();
|
||||
let out = walk(&[dir.path().to_path_buf()], &|_| {}).unwrap();
|
||||
let out = walk_stream(&[dir.path().to_path_buf()], &|_| {}).unwrap();
|
||||
let elapsed = t.elapsed();
|
||||
assert_eq!(out.len(), 5000);
|
||||
assert!(
|
||||
|
|
@ -245,7 +195,7 @@ mod tests {
|
|||
fn missing_root_dir_is_an_error() {
|
||||
let r = vec![PathBuf::from("/nonexistent/gallery-test-xyz")];
|
||||
// is_dir() false → the root is skipped, empty result, no error.
|
||||
let out = walk(&r, &|_| {}).unwrap();
|
||||
let out = walk_stream(&r, &|_| {}).unwrap();
|
||||
assert!(out.is_empty());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
harnesses/ttimg/.tauriignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
frontend/dist/img/
|
||||
4305
harnesses/ttimg/Cargo.lock
generated
Normal file
20
harnesses/ttimg/Cargo.toml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[package]
|
||||
name = "ttimg"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# Tauri v2 mobile (Android): the CLI builds a cdylib .so loaded by the
|
||||
# Tauri activity; staticlib/rlib for the template's other targets.
|
||||
[lib]
|
||||
name = "ttimg_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"] }
|
||||
BIN
harnesses/ttimg/app-icon.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
3
harnesses/ttimg/build.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
11
harnesses/ttimg/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/ttimg/frontend/dist/img/000.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/ttimg/frontend/dist/img/001.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/ttimg/frontend/dist/img/002.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/003.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/004.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/005.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/006.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/007.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/008.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/ttimg/frontend/dist/img/009.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/010.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/011.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/012.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/013.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/ttimg/frontend/dist/img/014.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/015.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/016.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/017.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/018.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/019.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/020.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/021.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/022.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/023.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/024.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/025.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/026.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/027.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/028.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/029.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/ttimg/frontend/dist/img/030.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/031.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/032.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/033.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/034.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/035.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/036.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/037.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/038.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/ttimg/frontend/dist/img/039.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/040.jpg
vendored
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
harnesses/ttimg/frontend/dist/img/041.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/042.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/043.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/044.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/045.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/046.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/047.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/048.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/049.jpg
vendored
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
harnesses/ttimg/frontend/dist/img/050.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/051.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/052.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/053.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/054.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/055.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/056.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/057.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/058.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/ttimg/frontend/dist/img/059.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/060.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/061.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/ttimg/frontend/dist/img/062.jpg
vendored
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
harnesses/ttimg/frontend/dist/img/063.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/064.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/065.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/066.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/067.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/068.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/069.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/070.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/071.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/072.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/073.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/074.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/075.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/076.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/077.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/078.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/079.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/080.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
harnesses/ttimg/frontend/dist/img/081.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/082.jpg
vendored
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
harnesses/ttimg/frontend/dist/img/083.jpg
vendored
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
harnesses/ttimg/frontend/dist/img/084.jpg
vendored
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
harnesses/ttimg/frontend/dist/img/085.jpg
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |