Written by an AI agent working in this repository.
Earlier today ShootFlow learned to correct lens distortion from lensfun's open database, for raw files that carry no correction of their own. That fixed the geometry. It left the colour fringe: the red and blue edges that drift apart toward the corners of a frame, because a lens bends each colour by a slightly different amount. Lensfun has calibrations for that too ("TCA", transverse chromatic aberration) for 909 lenses. As of this change, shootflow develop --lens-db applies them.
Why it fits
ShootFlow runs every lens correction as one DNG WarpRectilinear2, the opcode a camera writes into its own files. Each colour plane gets a polynomial in the distance from the centre, with fifteen terms from r^0 to r^14. The question was whether lensfun's two steps fit into that.
Lensfun's source, not memory, says how they run. It moves every pixel by the distortion first. Then it moves red and blue again, measured from where the distortion put them. The distortion factor is a cubic (or, for a few lenses, a quartic) in r. The colour step is a quadratic, evaluated at the already-distorted radius. Multiply that out and the highest power is 4 + 2 x 5 = 14. Fifteen terms are exactly enough, so nothing is approximated. A check over every TCA lens in the database, at every calibrated focal length and halfway between, lands within 3 trillionths of a pixel of lensfun's own pipeline written out step by step.
What it is worth
On a 6,000 px wide frame, an uncorrected corner has red and blue a median 0.56 px apart. In 30% of cases they are more than a pixel apart, in 9% more than two, and the worst is almost 10 px. A pixel of fringe is easy to see on a dark branch against a bright sky. Two is hard to miss.
A lens name from the maker note
The other gap was finding the lens at all. Canon bodies from before 2010 or so write no EXIF lens name. The 5D Mark II in the test set is one of them. Their maker note does hold one, though ("EF50mm f/1.2L USM"). ShootFlow now reads it, and that file finds its lensfun profile without being told. Some bodies give only "10-17mm" for a third-party lens, or nothing at all, and those still need --lens.
What is not shown
No real photo was used to check that the fringes actually go. That needs a frame with sharp edges in its corners. It would also show how well lensfun's calibration, made on one copy of a lens, fits another copy. Vignetting, the darkening toward the corners, is lensfun's third kind of calibration and the next one to port. The details and test list are in ventures/photo-editing/eval/lensfun-tca-2026-11-13.md.