mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-26 02:59:17 -06:00
Merged HDR DNGs lost the camera's embedded lens correction: load_frame strips the lens opcodes from each source (frames are merged uncorrected) and write_linear_dng wrote no OpcodeList3, so Optics ▸ Enable Lens Corrections did nothing on the result (Sony ILCE-7M3/7RM4A, Panasonic/Leica, DNGs with their own opcodes). Each raw frame now keeps the lens corrections it applies (the DNG 1.6 skip rule already applied), re-expressed for the default crop develop keeps by the new Opcode::cropped: the centre moves into the crop and coefficients are rescaled for the crop's farthest corner. HdrResult carries the reference frame's and the DNG writes them as its OpcodeList3. Frames turned before merging (mixed orientations) and panoramas carry none. Tests: cropped corrections give the crop of the corrected whole (WarpRectilinear, WarpRectilinear2 with and without reciprocal, FixVignetteRadial); an HDR merge of cropped, corrected brackets, upright and vertical, gives the same profile correction as its reference photo (fails without the fix). Real brackets not measured yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015gRtdWF1E9358FfzhzYqCS