Go to file
Greg Pomerantz 02dec62405 M4: full-screen viewer with pinch/pan zoom
- src/viewer.rs: full-size decode (turbojpeg DCT shrink, 2x-screen cap
  bounded by GPU max texture, EXIF orientation applied) + transform
  model (fit/clamp/zoom_at) + single-finger pan & double-tap state
  machine. 18 unit tests.
- Pinch: Slint 1.18's ScaleRotateGestureHandler. Key finding: the CORE
  (TouchState in internal/core/input.rs), not the backend, synthesizes
  PinchGesture from raw two-finger touches on every backend including
  Android — the second finger never reaches a TouchArea, so manual
  two-finger math is dead code (the earlier draft was removed).
- main.slint: Viewer overlay (image + status + close button + full-
  surface TouchArea + ScaleRotateGestureHandler). The close button must
  be declared AFTER the full-surface TouchArea: 1.18 TouchArea grabs
  every press (GrabMouse) and aborts the front-to-back sibling
  traversal.
- lib.rs: open/close/pinch/pointer wiring; Android back key (via the
  vendor CloseRequested patch) closes the viewer first.
- vendor: androidwindowadapter back-key -> CloseRequested patch
  (Slint 1.18 has no back-key close handling).
- gputex.rs: max_texture_size() for the decode cap.
- HANDOFF: M4 done; new gotchas 6.14-16; emulator two-finger sendevent
  (MT-B) injection recipe.

Verified on emulator (pad_avd): real two-finger pinch zoom, double-tap
zoom/reset, pan, button + back close, grid scroll unaffected. Phone
(Pixel 9 Pro, release aarch64): grid, viewer open, 4080x3072 decode,
double-tap, back. Pinch not injectable on the user build (SELinux
blocks /dev/input writes) — covered by unit tests + emulator.
2026-10-29 10:51:56 -04:00
docs/BUGS Jank-hunt perf feature: FR/STG/DECODE instrumentation, off by default 2026-10-29 08:11:51 -04:00
scripts GPU-resident thumbnails: worker uploads to Slint's wgpu device (gputex) 2026-10-28 10:57:15 -04:00
src M4: full-screen viewer with pinch/pan zoom 2026-10-29 10:51:56 -04:00
vendor M4: full-screen viewer with pinch/pan zoom 2026-10-29 10:51:56 -04:00
.gitignore M0: Slint gallery scaffold + development hand-off 2026-10-27 12:22:59 -04:00
build.rs M0: Slint gallery scaffold + development hand-off 2026-10-27 12:22:59 -04:00
Cargo.lock Jank-hunt perf feature: FR/STG/DECODE instrumentation, off by default 2026-10-29 08:11:51 -04:00
Cargo.toml Jank-hunt perf feature: FR/STG/DECODE instrumentation, off by default 2026-10-29 08:11:51 -04:00
HANDOFF.md M4: full-screen viewer with pinch/pan zoom 2026-10-29 10:51:56 -04:00
LICENSE Initial commit 2026-10-27 12:13:22 -04:00
README.md M1: metadata scan + sqlite DB + placeholder list 2026-10-27 13:28:33 -04:00

gallery

A high-performance image gallery for Android (primary), Linux and macOS — Rust + Slint 1.18.

Status: M1 (metadata scan + DB) done. See HANDOFF.md — the development hand-off with the full plan: architecture, thumbnail pipeline, milestones M1–M7, Slint gotchas, permission flow, and performance targets. Next: M2 (thumbnail engine).

Build

./scripts/build.sh debug     # debug x86_64 APK + install on emulator
./scripts/build.sh           # release x86_64 (emulator)
./scripts/build.sh aarch64   # release aarch64 (device)
cargo run                    # desktop (Linux needs libfontconfig1 + pkg-config)

Requires: Rust (rustup), cargo-apk2, Android SDK + NDK 27 (see HANDOFF.md §3 for exact paths/env).

License

GPL-3.0 (see LICENSE). Built on Slint, used under the Slint royalty-free license for proprietary apps (see HANDOFF.md §10.4).