INI file format changes in 4.2

In Imatest 4.2.0 a new INI format was introduced. Previous INI files are not compatible with newer versions and INI files created in 4.2+ are not compatible with previous versions.

The most critical changes involve escaped characters. In prior versions, no characters were escaped in strings stored in the INI file. As of 4.2, special characters must be correctly escaped to be read correctly. Among other things, this allows us to handle non-ACII characters in INI file strings. For more details on these changes, see the Technical Details section below.

When starting 4.2+ Master, IS, or Studio for the first time, Imatest will check for any previous INI files. Specifically Imatest will search for imatest.ini, rescharts.ini, and multicharts.ini. If any of these files are found, they will be combined into a single file and scanned for any characters that should be escaped. A new file will be created: imatest-v2.ini. This will become the default INI file for all future 4.2+ use. Please note that this process does not apply to custom INI files.

To update a custom INI file to the current INI format, select the INI using the Select INI File… option in the INI File Settings menu. Once you have selected your INI file, click Update INI File. This will create a new file with the following format: <your-name>-v2.ini  Any rescharts.ini or multicharts.ini files in the same folder as your selected INI file will be merged into the new file and updated.

Important Imatest IT Note

If you are using Imatest IT these changes are particularly important to note. Imatest IT never modifies INI files, this is intentional to ensure that an INI file used for margin-sensitive testing are not accidentally changed in the middle of production. Because of this design, you can not use a pre-4.2 INI file with Imatest IT 4.2+ and you can not use a 4.2+ INI file with Imatest IT pre-4.2.

To update an INI file to be used with Imatest IT, please follow the instructions above for updating and INI file.

Technical Details

This section will enumerate the specific changes made to the actual format.

INI File Version

A new INI key has been introduced related to the new INI version. To assist tracking of INI file version the following key has been added:

IniFileVersion = #

Where # will be the version (2 in 4.2). You should never modify this value (removing this line will cause it to be replaced during the next run). Changing this value will likely result in a crash.

Escaped Characters

Prior to Imatest 4.2.0, no special characters in Imatest INI files were escaped. As of 4.2.0, special characters that might have other meanings (primarily backslashes) must be escaped to be properly read. For example, the following line might appear in a pre-4.2 INI file:

save_dir = C:\imatest\my_images\Results

In 4.2+ this line will appear as:

save_dir = C:\\imatest\\my_images\\Results

Unicode Characters

In previous versions of Imatest, INI files were not able to handle non-ASCII characters. As a result, no non-Latin characters could appear in file names or paths. The new INI format does allow for Unicode characters to be saved. This is accomplished by using the standard Unicode character code with special preceding characters. For example, 文件名 would be represented as the following:

\u6587\u4ef6\u540d

Arrays

In previous versions, INI file arrays were not always completely robust for all data types. The new format allows for more complex arrays.

Pre-4.2:

roi_mult: 10 10 20 20; 100 100 0 0;

4.2+:

roi_mult: [ 10 10 20 20; 100 100 0 0;]

Nested arrays will allow for 3+ dimensional arrays. However, these larger dimension arrays are not currently used by Imatest.