Skip to content

Scaling factor API changes break existing image edits #945

@jakubfi

Description

@jakubfi

Scale factor used by lfModifier::EnableScaling() and lfModifier::GetAutoScale() has different meaing in 0.3.2 and git lensfun versions. This results in broken image edits done in a program compiled with stable lensfun version when opened in a program compiled with current development lensfun version.

Actual case: When lens correction is applied in darktable compiled against lensfun-0.3.2 sidecar file is written with, say, scaling factor set to 1.033 (as computed by the library). Opening the same edit in darktable compiled against lensfun-git sets the scaling factor to 1.033 again, causing distortion correction artifacts on the edge of the image. When lens corrections are re-applied, scaling factor is now set to 1.047 and image looks good again.

Automatically resetting the scale factor in darktable after switching to lensfun-next from 0.3.2 is not a solution, because user may set have it to a deifferent, preferred value (which API allows for).

lensfun-next should not redefine the actual meaning of the scaling factor (even if it was wrong in the beginning). Instead, it should do all the necessary back and forth calculations behind the scenes of EnableScaling() and GetAutoScale(), and keep the scaling API consistent across versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions