In previous versions, when the aperture was fixed, e.g. for "Nikon AF-S Zoom-Nikkor 17-35mm f/2.8D IF-ED" then the MinAperture and MaxAperture fields in the API had the same value. However, now (don't ask me when it changed, I just noticed it), MinAperture would be 2.8 and MaxAperture 0.0. Was there any reason for this change? In the docs it says for MaxAperture "Biggest f-number possible (ex: 22). Can be equal to MinAperture." In the header of the lfLens docs it says "Unknown fields are set to NULL or 0." To me this is just plain confusing and feels a bit unpredictable.
This is a documentation bug in my opinion. But additionally, we have this on our long-term to do list, as "min/max aperture" itself is confusing.
Two years ago, we stopped guessing the max aperture from the lens name because too often it was incorrect. Moreover, we made a distinction between "only one aperture possible" and "max aperture unknown". In the first case, it is equal to "min aperture". In the latter case, it is zero.
The original author himself didn't really know what max aperature should mean: In one place, he defined it as the minimal f-stop number at maximal zoom, and in another place, the maximal possible f-stop number.
I think on the long run, the aperture should be replaced with "f-stop-number", and min/max refer to the global min/max values, no matter at which focal length. On the short run, the documentation shoule be fixed.
Last edit: Torsten Bronger 2015-12-05
At least in the main documentation, it is properly explained: http://lensfun.sourceforge.net/manual/el_lens.html
I went through all our docs and source code again and cannot find anything confusing. Actually, it is properly defined now, and in the release notes, the clarification of "max aperture" was explicitly mentioned. Note that before that, "max aperture" simply was not clearly defined in Lensfun. What exactly do you have to solve?
The xml doc at http://lensfun.sourceforge.net/manual/el_lens.html looks fine. But this is not where I looked for documentation. I looked at http://lensfun.sourceforge.net/manual/structlfLens.html#a8cac58535976392db8542b8a3c76f6c0 and there is no mention of any of those details. What I would like to read there is just what the numbers mean, especially since in the API there is no apparent distinction between single-value and min/max, it is only min/max with a special undocumented encoding.
About what I have to solve: Well, just semantics. I'm the developer of the python wrapper lensfunpy and I want to properly expose the metadata so that there are no surprising moments.
Is https://goo.gl/eLJAUh good? If not, please send a patch with your suggestion.
So for the case of "Nikon AF-S Zoom-Nikkor 17-35mm f/2.8D IF-ED" where MinAperture is returned as 2.8 and MaxAperture as 0 that would mean it is not a fixed aperture lens. Does that make sense? Not really, right? Maybe you could phrase it the other way around: "If both MinAperture and MaxAperture have the same value, then the lens is a fixed aperture lens." If they are both non-zero and different it is clear that it is not fixed aperture. In the case of MaxAperture 0 you just don't know, could be fixed, could be variable. This phrasing would capture all cases. Of course, you could also make it more explicit even and don't rely on the inference/reasoning of devs to figure this out.
In my personal opinion, including the "0" case in the explanations makes them only more complicated. Actually, the minimal explanation is totally clear and correct:
Ok, I think I agree, and the underlying issue as you said should probably be solved instead, like replacing it by f-stop number. I think basically I wanted to infer whether a lens is a fixed vs zoom lens, and I could imagine people writing code like
if minAperture==maxAperture then "fixed" else "zoom"
or something like that. Which would not be correct in all cases. So... maybe revert your doc string update again and let's postpone this issue.For zoom, you have to check MinFocal and MaxFocal.
Oops, right... ok, feel free to close this issue and revert your doc change to the original. I think the main issue was my general confusion. I now know how to handle all cases.
Okay, all right then.