mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-14 19:27:01 -04:00
A lensfun profile is scaled by the crop factor of the recorded frame. `lookup` took the body's from the database whenever the camera was in it, so a full-frame body shooting a crop of its sensor (APS-C / Super 35 mode, or switched there by an APS-C lens) had the profile applied as if the crop were the full frame: the crop's corners got the full frame's corner distortion and vignetting. On a Sony ILCE-1M2 in APS-C mode with the FE 100-400mm F4.5-5.6 GM OSS at 400 mm, the warp's r³ coefficient was the full frame's 0.0215 instead of 0.0096. The 35 mm equivalent focal length shows the crop: when it implies a crop factor more than 10 % above the body's, that wins (`frame_crop_factor`); within 10 % the difference is the tag's whole-millimetre rounding and the body's value stands. Without the body in the database the 35 mm equivalent is used, as before. Tests: `in_camera_crop_mode_uses_the_frames_crop_factor` (fails on main: in its profile the APS-C frame's vignetting gain is 0.40 instead of 0.18) covers APS-C mode, full frame, a 35 mm equivalent rounded by a millimetre, no body in the database and a hostile focal length. Checked on 19 private ILCE-1M2 ARWs (FE 100-400mm GM, Sigma 24-70mm F2.8 DG DN | Art, full frame and APS-C, firmware 2.01-4.00): every APS-C coefficient is the full-frame one scaled by 1/1.5². Co-Authored-By: Claude Opus 5.5 <[email protected]>