summaryrefslogtreecommitdiff
path: root/crates
AgeCommit message (Collapse)Author
10 daysgipfel: README content (previous commit caught the file mid-write, empty)Johannes Hofmann
10 daysgipfel: refresh web README after the renameJohannes Hofmann
Was still titled wipfel with W1-era status and trunk-only instructions; now documents serve-here.sh/build-release.sh, the URL parameters and the current module layout.
10 daysMerge branch 'wasm-spike'Johannes Hofmann
# Conflicts: # crates/gipfel-core/src/metadata.rs
10 dayscore: is_visible wraps the azimuth difference and rejects non-finite inputJohannes Hofmann
GipfelFind.lean Finding 1: with |alph - a_center| > 2pi (user enters azimuth 400deg, or a fit leaves a_center unnormalized) the single fold produced a NEGATIVE 'distance' that passed every comparison, making hills behind the camera visible. NaN or infinite azimuths — and a NaN center, which made everything visible — passed as well. Fix at the point of use: wrap with % 2pi before the fold, and bail out on non-finite alph/a_center. Regression test pins the Lean witnesses (out_of_range_center_angle_stays_safe).
11 daysweb: projection switch, external image URLs, zoom buttonsJohannes Hofmann
- ?file= now also accepts absolute http(s) image URLs (CORS applies); README documents all URL parameters - Projection dropdown (rectilinear / cylindrical-panoramic), synced from the gipfel comment on load; cylindrical lifts the lens-FOV visibility limit (unlimited view angle) so 360 deg panoramas show peaks in every direction - force visibility rebuild on every image load (the change detection alone could keep a stale list when the limit value was unchanged) - Google-Maps-style +/- zoom buttons at the lower right of the canvas - save/load roundtrip test for the projection type in the gipfel comment; build stamp in the sidebar footer and ?debug=1 console diagnostics to spot stale cached bundles and inspect the effective visibility state
2026-11-06wasm front end becomes the main gipfel; add desktop installersJohannes Hofmann
- rename crates/wipfel -> crates/gipfel (crate, wasm artifact, dist, scripts, page titles); slogan back to "Photogrammetry for Mountain Images"; crates/wipfel-tauri -> crates/gipfel-desktop - new features in the wasm app: Save image (gipfel JPEG comment, same format as before, via browser download) and lens distortion profiles stored in localStorage in FLTK prefs format with camera auto-match on image load; profile name field, save/load and dropdown - gipfel-core: read GPSImgDirection from EXIF (magnetic -> true) as azimuth fallback; expose parse_prefs/serialize_prefs for the wasm build; ?file=/?az=/?pitch=/?roll=/?focal=/?vis= URL parameters - Tauri v2 wrapper crate building .deb, AppImage and (cross-compiled) Windows NSIS installers; safe stage-and-swap build-release.sh - README: web-centric Installation, concise Build section for the official targets (Web, Windows, Linux); drop native/Android mentions - release site moved dist/wipfel -> dist/gipfel
2026-10-30cli: -V flag; restricted export ignores occlusion; web visibility knobJohannes Hofmann
- gipfel-cli export-hills gains -V <ratio> (the visibility/prominence threshold, C default 0.07); default unchanged - export_hill_rows: restricted mode (-e, curated lists like the gipfelweb photo index) no longer drops FLAG_HIDDEN entries. The occlusion heuristic is for thinning the full peak database; a curated photo list should show every entry inside the field of view. Unrestricted export (golden-pinned) unchanged. - gipfelweb Makefile: V ?= 0.05 knob for the peak view, -V 0 for the photo index; per-image %.opts now appended after the standard flags (they were placed before the subcommand and silently ignored)
2026-10-30web: ship a Content-Security-Policy as meta tagJohannes Hofmann
Self-contained hardening, no server config required: default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; img-src 'self' blob: data:; connect-src 'self' blob: data:; style-src 'self' 'unsafe-inline' - script-src needs 'wasm-unsafe-eval' for WebAssembly compilation (the scoped exception; plain 'unsafe-eval' stays forbidden) and no inline script is allowed, so the module loader moved from an inline <script> to loader.js - style-src keeps 'unsafe-inline' because the Yew views position the find-peak popup and size the compass strip via style attributes - blob: in img-src/connect-src for createImageBitmap and blob reads; data: for inline assets Size budget note: unchanged (~550 KB gzipped total, well under the 1.5 MB plan budget).
2026-10-28web: fix redraw tick stalling in persistent resize closuresJohannes Hofmann
A UseStateHandle cloned into a long-lived closure derefs to its render-time snapshot (same root cause as the pinch bug), so tick.set(*tick + 1) wrote the same value on every resize after the first: no state change, no redraw, stale stretched canvas backing store — the distortion thought fixed by d465654 returned on the second resize (the window-resize listener, created once at startup, never worked at all). Yew 0.21 has no functional-update setter, so the tick now has a use_mut_ref mirror as the live counter.
2026-10-28web: image picker accepts images only againJohannes Hofmann
The */* workaround did not circumvent the MediaProvider EXIF redaction, so no reason to show non-image files in the picker.
2026-10-28web: move hill database loader below the track sectionJohannes Hofmann
Renamed to 'Load alternative hill database…' and placed after 'Load GPX Track…' — the default database loads automatically, so the button must not sit where it could look like a required first step.
2026-10-28web: fix panic when loading an alternative hill databaseJohannes Hofmann
The load result was matched on while the scrutinee's borrow_mut() was still alive; the Ok arm called pan.borrow() again, which panics (and traps the whole wasm module, hanging the app). End the borrow before the match.
2026-10-28core: guard atof prefix slicing against char boundariesJohannes Hofmann
The longest-numeric-prefix fallback sliced s[..i] at every byte index, which panics when i lands inside a multi-byte character (reachable via lossy-decoded Latin-1 database fields, e.g. a trailing degree sign). Skip non-boundary indices; behavior on ASCII numeric fields is unchanged. Includes regression test atof("12.5 deg").
2026-10-28core: fix focal-length-to-scale constant (36 mm film width, not 35)Johannes Hofmann
The 35mm film frame is 36 mm wide, so a lens with 35mm-equivalent focal length f projects with focal length f*w/36 in pixels. The original C++ code divided by 35, making the EXIF-derived initial scale ~2.9% too large (and the fitted focal readout ~2.9% low). - EXIF init and the focal slider/readout now use /36 - the gipfel JPEG comment KEEPS its historical scale*35/w encoding (focal_from_comment flag), so annotated JPEGs written by any older gipfel version still reproduce the identical view, and files saved by this version remain readable by them - new regression test focal_scale_exif_vs_comment; golden tests untouched (they pin the comment path) Verified against real photos: optical shots now agree with EXIF within ~1% (was ~3.6%).
2026-10-28web: sync orientation and focal sliders with the fitted valuesJohannes Hofmann
do_refit only updated the fit-info text; the Azimuth/Pitch/Roll/Focal sliders kept showing their pre-fit values because the slider state (vp) was never synced from the panorama after a fit. Long-standing wipfel bug, independent of the recent focal-constant change. The compass strip was unaffected (it reads the panorama at render time).
2026-10-28web: load an alternative hill database from the UIJohannes Hofmann
Secondary button under the database status line: picks a .dat (or gzipped) peak list at runtime — e.g. a regional file like everest.dat instead of the full 21k gipfel.dat. Markers and track reference hill indices, so they are dropped when the database is swapped.
2026-10-28core: guard atof prefix slicing against char boundariesJohannes Hofmann
The longest-numeric-prefix fallback sliced s[..i] at every byte index, which panics when i lands inside a multi-byte character (reachable via lossy-decoded Latin-1 database fields, e.g. a trailing degree sign). Skip non-boundary indices; behavior on ASCII numeric fields is unchanged. Includes regression test atof("12.5 deg").
2026-10-28core: fix focal-length-to-scale constant (36 mm film width, not 35)Johannes Hofmann
The 35mm film frame is 36 mm wide, so a lens with 35mm-equivalent focal length f projects with focal length f*w/36 in pixels. The original C++ code divided by 35, making the EXIF-derived initial scale ~2.9% too large (and the fitted focal readout ~2.9% low). - EXIF init and the focal slider/readout in both apps now use /36 - the gipfel JPEG comment KEEPS its historical scale*35/w encoding (focal_from_comment flag), so annotated JPEGs written by any older gipfel version still reproduce the identical view, and files saved by this version remain readable by them - new regression test focal_scale_exif_vs_comment; golden tests untouched (they pin the comment path)
2026-10-28web: follow system light/dark preferenceJohannes Hofmann
All colors moved into CSS custom properties on :root (dark default) with a prefers-color-scheme: light override block. The two canvas- drawn surfaces follow too: the viewport now clears transparent so the CSS canvas background shows through, and the compass strip reads its colors from the same variables via a new bridge::css_var helper. theme-color metas (dark + light variants) tint mobile browser chrome to match.
2026-10-28web: move hover peak info below the Track sectionJohannes Hofmann
Appearing between Display and Track it pushed the whole Track block down on every hover. As the last item before the bottom-pinned info texts the flexible spacer absorbs it — nothing jumps anymore.
2026-10-28web: tagline becomes the info link; desktop hover wordingJohannes Hofmann
The 'web gipfel photogrammetry' tag under the title now links to flpsed.org/gipfel.html (grey like plain text, accent blue on hover); the separate 'More information…' row is gone. Hover readout uses the desktop phrasing: 'Name · 2849 m · distance 12.34 km'.
2026-10-28web: usability pass — panel state, conditional buttons, track placement, ↵Johannes Hofmann
hover distance - control panel starts open on all screen sizes (so the image picker is reachable on phones); it auto-collapses on narrow screens once an image is loaded - 'Fit to window' and the whole Track section only appear when an image is loaded - Track section moved directly below Display, above the pinned info texts (which now carry the margin-top: auto) - hover readout shows the distance to the peak in km, matching the desktop format 'name · height m · dist km'
2026-10-27Remove gipfel-wasm spike crateJohannes Hofmann
Superseded by wipfel; its feasibility question (pure-Rust core in the browser) was answered and documented.
2026-10-27web: GPS paste field in Viewpoint sectionJohannes Hofmann
One text field accepting '47.676,13.32042' (optionally ',alt' as a third component; commas, semicolons or spaces as separators) — the format gallery apps show, so the coordinates can simply be copied and pasted. This replaces the PWA/share-target detour for getting a viewpoint onto mobile: EXIF GPS may be redacted by the OS, but the gallery displays the true coordinates for manual transfer.
2026-10-27Revert "wipfel: PWA — manifest, service worker, Web Share Target"Johannes Hofmann
This reverts commit 2df51e89039b9b160aafb52b700e874411eb0555.
2026-10-27wipfel: PWA — manifest, service worker, Web Share TargetJohannes Hofmann
- manifest.webmanifest: standalone, dark theme, mountain icons (regular + maskable) - sw.js: network-first with cache fallback -> full offline after first visit (wasm + hill DB included); versioned cache, stale caches pruned - share_target: images shared to the installed app are POSTed to __share; the SW stashes the bytes at __shared and redirects with ?shared=1; the app picks them up on startup and cleans the URL - index.html: manifest link, theme-color, icons, SW registration - build/serve scripts ship the new files; dist refreshed Note: sharing does not bypass AOSP GPS redaction when the share source passes a MediaStore URI (the browser is still the reader) — the .nomedia/rename trick remains the way to get GPS EXIF into a browser.
2026-10-27wipfel-droid: Android wrapper APK (WebView + ACCESS_MEDIA_LOCATION)Johannes Hofmann
Thin wrapper so wipfel can read original photo bytes: browsers cannot declare ACCESS_MEDIA_LOCATION, so the OS always redacts GPS EXIF from images they read. Our own app declares and requests it (plus READ_MEDIA_IMAGES) and gets the intact files. - WebView served from a loopback AssetServer (fetch/WASM need a real HTTP origin; file:// is blocked) - file picker wired through WebChromeClient (accepts any file type) - zero androidx dependencies, plain Activity, minSdk 29 - build.sh: wasm release site -> assets -> assembleDebug (~3MB APK) - loader: fall back to plain gipfel.dat (aapt gunzips .gz assets)
2026-10-27web: allow any file type in the image pickerJohannes Hofmann
MediaProvider only redacts GPS EXIF in files it indexes as images. A copy renamed to a non-image extension (or under a .nomedia folder) reaches the browser untouched — an all-files picker makes that route usable on GrapheneOS/AOSP where browsers cannot hold ACCESS_MEDIA_LOCATION.
2026-10-27web: fix pinch zoom — stale use_state snapshots clobbered each otherJohannes Hofmann
A UseStateHandle cloned into a callback derefs to its render-time snapshot (documented Yew behaviour). Pinch emitted zoom and pan as two separate read-modify-writes per event: both read the same stale snapshot, so the pan write reverted the zoom write on every event and the scale never moved. Wheel zoom survived because it emits alone with a render between events. Fix: keep the authoritative ViewState in a use_mut_ref mirror with an apply_view helper (read live, mutate, write mirror + use_state), and fold pinch zoom+pan into a single combined update. Removes all the pinch diagnostic probes (debug callback, event counters, build stamp).
2026-10-27web: show tracked finger positions in pinch probe (build 27k)Johannes Hofmann
2026-10-27web: seed counter probe (build 27j)Johannes Hofmann
2026-10-27web: zoom readback + fit tripwire probes (build 27i)Johannes Hofmann
2026-10-27web: pinch probe with pointer-event counters (build 27g)Johannes Hofmann
2026-10-27web: probe zoom callback directly (build 27f)Johannes Hofmann
2026-10-27web: pinch debug also shows current view scale (build 27e)Johannes Hofmann
2026-10-27web: pinch debug shows zoom factor per event (build 27d)Johannes Hofmann
2026-10-27web: always show canvas status overlay + build stampJohannes Hofmann
The overlay was suppressed whenever the panel was open — but Firefox on Android defaults to desktop-site mode, which reports a 980px viewport and thus keeps the panel open on phones. The overlay now always shows (it doubles as the pinch-diagnostic readout), and the initial status carries a build stamp so a stale cached page is recognizable at a glance.
2026-10-27web: dev script must copy index.html too (viewport meta never deployed)Johannes Hofmann
serve-here.sh only refreshed style.css and the wasm bundle, so the viewport meta change that frees the pinch gesture for the app never reached the served page. Copy the loader page as well, and surface the status line as a small overlay over the canvas when the control panel is collapsed (mobile) — this is also where the pinch pointer diagnostics become visible on phones.
2026-10-27web: pinch diagnostics in status line + resilient pointer tableJohannes Hofmann
Second data point needed for the mobile pinch issue: the status line now shows pointer activity (pointerdown id/pts, pointercancel id/pts, pinch distance) so it is visible on the phone whether the second pointer arrives at all or whether the browser cancels pointers when pinching. Also: only capture the primary pointer (capturing every finger confuses some mobile browsers), and pointercancel now removes just that pointer instead of clearing the table — a browser that 'cancels' finger one as finger two lands no longer makes pinch impossible to form.
2026-10-27web: keep browser from stealing the pinch gestureJohannes Hofmann
Firefox on Android may consume two-finger pinch for page zooming despite touch-action: none on the canvas. Disable page zooming via the viewport meta (maximum-scale=1, user-scalable=no) so the gesture reaches the app as pointer events; the app provides its own zoom. Also join touch pointers seen only via pointermove into the pointer table, so a swallowed second pointerdown cannot break pinch.
2026-10-27web: mobile fixes — pinch zoom, dynamic viewport height, wider acceptJohannes Hofmann
- two-finger pinch on the viewport canvas: pointer table tracks all active pointers; pinch emits zoom anchored at the finger midpoint plus pan by the midpoint delta; a second finger cancels an in-flight pan/marker drag, the remaining finger resumes panning, and pinch gestures never fire a click - 100dvh (with 100vh fallback) for the app shell: on mobile browsers 100vh includes the area behind the dynamic URL bar, which pushed the compass strip below the visible fold - file input accepts image/* so Android pickers offer all photos and transcode exotic formats (HEIC) to decodable ones
2026-10-27web: always redraw when the canvas CSS size changesJohannes Hofmann
The ResizeObserver only re-fit the image; with user_moved set (after any manual pan/zoom) it did nothing, so the canvas backing store kept its old dimensions and the browser stretched the stale bitmap — visible distortion on sidebar collapse and window resize. The observer now always bumps the redraw tick (backing store resyncs in the draw effect, compass included) and re-fits additionally when the view has not been moved by hand.
2026-10-27web: commit built static site under dist/wipfel/Johannes Hofmann
The flpsed.org site is generated statically; keeping the deployable bundle in the tree lets the site pipeline pick it up directly. Regenerate with crates/wipfel/build-release.sh.
2026-10-27web: release build script producing a deployable static siteJohannes Hofmann
build-release.sh assembles dist/wipfel/ with the loader page, style, wasm bundle and the gzipped hill database. All runtime fetches are relative to the page URL, so the directory works under any path on any static server (verified from a subdirectory).
2026-10-27web: peak labels on by defaultJohannes Hofmann
2026-10-27web: link to the gipfel project page at the top of the control paneJohannes Hofmann
2026-10-27web: pin Track section to the bottom of the control paneJohannes Hofmann
'Load GPX Track…' and the Track width slider now live in their own Track section below everything else, held at the bottom of the sidebar via margin-top: auto.
2026-10-27web: FOV visibility limit, GPX controls in Display, collapsible sidebarJohannes Hofmann
- port of the desktop bump() lens-FOV clamp: max_view_angle is the angle at which the (distorted) projection reaches the image edge; peaks beyond it cannot be inside the photo even when the fitted distortion folds their projection back into the image. Recomputed each render (idempotent, only rebuilds visibility on change) — this is what let impossible peaks show up at high visibility settings - 'Load GPX Track…' moved from the top into the Display section next to the Track width slider (optional, advanced) - collapsible control panel: collapse button in the sidebar corner, floating hamburger button over the canvas when hidden; starts collapsed on viewports narrower than 900px
2026-10-27web: GPX track loadingJohannes Hofmann
- core: track::load_gpx_from_bytes (path wrapper delegates to it; same hardening: size cap, no entity expansion, direct-child <ele>) - sidebar: 'Load GPX Track…' button + hidden .gpx file input; the track swaps in via remove_hills(FLAG_TRACK_POINT) + add_hills, so marker hill indices never shift (track hills always live at the end of the hill list) - rendering: desktop parity — consecutive visible points joined with round-cap strokes, width = scale*track_width/(dist_m*10) clamped to [1,1000] image px, red (blue when hidden by terrain); a Track width slider (50-1000 m, default 200) appears in Display once a track is loaded - track points and duplicates are excluded from guide dots, hover and click hit-testing (they are scenery, not markable peaks)
2026-10-27web: process label layout right-to-left like the desktopJohannes Hofmann
The desktop lays out labels in alpha-descending order (the C pointer-array sort), which on screen means right to left — so the leftmost peak of a collision cluster ends up on top of the stack. The web port sorted by screen x ascending, inverting every stack and making labels look assigned to the wrong peaks. Sort descending; the break-early scan in layout_label_y stays valid because it only relies on monotonic x, and labels extend rightward just like in C. Verified against the desktop rendering of the same panorama photo and a right-to-left replay of the layout in the label simulator.