summaryrefslogtreecommitdiff
path: root/crates/gipfel-core
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-11-06 09:52:26 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-11-06 09:52:26 +0100
commitd5967c1b91b14b3b4e5b0d9663e8a4d2a5e80533 (patch)
tree4ac34f1e81b73b24139ac0eafa2db72f524f2a42 /crates/gipfel-core
parentdbc0fd52a8497c5002e8311eb1728050a4e97c7a (diff)
wasm front end becomes the main gipfel; add desktop installers
- 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
Diffstat (limited to 'crates/gipfel-core')
-rw-r--r--crates/gipfel-core/src/metadata.rs16
-rw-r--r--crates/gipfel-core/src/profile.rs14
2 files changed, 29 insertions, 1 deletions
diff --git a/crates/gipfel-core/src/metadata.rs b/crates/gipfel-core/src/metadata.rs
index 9d73a8d..428cf79 100644
--- a/crates/gipfel-core/src/metadata.rs
+++ b/crates/gipfel-core/src/metadata.rs
@@ -232,6 +232,22 @@ impl ImageMetaData {
}
}
}
+ // Phone cameras record the shooting direction as GPSImgDirection.
+ // Used only when no gipfel comment provided a direction. A magnetic
+ // reference ('M') is converted to true north with the current
+ // declination of the Eastern Alps (~+2.4 deg east, IGRF 2020s);
+ // the residual error stays below typical phone compass noise.
+ if self.direction.is_nan() {
+ if let Some(f) = exif.get_field(Tag::GPSImgDirection, In::PRIMARY) {
+ if let Some(v) = field_tofloat(f, 0) {
+ let mut dir = v;
+ if exif_ref_is(&exif, Tag::GPSImgDirectionRef, "M") {
+ dir += 2.4;
+ }
+ self.direction = dir;
+ }
+ }
+ }
}
}
diff --git a/crates/gipfel-core/src/profile.rs b/crates/gipfel-core/src/profile.rs
index e8bda68..2eff8f6 100644
--- a/crates/gipfel-core/src/profile.rs
+++ b/crates/gipfel-core/src/profile.rs
@@ -112,7 +112,19 @@ pub fn sanitize_name(name: &str) -> Result<(), Error> {
Ok(())
}
-/// Parse a prefs file into ordered (name, profile) pairs. Tolerant:
+/// Parse a prefs file into ordered (name, profile) pairs. Tolerant: comments
+/// (`;`), the root group `[.]`, blank lines and unknown keys are ignored;
+/// values are parsed with Rust's `f64` (superset of C `%g`).
+pub fn parse_prefs(text: &str) -> Vec<(String, Profile)> {
+ parse(text)
+}
+
+/// Serialize profiles in FLTK's layout so the C version can read our file.
+pub fn serialize_prefs(profiles: &[(String, Profile)]) -> String {
+ serialize(profiles)
+}
+
+/// Parse a prefs file into ordered (name, profile) pairs. Tolerant:
/// comments (`;`), the root group `[.]`, blank lines and unknown keys are
/// ignored; values are parsed with Rust's `f64` (superset of C `%g`).
fn parse(text: &str) -> Vec<(String, Profile)> {