File Mode

Metadata Configuration File

On this page

Sometimes an image file doesn't contain all the information FoCal needs to run a File Mode test. For example:

  • No aperture information for manual aperture lenses
  • No aperture/focal length information for adapted lenses
  • Missing focus adjustment (AF Microadjustment, AF Fine Tune etc) information for cameras that do not supply this information in the file

You can supply the missing information in a configuration file.

The meta.json file

Create a text file called meta.json in the same folder as the image files you're analysing. FoCal applies it to the files in that folder.

Here is an example meta.json file. It tells FoCal that 15 Live View shots were taken in groups of three, at focus adjustment values from -20 to +20:


[
{
"filenames": ["30", "31", "32"],
"afType": "live",
"afmaActive": true,
"shotAFMA": -20
},
{
"filenames": ["33", "34", "35"],
"afType": "live",
"afmaActive": true,
"shotAFMA": -10
},
{
"filenames": ["36", "37", "38"],
"afType": "live",
"afmaActive": true,
"shotAFMA": 0
},
{
"filenames": ["39", "40", "41"],
"afType": "live",
"afmaActive": true,
"shotAFMA": 10
},
{
"filenames": ["42", "43", "44"],
"afType": "live",
"afmaActive": true,
"shotAFMA": 20
}
]

Metadata config file options

Overview

The file uses JSON (JavaScript Object Notation), a widely used, well-documented text format.

Key points:

  • The whole file is enclosed in square brackets, as above (a JSON array).
  • Each set of metadata, for one or more files, is enclosed in curly braces (a JSON object). Separate the sets with commas.
  • Each set must contain a selector, filename or filenames, and one or more metadata values.
  • Separate each name from its value with a colon, and each name/value pair from the next with a comma.
  • Put every name (such as filename or afType) in straight double quotes (").
  • Don't put numbers or true/false values in quotes. Put all other values in quotes.

Selecting Files

Each metadata set contains a selector which is either filename or filenames:

filename

Part or all of a filename. For example, img123.jpg matches a single file, and 123 matches any file with 123 in its name.

Example:


"filename": "123"

filenames

Works like filename, but takes a list in square brackets, to match several files. The example at the top of the page uses this.

Example:


"filenames": ["30", "31", "32"]

This applies the metadata to every file whose name contains one of the values, e.g. IMG1230.jpg, IMG1231.arw, IMG1232.nef, photo_321.jpg (the bold part shows the match).

Metadata Values

You can set the following values. A value in meta.json overrides the same value in the file.

aperture

Numeric value to specify the aperture.

Example:


"aperture": 5.6

shutterSpeed

Numeric value to specify the shutter speed.

Example:


"shutterSpeed": 0.1

iso

Numeric value to specify the ISO.

Example:


"iso": 200

focalLength

Numeric value to specify the focal length (in mm) used for the shot.

Example:


"focalLength": 50

minFocalLength

Numeric value to specify the minimum focal length (in mm) of the lens.

Example:


"minFocalLength": 24

maxFocalLength

Numeric value to specify the maximum focal length (in mm) of the lens.

Example:


"maxFocalLength": 70

lensSerialNumber

Text value to specify the lens serial number.

The value must be enclosed in quotes.

Example:


"lensSerialNumber": "12341234"

focusDistance

Numeric value to specify the focus distance (in metres) for the shot.

Example:


"focusDistance": 2.4

imageStabilisation

Boolean value (true/false) to specify if Image Stabilisation is active.

Example:


"imageStabilisation": true

afmaActive

Boolean value (true/false) to specify if the Focus Adjustment is active. Note that this must be set to true in order for the shotAFMA value to be applied.

Example:


"afmaActive": true

shotAFMA

Numeric value to specify the Focus Adjustment value applied for this shot.

Example:


"shotAFMA": -7

defocusDir

Enumeration for the Defocus Direction. Options are:

  • None
  • Near
  • Far

The value must be enclosed in quotes.

Example:


"defocusDir": "None"

defocusAmount

Enumeration for the Defocus Amount. Options are:

  • None
  • Small
  • Large

The value must be enclosed in quotes.

Example:


"defocusAmount": "Small"

afType

Enumeration for the Autofocus Type. Options are:

  • None
  • PDAF
  • Live

The value must be enclosed in quotes.

Example:


"afType": "PDAF"