summaryrefslogtreecommitdiff
path: root/crates/gipfel-core
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-11-09 10:21:03 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-11-09 10:21:03 +0100
commit31a47fc4393856a0a0380b2fdcf79f9dac72ad56 (patch)
tree6db58e01329bc0331fc7e4b8b2db09d7c8b3b6fc /crates/gipfel-core
parentd5967c1b91b14b3b4e5b0d9663e8a4d2a5e80533 (diff)
web: projection switch, external image URLs, zoom buttons
- ?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
Diffstat (limited to 'crates/gipfel-core')
-rw-r--r--crates/gipfel-core/src/metadata.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/gipfel-core/src/metadata.rs b/crates/gipfel-core/src/metadata.rs
index 428cf79..d9c98f9 100644
--- a/crates/gipfel-core/src/metadata.rs
+++ b/crates/gipfel-core/src/metadata.rs
@@ -768,3 +768,27 @@ mod tests {
assert!((pan.get_scale() - 50.0 * 1000.0 / 35.0).abs() < 1e-9);
}
}
+
+#[cfg(test)]
+mod save_tests {
+ use super::*;
+
+ #[test]
+ fn comment_roundtrip_preserves_projection_type() {
+ let mut md = ImageMetaData::new();
+ md.longitude = 10.5;
+ md.latitude = 47.0;
+ md.height = 2993.0;
+ md.direction = 57.4;
+ md.pitch = -20.0;
+ md.roll = 0.3;
+ md.focal_length_35mm = 27.0;
+ md.projection_type = 1; // cylindrical
+ // minimal valid JPEG (SOI, empty COM, EOI)
+ let jpg = b"\xff\xd8\xff\xfe\x00\x02\xff\xd9";
+ let out = md.save_image_to_bytes(jpg).unwrap();
+ let mut md2 = ImageMetaData::new();
+ md2.load_image_from_bytes(&out);
+ assert_eq!(md2.projection_type, 1, "projection type lost in comment roundtrip");
+ }
+}