From 11689fb14f3a4d0291e2ccc05d6cb3556e4ea1ab Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 28 Oct 2026 09:23:46 +0100 Subject: core: fix focal-length-to-scale constant (36 mm film width, not 35) 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) --- crates/wipfel/src/app.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/wipfel/src') diff --git a/crates/wipfel/src/app.rs b/crates/wipfel/src/app.rs index 38c220e..a7af089 100644 --- a/crates/wipfel/src/app.rs +++ b/crates/wipfel/src/app.rs @@ -391,7 +391,7 @@ pub fn app() -> Html { lon: p.get_view_long(), height: p.get_view_height(), az: p.get_center_angle().rem_euclid(360.0), - focal: (p.get_scale() * 35.0 / w as f64).clamp(1.0, 300.0), + focal: (p.get_scale() * 36.0 / w as f64).clamp(1.0, 300.0), pitch: p.get_pitch_angle(), roll: p.get_roll_angle(), vis: (0.11 - p.height_dist_ratio).clamp(0.01, 0.1), @@ -596,7 +596,7 @@ pub fn app() -> Html { vp.set(u); let w = img_size.0 as f64; if w > 0.0 { - pan.borrow_mut().set_scale(v * w / 35.0); + pan.borrow_mut().set_scale(v * w / 36.0); } }) }; -- cgit v1.2.3