lensfun: Database file format

lensfun 0.2.7.0

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

Database file format

Here goes a simple lens database file, I hope I don't have to explain much what is what, as the format is pretty much self-documenting.

<lensdatabase>
<mount>
<name>Pentax K</name>
<compat>M42</compat>
</mount>
<lens>
<maker>Pentax</maker>
<model>SMC Pentax M 50mm f/1.4</model>
<mount>Pentax K</mount>
<cropfactor>1.0</cropfactor>
<focal>50</focal>
<aperture>1.4-22</aperture>
<type>rectilinear</type>
<calibration>
<!-- WARNING: this calibration data is completely bogus :) -->
<distortion model="ptlens" focal="50" a="0.012" b="-0.036" c="0" />
</calibration>
</lens>
<camera>
<maker>PENTAX Corporation</maker>
<model>PENTAX K10</model>
<mount>Pentax KAF2</mount>
<cropfactor>1.5</cropfactor>
</camera>
</lensdatabase>

Since lenses and cameras may be known with different names in different languages/countries, the library provides a built-in mechanism for name translations. You can provide such multi-language strings for every language you want, and when the library client will ask for string value, it will get the one in the current locale.

This mechanism is also useful sometimes when you want to use a name for camera which is different from the value put in EXIF data. For example:

<maker>KONICA MINOLTA</maker>
<maker lang="en">Konica Minolta</maker>
<maker lang="ru">Коника Минольта</maker>

The value without a "lang" attribute is always used for identification, but GUI may use the translated string for display. If no language matches, and an "en" translation is present, it is used. And only if there's no native translation and there's no "en" translation, the no-language version is used.

Here is a complete list of elements recognized by the library and the format of the data within elements.

- Describing camera mounts: <mount>
- Declaring cameras: <camera>
- Declaring lenses: <lens>