Ignore:
Timestamp:
2021-02-26T19:39:51+13:00 (3 years ago)
Author:
anupama
Message:

Committing the improvements to EmbeddedMetaPlugin's processing of Keywords vs other metadata fields. Keywords were literally stored as arrays of words rather than phrases in PDFs (at least in Diego's sample PDF), whereas other meta fields like Subjects and Creators stored them as arrays of phrases. To get both to work, Kathy updated EXIF to a newer version, to retrieve the actual EXIF values stored in the PDF. And Kathy and Dr Bainbridge came up with a new option that I added called apply_join_before_split_to_metafields that's a regex which can list the metadata fields to apply the join_before_split to and whcih previously always got applied to all metadata fields. Now it's applied to any *Keywords metafields by default, as that's the metafield we have experience of that behaves differently to the others, as it stores by word instead of phrases. Tested on Diego's sample PDF. Diego has double-checked it to works on his sample PDF too, setting the split char to ; and turning on the join_before_split and leaving apply_join_before_split_to_metafields at its default of .*Keywords. File changes are strings.properties for the tooltip, the plugin introducing the option and working with it and Kathy's EXIF updates affecting cpan/File and cpan/Image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cpan/Image/ExifTool/NikonCustom.pm

    r24107 r34921  
    1616use vars qw($VERSION);
    1717
    18 $VERSION = '1.06';
     18$VERSION = '1.17';
     19
     20my %offOn = ( 0 => 'Off', 1 => 'On' );
     21my %onOff = ( 0 => 'On', 1 => 'Off' );
     22my %noYes = ( 0 => 'No', 1 => 'Yes' );
    1923
    2024# custom settings for the D80 (encrypted) - ref JD
     
    3034        Name => 'Beep',
    3135        Mask => 0x80,
    32         PrintConv => {
    33             0x00 => 'On',
    34             0x80 => 'Off',
    35         },
     36        PrintConv => \%onOff,
    3637    },
    3738    0.2 => { # CS4
    3839        Name => 'AFAssist',
    3940        Mask => 0x40,
    40         PrintConv => {
    41             0x00 => 'On',
    42             0x40 => 'Off',
    43         },
     41        PrintConv => \%onOff,
    4442    },
    4543    0.3 => { # CS5
     
    4745        Mask => 0x20,
    4846        PrintConv => {
    49             0x00 => 'Release Locked',
    50             0x20 => 'Enable Release',
     47            0 => 'Release Locked',
     48            1 => 'Enable Release',
    5149        },
    5250    },
     
    5452        Name => 'ImageReview',
    5553        Mask => 0x10,
    56         PrintConv => {
    57             0x00 => 'On',
    58             0x10 => 'Off',
    59         },
     54        PrintConv => \%onOff,
    6055    },
    6156    0.5 => { # CS17
    6257        Name => 'Illumination',
    6358        Mask => 0x08,
    64         PrintConv => {
    65             0x00 => 'Off',
    66             0x08 => 'On',
    67         },
     59        PrintConv => \%offOn,
    6860    },
    6961    0.6 => { # CS11
    7062        Name => 'MainDialExposureComp',
    7163        Mask => 0x04,
    72         PrintConv => {
    73             0x00 => 'Off',
    74             0x04 => 'On',
    75         },
     64        PrintConv => \%offOn,
    7665    },
    7766    0.7 => { # CS10
     
    7968        Mask => 0x01,
    8069        PrintConv => {
    81             0x00 => '1/3 EV',
    82             0x01 => '1/2 EV',
     70            0 => '1/3 EV',
     71            1 => '1/2 EV',
    8372        },
    8473    },
     
    8675        Name => 'AutoISO',
    8776        Mask => 0x40,
    88         PrintConv => {
    89             0x00 => 'Off',
    90             0x40 => 'On',
    91         },
     77        PrintConv => \%offOn,
    9278    },
    9379    1.2 => { # CS7-a
     
    9581        Mask => 0x30,
    9682        PrintConv => {
    97             0x00 => 200,
    98             0x10 => 400,
    99             0x20 => 800,
    100             0x30 => 1600,
     83            0 => 200,
     84            1 => 400,
     85            2 => 800,
     86            3 => 1600,
    10187        },
    10288    },
     
    10692        PrintConvColumns => 2,
    10793        PrintConv => {
    108             0x00 => '1/125 s',
    109             0x01 => '1/100 s',
    110             0x02 => '1/80 s',
    111             0x03 => '1/60 s',
    112             0x04 => '1/40 s',
    113             0x05 => '1/30 s',
    114             0x06 => '1/15 s',
    115             0x07 => '1/8 s',
    116             0x08 => '1/4 s',
    117             0x09 => '1/2 s',
    118             0x0a => '1 s',
     94            0 => '1/125 s',
     95            1 => '1/100 s',
     96            2 => '1/80 s',
     97            3 => '1/60 s',
     98            4 => '1/40 s',
     99            5 => '1/30 s',
     100            6 => '1/15 s',
     101            7 => '1/8 s',
     102            8 => '1/4 s',
     103            9 => '1/2 s',
     104            10 => '1 s',
    119105        },
    120106    },
     
    123109        Mask => 0xc0,
    124110        PrintConv => {
    125             0x00 => 'AE & Flash',
    126             0x40 => 'AE Only',
    127             0x80 => 'Flash Only',
    128             0xc0 => 'WB Bracketing',
     111            0 => 'AE & Flash',
     112            1 => 'AE Only',
     113            2 => 'Flash Only',
     114            3 => 'WB Bracketing',
    129115        },
    130116    },
     
    133119        Mask => 0x20,
    134120        PrintConv => {
    135             0x00 => '0,-,+',
    136             0x20 => '-,0,+',
     121            0 => '0,-,+',
     122            1 => '-,0,+',
    137123        },
    138124    },
     
    141127        Mask => 0xe0,
    142128        PrintConv => {
    143             0x00 => '5 s',
    144             0x20 => '10 s',
    145             0x40 => '20 s',
    146             0x60 => '1 min',
    147             0x80 => '5 min',
    148             0xa0 => '10 min',
     129            0 => '5 s',
     130            1 => '10 s',
     131            2 => '20 s',
     132            3 => '1 min',
     133            4 => '5 min',
     134            5 => '10 min',
    149135        },
    150136    },
     
    153139        Mask => 0x1c,
    154140        PrintConv => {
    155             0x00 => '4 s',
    156             0x04 => '6 s',
    157             0x08 => '8 s',
    158             0x0c => '16 s',
    159             0x10 => '30 s',
    160             0x14 => '30 min',
     141            0 => '4 s',
     142            1 => '6 s',
     143            2 => '8 s',
     144            3 => '16 s',
     145            4 => '30 s',
     146            5 => '30 min',
    161147        },
    162148    },
     
    165151        Mask => 0x03,
    166152        PrintConv => {
    167             0x00 => '2 s',
    168             0x01 => '5 s',
    169             0x02 => '10 s',
    170             0x03 => '20 s',
     153            0 => '2 s',
     154            1 => '5 s',
     155            2 => '10 s',
     156            3 => '20 s',
    171157        },
    172158    },
     
    175161        Mask => 0x1e,
    176162        PrintConv => {
    177             0x00 => 'AE/AF Lock',
    178             0x02 => 'AE Lock Only',
    179             0x04 => 'AF Lock Only',
    180             0x06 => 'AE Lock (hold)',
    181             0x08 => 'AF-ON',
    182             0x0a => 'FV Lock',
    183             0x0c => 'Focus Area Selection',
    184             0x0e => 'AE-L/AF-L/AF Area',
    185             0x10 => 'AE-L/AF Area',
    186             0x12 => 'AF-L/AF Area',
    187             0x14 => 'AF-ON/AF Area',
     163            0 => 'AE/AF Lock',
     164            1 => 'AE Lock Only',
     165            2 => 'AF Lock Only',
     166            3 => 'AE Lock (hold)',
     167            4 => 'AF-ON',
     168            5 => 'FV Lock',
     169            6 => 'Focus Area Selection',
     170            7 => 'AE-L/AF-L/AF Area',
     171            8 => 'AE-L/AF Area',
     172            9 => 'AF-L/AF Area',
     173            10 => 'AF-ON/AF Area',
    188174        },
    189175    },
     
    191177        Name => 'AELock',
    192178        Mask => 0x01,
    193         PrintConv => {
    194             0x00 => 'Off',
    195             0x01 => 'On',
    196         },
     179        PrintConv => \%offOn,
    197180    },
    198181    4.3 => { # CS30
     
    200183        Mask => 0xc0,
    201184        PrintConv => {
    202             0x00 => '1 min',
    203             0x40 => '5 min',
    204             0x80 => '10 min',
    205             0xc0 => '15 min',
     185            0 => '1 min',
     186            1 => '5 min',
     187            2 => '10 min',
     188            3 => '15 min',
    206189        },
    207190    },
     
    210193        Mask => 0x80,
    211194        PrintConv => {
    212             0x00 => 'Standard (Main Shutter, Sub Aperture)',
    213             0x80 => 'Reversed (Main Aperture, Sub Shutter)',
     195            0 => 'Standard (Main Shutter, Sub Aperture)',
     196            1 => 'Reversed (Main Aperture, Sub Shutter)',
    214197        },
    215198    },
     
    218201        Mask => 0x78,
    219202        PrintConv => {
    220             0x00 => 'ISO Display',
    221             0x08 => 'Framing Grid',
    222             0x10 => 'AF-area Mode',
    223             0x18 => 'Center AF Area',
    224             0x20 => 'FV Lock',
    225             0x28 => 'Flash Off',
    226             0x30 => 'Matrix Metering',
    227             0x38 => 'Center-weighted',
    228             0x40 => 'Spot Metering',
     203            0 => 'ISO Display',
     204            1 => 'Framing Grid',
     205            2 => 'AF-area Mode',
     206            3 => 'Center AF Area',
     207            4 => 'FV Lock',
     208            5 => 'Flash Off',
     209            6 => 'Matrix Metering',
     210            7 => 'Center-weighted',
     211            8 => 'Spot Metering',
    229212        },
    230213    },
     
    232215        Name => 'GridDisplay',
    233216        Mask => 0x80,
    234         PrintConv => {
    235             0x00 => 'Off',
    236             0x80 => 'On',
    237         },
     217        PrintConv => \%offOn,
    238218    },
    239219    6.2 => { # CS9
    240220        Name => 'ViewfinderWarning',
    241221        Mask => 0x40,
    242         PrintConv => {
    243             0x00 => 'On',
    244             0x40 => 'Off',
    245         },
     222        PrintConv => \%onOff,
    246223    },
    247224    6.3 => { # CS12
     
    249226        Mask => 0x0c,
    250227        PrintConv => {
    251             0x00 => '6 mm',
    252             0x04 => '8 mm',
    253             0x08 => '10 mm',
     228            0 => '6 mm',
     229            1 => '8 mm',
     230            2 => '10 mm',
    254231        },
    255232    },
     
    257234        Name => 'ExposureDelayMode',
    258235        Mask => 0x20,
    259         PrintConv => {
    260             0x00 => 'Off',
    261             0x20 => 'On',
    262         },
     236        PrintConv => \%offOn,
    263237    },
    264238    6.5 => { # CS32
     
    266240        Mask => 0x03,
    267241        PrintConv => {
    268             0x00 => 'LR6 (AA Alkaline)',
    269             0x01 => 'HR6 (AA Ni-MH)',
    270             0x02 => 'FR6 (AA Lithium)',
    271             0x03 => 'ZR6 (AA Ni-Mg)',
     242            0 => 'LR6 (AA Alkaline)',
     243            1 => 'HR6 (AA Ni-MH)',
     244            2 => 'FR6 (AA Lithium)',
     245            3 => 'ZR6 (AA Ni-Mg)',
    272246        },
    273247    },
     
    275249        Name => 'FlashWarning',
    276250        Mask => 0x80,
    277         PrintConv => {
    278             0x00 => 'On',
    279             0x80 => 'Off',
    280         },
     251        PrintConv => \%onOff,
    281252    },
    282253    7.2 => { # CS24
    283254        Name => 'FlashShutterSpeed',
    284255        Mask => 0x78,
    285         ValueConv => '2 ** (($val >> 3) - 6)',
    286         ValueConvInv => '$val>0 ? int(log($val)/log(2)+6+0.5) << 3 : 0',
     256        ValueConv => '2 ** ($val - 6)',
     257        ValueConvInv => '$val>0 ? int(log($val)/log(2)+6+0.5) : 0',
    287258        PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
    288259        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    291262        Name => 'AutoFP',
    292263        Mask => 0x04,
    293         PrintConv => {
    294             0x00 => 'Off',
    295             0x04 => 'On',
    296         },
     264        PrintConv => \%offOn,
    297265    },
    298266    7.4 => { # CS26
    299267        Name => 'ModelingFlash',
    300268        Mask => 0x02,
    301         PrintConv => {
    302             0x00 => 'Off',
    303             0x02 => 'On',
    304         },
     269        PrintConv => \%offOn,
    305270    },
    306271    8.1 => { # CS22
     
    308273        Mask => 0xc0,
    309274        PrintConv => {
    310             0x00 => 'TTL',
    311             0x40 => 'Manual',
    312             0x80 => 'Repeating Flash',
    313             0xc0 => 'Commander Mode',
     275            0 => 'TTL',
     276            1 => 'Manual',
     277            2 => 'Repeating Flash',
     278            3 => 'Commander Mode',
    314279        },
    315280    },
     
    328293        Name => 'RepeatingFlashOutput',
    329294        Mask => 0x70,
    330         ValueConv => '2 ** (-($val>>4)-2)',
    331         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5)<<4 : 0',
     295        ValueConv => '2 ** (-$val-2)',
     296        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5) : 0',
    332297        PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
    333298        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    342307        Name => 'RepeatingFlashRate',
    343308        Mask => 0xf0,
    344         ValueConv => 'my $v=($val>>4); $v < 10 ? $v + 1 : 10 * ($v - 8)',
    345         ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5) << 4',
     309        ValueConv => '$val < 10 ? $val + 1 : 10 * ($val - 8)',
     310        ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5)',
    346311        PrintConv => '"$val Hz"',
    347312        PrintConvInv => '$val=~/(\d+)/; $1 || 0',
     
    357322        Mask => 0xc0,
    358323        PrintConv => {
    359             0x00 => 'TTL',
    360             0x40 => 'Manual',
    361             0x80 => 'Off',
     324            0 => 'TTL',
     325            1 => 'Manual',
     326            2 => 'Off',
    362327        },
    363328    },
     
    366331        Mask => 0x30,
    367332        PrintConv => {
    368             0x00 => 'TTL',
    369             0x10 => 'Auto Aperture',
    370             0x20 => 'Manual',
    371             0x30 => 'Off',
     333            0 => 'TTL',
     334            1 => 'Auto Aperture',
     335            2 => 'Manual',
     336            3 => 'Off',
    372337        },
    373338    },
     
    376341        Mask => 0x0c,
    377342        PrintConv => {
    378             0x00 => 'TTL',
    379             0x04 => 'Auto Aperture',
    380             0x08 => 'Manual',
    381             0x0c => 'Off',
     343            0 => 'TTL',
     344            1 => 'Auto Aperture',
     345            2 => 'Manual',
     346            3 => 'Off',
    382347        },
    383348    },
     
    393358        Name => 'CommanderInternalManualOutput',
    394359        Mask => 0xe0,
    395         ValueConv => '2 ** (-($val>>5))',
    396         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)+0.5) << 5 : 0',
     360        ValueConv => '2 ** (-$val)',
     361        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)+0.5) : 0',
    397362        PrintConv => q{
    398363            return 'Full' if $val > 0.99;
     
    412377        Name => 'CommanderGroupAManualOutput',
    413378        Mask => 0xe0,
    414         ValueConv => '2 ** (-($val>>5))',
    415         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)+0.5) << 5 : 0',
     379        ValueConv => '2 ** (-$val)',
     380        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)+0.5) : 0',
    416381        PrintConv => q{
    417382            return 'Full' if $val > 0.99;
     
    431396        Name => 'CommanderGroupBManualOutput',
    432397        Mask => 0xe0,
    433         ValueConv => '2 ** (-($val>>5))',
    434         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)+0.5) << 5 : 0',
     398        ValueConv => '2 ** (-$val)',
     399        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)+0.5) : 0',
    435400        PrintConv => q{
    436401            return 'Full' if $val > 0.99;
     
    443408        Mask => 0x80,
    444409        PrintConv => {
    445             0x00 => 'Normal Zone',
    446             0x80 => 'Wide Zone',
     410            0 => 'Normal Zone',
     411            1 => 'Wide Zone',
    447412        },
    448413    },
     
    451416        Mask => 0x04,
    452417        PrintConv => {
    453             0x00 => 'No Wrap',
    454             0x04 => 'Wrap',
     418            0 => 'No Wrap',
     419            1 => 'Wrap',
    455420        },
    456421    },
     
    459424        Mask => 0x03,
    460425        PrintConv => {
    461             0x00 => 'Auto',
    462             0x01 => 'Off',
    463             0x02 => 'On',
     426            0 => 'Auto',
     427            1 => 'Off',
     428            2 => 'On',
    464429        },
    465430    },
     
    468433        Mask => 0xc0,
    469434        PrintConv => {
    470             0x00 => 'Single Area',
    471             0x40 => 'Dynamic Area',
    472             0x80 => 'Auto-area',
     435            0 => 'Single Area',
     436            1 => 'Dynamic Area',
     437            2 => 'Auto-area',
    473438        },
    474439    },
     
    487452        Name => 'Beep',
    488453        Mask => 0x80,
    489         PrintConv => {
    490             0x00 => 'On',
    491             0x80 => 'Off',
    492         },
     454        PrintConv => \%onOff,
    493455    },
    494456    0.2 => { # CS9
    495457        Name => 'AFAssist',
    496458        Mask => 0x40,
    497         PrintConv => {
    498             0x00 => 'On',
    499             0x40 => 'Off',
    500         },
     459        PrintConv => \%onOff,
    501460    },
    502461    0.3 => { # CS6
     
    504463        Mask => 0x20,
    505464        PrintConv => {
    506             0x00 => 'Release Locked',
    507             0x20 => 'Enable Release',
     465            0 => 'Release Locked',
     466            1 => 'Enable Release',
    508467        },
    509468    },
     
    511470        Name => 'ImageReview',
    512471        Mask => 0x10,
    513         PrintConv => {
    514             0x00 => 'On',
    515             0x10 => 'Off',
    516         },
     472        PrintConv => \%onOff,
    517473    },
    518474    1.1 => { # CS10-a
    519475        Name => 'AutoISO',
    520476        Mask => 0x80,
    521         PrintConv => {
    522             0x00 => 'Off',
    523             0x80 => 'On',
    524         },
     477        PrintConv => \%offOn,
    525478    },
    526479    1.2 => { # CS10-b
     
    528481        Mask => 0x30,
    529482        PrintConv => {
    530             0x10 => 400,
    531             0x20 => 800,
    532             0x30 => 1600,
     483            1 => 400,
     484            2 => 800,
     485            3 => 1600,
    533486        },
    534487    },
     
    538491        PrintConvColumns => 2,
    539492        PrintConv => {
    540             0x00 => '1/125 s',
    541             0x01 => '1/60 s',
    542             0x02 => '1/30 s',
    543             0x03 => '1/15 s',
    544             0x04 => '1/8 s',
    545             0x05 => '1/4 s',
    546             0x06 => '1/2 s',
    547             0x07 => '1 s',
     493            0 => '1/125 s',
     494            1 => '1/60 s',
     495            2 => '1/30 s',
     496            3 => '1/15 s',
     497            4 => '1/8 s',
     498            5 => '1/4 s',
     499            6 => '1/2 s',
     500            7 => '1 s',
    548501        },
    549502    },
     
    552505        Mask => 0x07,
    553506        PrintConv => {
    554             0x00 => '4 s',
    555             0x01 => '8 s',
    556             0x02 => '20 s',
    557             0x03 => '1 min',
    558             0x04 => '10 min',
     507            0 => '4 s',
     508            1 => '8 s',
     509            2 => '20 s',
     510            3 => '1 min',
     511            4 => '10 min',
    559512        },
    560513    },
     
    563516        Mask => 0xe0,
    564517        PrintConv => {
    565             0x00 => '4 s',
    566             0x20 => '8 s',
    567             0x40 => '20 s',
    568             0x60 => '1 min',
    569             0x80 => '10 min',
     518            0 => '4 s',
     519            1 => '8 s',
     520            2 => '20 s',
     521            3 => '1 min',
     522            4 => '10 min',
    570523        },
    571524    },
     
    574527        Mask => 0x1c,
    575528        PrintConv => {
    576             0x00 => '4 s',
    577             0x04 => '8 s',
    578             0x08 => '20 s',
    579             0x0c => '1 min',
    580             0x10 => '30 min',
     529            0 => '4 s',
     530            1 => '8 s',
     531            2 => '20 s',
     532            3 => '1 min',
     533            4 => '30 min',
    581534        },
    582535    },
     
    585538        Mask => 0x03,
    586539        PrintConv => {
    587             0x00 => '2 s',
    588             0x01 => '5 s',
    589             0x02 => '10 s',
    590             0x03 => '20 s',
     540            0 => '2 s',
     541            1 => '5 s',
     542            2 => '10 s',
     543            3 => '20 s',
    591544        },
    592545    },
     
    595548        Mask => 0xc0,
    596549        PrintConv => {
    597             0x00 => '1 min',
    598             0x40 => '5 min',
    599             0x80 => '10 min',
    600             0xc0 => '15 min',
     550            0 => '1 min',
     551            1 => '5 min',
     552            2 => '10 min',
     553            3 => '15 min',
    601554        },
    602555    },
     
    605558        Mask => 0x0e,
    606559        PrintConv => {
    607             0x00 => 'AE/AF Lock',
    608             0x02 => 'AE Lock Only',
    609             0x04 => 'AF Lock Only',
    610             0x06 => 'AE Lock (hold)',
    611             0x08 => 'AF-ON',
     560            0 => 'AE/AF Lock',
     561            1 => 'AE Lock Only',
     562            2 => 'AF Lock Only',
     563            3 => 'AE Lock (hold)',
     564            4 => 'AF-ON',
    612565        },
    613566    },
     
    615568        Name => 'AELock',
    616569        Mask => 0x01,
    617         PrintConv => {
    618             0x00 => 'Off',
    619             0x01 => 'On',
    620         },
     570        PrintConv => \%offOn,
    621571    },
    622572    5.1 => { # CS4
     
    624574        Mask => 0x70,
    625575        PrintConv => {
    626             0x00 => 'Single Frame',
    627             0x10 => 'Continuous',
    628             0x20 => 'Self-timer',
    629             0x30 => 'Delayed Remote',
    630             0x40 => 'Quick-response Remote',
     576            0 => 'Single Frame',
     577            1 => 'Continuous',
     578            2 => 'Self-timer',
     579            3 => 'Delayed Remote',
     580            4 => 'Quick-response Remote',
    631581        },
    632582    },
     
    635585        Mask => 0x07,
    636586        PrintConv => {
    637             0x00 => 'Shooting Mode',
    638             0x01 => 'Image Quality/Size',
    639             0x02 => 'ISO',
    640             0x03 => 'White Balance',
    641             0x04 => 'Self-timer',
     587            0 => 'Shooting Mode',
     588            1 => 'Image Quality/Size',
     589            2 => 'ISO',
     590            3 => 'White Balance',
     591            4 => 'Self-timer',
    642592        },
    643593    },
     
    646596        Mask => 0x03,
    647597        PrintConv => {
    648             0x00 => 'Matrix',
    649             0x01 => 'Center-weighted',
    650             0x02 => 'Spot',
     598            0 => 'Matrix',
     599            1 => 'Center-weighted',
     600            2 => 'Spot',
    651601        },
    652602    },
     
    655605        Mask => 0x10,
    656606        PrintConv => {
    657             0x00 => 'TTL',
    658             0x10 => 'Manual',
     607            0 => 'TTL',
     608            1 => 'Manual',
    659609        },
    660610    },
     
    683633        Mask => 0xc0,
    684634        PrintConv => {
    685             0x00 => 'Manual',
    686             0x40 => 'AF-S',
    687             0x80 => 'AF-C',
    688             0xc0 => 'AF-A',
     635            0 => 'Manual',
     636            1 => 'AF-S',
     637            2 => 'AF-C',
     638            3 => 'AF-A',
    689639        },
    690640    },
     
    694644        Mask => 0x30,
    695645        PrintConv => {
    696             0x00 => 'Single Area',
    697             0x10 => 'Dynamic Area',
    698             0x20 => 'Closest Subject',
     646            0 => 'Single Area',
     647            1 => 'Dynamic Area',
     648            2 => 'Closest Subject',
    699649        },
    700650    }
     
    724674        Mask => 0x08,
    725675        PrintConv => {
    726             0x00 => 'LCD Backlight',
    727             0x08 => 'LCD Backlight and Shooting Information',
     676            0 => 'LCD Backlight',
     677            1 => 'LCD Backlight and Shooting Information',
    728678        },
    729679    },
     
    732682        Mask => 0x60,
    733683        PrintConv => {
    734             0x00 => 'Single Area',
    735             0x20 => 'Dynamic Area',
    736             0x40 => 'Auto-area',
    737             0x60 => '3D-tracking (11 points)',
     684            0 => 'Single Area',
     685            1 => 'Dynamic Area',
     686            2 => 'Auto-area',
     687            3 => '3D-tracking (11 points)',
    738688        },
    739689    },
     
    742692        Mask => 0x10,
    743693        PrintConv => {
    744             0x00 => 'Normal Zone',
    745             0x10 => 'Wide Zone',
     694            0 => 'Normal Zone',
     695            1 => 'Wide Zone',
    746696        },
    747697    },
     
    749699        Name => 'AFAssist',
    750700        Mask => 0x01,
    751         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     701        PrintConv => \%onOff,
    752702    },
    753703    2.4 => { # CSa4
     
    755705        Mask => 0x06,
    756706        PrintConv => {
    757             0x00 => 'Auto',
    758             0x02 => 'On',
    759             0x04 => 'Off',
     707            0 => 'Auto',
     708            1 => 'On',
     709            2 => 'Off',
    760710        },
    761711    },
     
    764714        Mask => 0x08,
    765715        PrintConv => {
    766             0x00 => 'No Wrap',
    767             0x08 => 'Wrap',
     716            0 => 'No Wrap',
     717            1 => 'Wrap',
    768718        },
    769719    },
     
    772722        Mask => 0x1c,
    773723        PrintConv => {
    774             0x00 => 'AE Lock Only',
    775             0x04 => 'AF Lock Only',
    776             0x08 => 'AE Lock (hold)',
    777             0x0c => 'AF-On',
    778             0x10 => 'FV Lock',
    779             0x14 => 'Focus Point Selection',
    780             0x1c => 'AE/AF Lock',
     724            0 => 'AE Lock Only',
     725            1 => 'AF Lock Only',
     726            2 => 'AE Lock (hold)',
     727            3 => 'AF-On',
     728            4 => 'FV Lock',
     729            5 => 'Focus Point Selection',
     730            7 => 'AE/AF Lock',
    781731        },
    782732    },
     
    785735        Mask => 0x03,
    786736        PrintConv => {
    787             0x00 => 'LR6 (AA alkaline)',
    788             0x01 => 'HR6 (AA Ni-MH)',
    789             0x02 => 'FR6 (AA lithium)',
    790             0x03 => 'ZR6 (AA Ni-Mn)',
     737            0 => 'LR6 (AA alkaline)',
     738            1 => 'HR6 (AA Ni-MH)',
     739            2 => 'FR6 (AA lithium)',
     740            3 => 'ZR6 (AA Ni-Mn)',
    791741        },
    792742    },
     
    794744        Name => 'Beep',
    795745        Mask => 0x40,
    796         PrintConv => {
    797             0x40 => 'On',
    798             0x00 => 'Off',
    799         },
     746        PrintConv => \%offOn,
    800747    },
    801748    4.2 => { # CSd2
    802749        Name => 'GridDisplay',
    803750        Mask => 0x02,
    804         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     751        PrintConv => \%offOn,
    805752    },
    806753    4.3 => { # CSd3
     
    808755        Mask => 0x0c,
    809756        PrintConv => {
    810             0x00 => 'Show ISO/Easy ISO',
    811             0x04 => 'Show ISO Sensitivity',
    812             0x0c => 'Show Frame Count',
     757            0 => 'Show ISO/Easy ISO',
     758            1 => 'Show ISO Sensitivity',
     759            3 => 'Show Frame Count',
    813760        },
    814761    },
     
    816763        Name => 'ViewfinderWarning',
    817764        Mask => 0x01,
    818         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     765        PrintConv => \%onOff,
    819766    },
    820767    4.5 => { # CSf6
     
    822769        Mask => 0x20,
    823770        PrintConv => {
    824             0x00 => 'Release Locked',
    825             0x20 => 'Enable Release',
     771            0 => 'Release Locked',
     772            1 => 'Enable Release',
    826773        },
    827774    },
     
    829776        Name => 'ScreenTips',
    830777        Mask => 0x04,
    831         PrintConv => { 0x00 => 'Off', 0x04 => 'On' },
     778        PrintConv => \%offOn,
    832779    },
    833780    5.2 => { # CSd7
    834781        Name => 'FileNumberSequence',
    835782        Mask => 0x08,
    836         PrintConv => { 0x00 => 'On', 0x08 => 'Off' },
     783        PrintConv => \%onOff,
    837784    },
    838785    5.3 => { # CSd8
     
    840787        Mask => 0xc0,
    841788        PrintConv => {
    842             0x00 => 'Auto',
    843             0x80 => 'Manual (dark on light)',
    844             0xc0 => 'Manual (light on dark)',
     789            0 => 'Auto',
     790            2 => 'Manual (dark on light)',
     791            3 => 'Manual (light on dark)',
    845792        },
    846793    },
     
    848795        Name => 'LCDIllumination',
    849796        Mask => 0x20,
    850         PrintConv => { 0x00 => 'Off', 0x20 => 'On' },
     797        PrintConv => \%offOn,
    851798    },
    852799    6.1 => { # CSb2
    853800        Name => 'EasyExposureComp',
    854801        Mask => 0x01,
    855         PrintConv => { 0x00 => 'Off', 0x01 => 'On' },
     802        PrintConv => \%offOn,
    856803    },
    857804    6.2 => { # CSf7
     
    859806        Mask => 0x80,
    860807        PrintConv => {
    861             0x00 => '+ 0 -',
    862             0x80 => '- 0 +',
     808            0 => '+ 0 -',
     809            1 => '- 0 +',
    863810        },
    864811    },
     
    867814        Mask => 0x40,
    868815        PrintConv => {
    869             0x00 => '1/3 EV',
    870             0x40 => '1/2 EV',
     816            0 => '1/3 EV',
     817            1 => '1/2 EV',
    871818        },
    872819    },
     
    875822        Mask => 0x60,
    876823        PrintConv => {
    877             0x00 => '6 mm',
    878             0x20 => '8 mm',
    879             0x40 => '10 mm',
     824            0 => '6 mm',
     825            1 => '8 mm',
     826            2 => '10 mm',
    880827        },
    881828    },
     
    884831        Mask => 0x0f,
    885832        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
    886         ValueConvInv => 'int($val*6+($val>0?0.5:-0.5)) & 0x0f',
     833        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    887834        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    888835        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    891838        Name => 'FineTuneOptCenterWeighted',
    892839        Mask => 0xf0,
    893         ValueConv => '($val > 0x70 ? $val - 0x100 : $val) / 0x60',
    894         ValueConvInv => '(int($val*6+($val>0?0.5:-0.5))<<4) & 0xf0',
     840        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     841        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    895842        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    896843        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    900847        Mask => 0x0f,
    901848        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
    902         ValueConvInv => 'int($val*6+($val>0?0.5:-0.5)) & 0x0f',
     849        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    903850        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    904851        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    913860        Name => 'ExposureDelayMode',
    914861        Mask => 0x40,
    915         PrintConv => {
    916             0x00 => 'Off',
    917             0x40 => 'On',
    918         },
     862        PrintConv => \%offOn,
    919863    },
    920864    13.1 => { # CSe4
     
    922866        Mask => 0xe0, #(NC)
    923867        PrintConv => {
    924             0x00 => 'AE & Flash', # default
    925             0x20 => 'AE Only',
    926             0x40 => 'Flash Only', #(NC)
    927             0x60 => 'WB Bracketing', #(NC)
    928             0x80 => 'Active D-Lighting', #(NC)
     868            0 => 'AE & Flash', # default
     869            1 => 'AE Only',
     870            2 => 'Flash Only', #(NC)
     871            3 => 'WB Bracketing', #(NC)
     872            4 => 'Active D-Lighting', #(NC)
    929873        },
    930874    },
     
    933877        Mask => 0x10,
    934878        PrintConv => {
    935             0x00 => '0,-,+',
    936             0x10 => '-,0,+',
     879            0 => '0,-,+',
     880            1 => '-,0,+',
    937881        },
    938882    },
     
    941885        Mask => 0x78,
    942886        PrintConv => {
    943             0x08 => 'Framing Grid',
    944             0x10 => 'AF-area Mode',
    945             0x18 => 'Center Focus Point',
    946             0x20 => 'FV Lock', # default
    947             0x28 => 'Flash Off',
    948             0x30 => 'Matrix Metering',
    949             0x38 => 'Center-weighted Metering',
    950             0x40 => 'Spot Metering',
    951             0x48 => 'My Menu Top',
    952             0x50 => '+ NEF (RAW)',
     887            1 => 'Framing Grid',
     888            2 => 'AF-area Mode',
     889            3 => 'Center Focus Point',
     890            4 => 'FV Lock', # default
     891            5 => 'Flash Off',
     892            6 => 'Matrix Metering',
     893            7 => 'Center-weighted Metering',
     894            8 => 'Spot Metering',
     895            9 => 'My Menu Top',
     896            10 => '+ NEF (RAW)',
    953897        },
    954898    },
     
    957901        Mask => 0x18,
    958902        PrintConv => {
    959             0x08 => 'Select Center Focus Point',
    960             0x10 => 'Highlight Active Focus Point',
    961             0x18 => 'Not Used', #(NC)
    962             0x00 => 'Not Used', #(NC)
     903            1 => 'Select Center Focus Point',
     904            2 => 'Highlight Active Focus Point',
     905            3 => 'Not Used', #(NC)
     906            0 => 'Not Used', #(NC)
    963907        },
    964908    },
     
    967911        Mask => 0x38,
    968912        PrintConv => {
    969             0x00 => 'AE/AF Lock',
    970             0x08 => 'AE Lock Only',
    971             0x10 => 'AF Lock Only', #(NC)
    972             0x18 => 'AE Lock (hold)', #(NC)
    973             0x20 => 'AF-ON', #(NC)
    974             0x28 => 'FV Lock', #(NC)
     913            0 => 'AE/AF Lock',
     914            1 => 'AE Lock Only',
     915            2 => 'AF Lock Only', #(NC)
     916            3 => 'AE Lock (hold)', #(NC)
     917            4 => 'AF-ON', #(NC)
     918            5 => 'FV Lock', #(NC)
    975919        },
    976920    },
     
    978922        Name => 'CommandDialsReverseRotation',
    979923        Mask => 0x80,
    980         PrintConv => { 0x00 => 'No', 0x80 => 'Yes' },
     924        PrintConv => \%noYes,
    981925    },
    982926    18.2 => { # CSc1
    983927        Name => 'ShutterReleaseButtonAE-L',
    984928        Mask => 0x02,
    985         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     929        PrintConv => \%offOn,
    986930    },
    987931    19.1 => { # CSc2
     
    990934        PrintConvColumns => 2,
    991935        PrintConv => {
    992             0x00 => '4 s',
    993             0x10 => '6 s', # default
    994             0x20 => '8 s',
    995             0x30 => '16 s',
    996             0x40 => '30 s',
    997             0x50 => '1 min',
    998             0x60 => '5 min',
    999             0x70 => '10 min',
    1000             0x80 => '30 min',
     936            0 => '4 s',
     937            1 => '6 s', # default
     938            2 => '8 s',
     939            3 => '16 s',
     940            4 => '30 s',
     941            5 => '1 min',
     942            6 => '5 min',
     943            7 => '10 min',
     944            8 => '30 min',
    1001945        },
    1002946    },
     
    1005949        Mask => 0x03,
    1006950        PrintConv => {
    1007             0x00 => '1 min',
    1008             0x01 => '5 min',
    1009             0x02 => '10 min',
    1010             0x03 => '15 min',
     951            0 => '1 min',
     952            1 => '5 min',
     953            2 => '10 min',
     954            3 => '15 min',
    1011955        },
    1012956    },
     
    1015959        Mask => 0xc0,
    1016960        PrintConv => {
    1017             0x00 => '2 s',
    1018             0x40 => '5 s',
    1019             0x80 => '10 s', # default
    1020             0xc0 => '20 s',
     961            0 => '2 s',
     962            1 => '5 s',
     963            2 => '10 s', # default
     964            3 => '20 s',
    1021965        },
    1022966    },
     
    1024968        Name => 'SelfTimerShotCount',
    1025969        Mask => 0x1e,
    1026         ValueConv => '$val >> 1',
    1027         ValueConvInv => '$val << 1',
    1028970    },
    1029971    21.1 => { # CSc4-a
     
    1031973        Mask => 0x1c,
    1032974        PrintConv => {
    1033             0x00 => '4 s',
    1034             0x04 => '10 s', # default
    1035             0x08 => '20 s',
    1036             0x0c => '1 min',
    1037             0x10 => '5 min',
    1038             0x14 => '10 min',
     975            0 => '4 s',
     976            1 => '10 s', # default
     977            2 => '20 s',
     978            3 => '1 min',
     979            4 => '5 min',
     980            5 => '10 min',
    1039981        },
    1040982    },
     
    1043985        Mask => 0xe0,
    1044986        PrintConv => {
    1045             0x00 => '4 s', # default
    1046             0x20 => '10 s',
    1047             0x40 => '20 s',
    1048             0x60 => '1 min',
    1049             0x80 => '5 min',
    1050             0xa0 => '10 min',
     987            0 => '4 s', # default
     988            1 => '10 s',
     989            2 => '20 s',
     990            3 => '1 min',
     991            4 => '5 min',
     992            5 => '10 min',
    1051993        },
    1052994    },
     
    1055997        Mask => 0xe0,
    1056998        PrintConv => {
    1057             0x00 => '4 s',
    1058             0x20 => '10 s',
    1059             0x40 => '20 s', # default
    1060             0x60 => '1 min',
    1061             0x80 => '5 min',
    1062             0xa0 => '10 min',
     999            0 => '4 s',
     1000            1 => '10 s',
     1001            2 => '20 s', # default
     1002            3 => '1 min',
     1003            4 => '5 min',
     1004            5 => '10 min',
    10631005        },
    10641006    },
     
    10671009        Mask => 0x1c,
    10681010        PrintConv => {
    1069             0x00 => '4 s',
    1070             0x04 => '10 s', # default
    1071             0x08 => '20 s',
    1072             0x0c => '1 min',
    1073             0x10 => '5 min',
    1074             0x14 => '10 min',
     1011            0 => '4 s',
     1012            1 => '10 s', # default
     1013            2 => '20 s',
     1014            3 => '1 min',
     1015            4 => '5 min',
     1016            5 => '10 min',
    10751017        },
    10761018    },
     
    10801022        PrintConvColumns => 2,
    10811023        PrintConv => {
    1082             0x00 => '1/60 s', # default
    1083             0x01 => '1/30 s',
    1084             0x02 => '1/15 s',
    1085             0x03 => '1/8 s',
    1086             0x04 => '1/4 s',
    1087             0x05 => '1/2 s',
    1088             0x06 => '1 s',
    1089             0x07 => '2 s',
    1090             0x08 => '4 s',
    1091             0x09 => '8 s',
    1092             0x0a => '15 s',
    1093             0x0b => '30 s',
     1024            0 => '1/60 s', # default
     1025            1 => '1/30 s',
     1026            2 => '1/15 s',
     1027            3 => '1/8 s',
     1028            4 => '1/4 s',
     1029            5 => '1/2 s',
     1030            6 => '1 s',
     1031            7 => '2 s',
     1032            8 => '4 s',
     1033            9 => '8 s',
     1034            10 => '15 s',
     1035            11 => '30 s',
    10941036        },
    10951037    },
     
    10981040        Mask => 0xc0,
    10991041        PrintConv => {
    1100             0x00 => 'TTL',
    1101             0x40 => 'Manual',
    1102             0x80 => 'Repeating Flash',
    1103             0xc0 => 'Commander Mode',
     1042            0 => 'TTL',
     1043            1 => 'Manual',
     1044            2 => 'Repeating Flash',
     1045            3 => 'Commander Mode',
    11041046        },
    11051047    },
     
    11181060        Name => 'RepeatingFlashOutput',
    11191061        Mask => 0x70,
    1120         ValueConv => '2 ** (-($val>>4)-2)',
    1121         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5)<<4 : 0',
     1062        ValueConv => '2 ** (-$val-2)',
     1063        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5) : 0',
    11221064        PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
    11231065        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    11321074        Name => 'RepeatingFlashRate',
    11331075        Mask => 0xf0,
    1134         ValueConv => 'my $v=($val>>4); $v < 10 ? $v + 1 : 10 * ($v - 8)',
    1135         ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5) << 4',
     1076        ValueConv => '$val < 10 ? $val + 1 : 10 * ($val - 8)',
     1077        ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5)',
    11361078        PrintConv => '"$val Hz"',
    11371079        PrintConvInv => '$val=~/(\d+)/; $1 || 0',
     
    11401082        Name => 'FlashWarning',
    11411083        Mask => 0x80,
    1142         PrintConv => {
    1143             0x00 => 'On',
    1144             0x80 => 'Off',
    1145         },
     1084        PrintConv => \%onOff,
    11461085    },
    11471086    31.2 => { # CSe2-ea
     
    11561095        Name => 'ModelingFlash',
    11571096        Mask => 0x20,
    1158         PrintConv => { 0x00 => 'On', 0x20 => 'Off' },
     1097        PrintConv => \%onOff,
    11591098    },
    11601099    31.4 => { # CSe5
    11611100        Name => 'AutoFP',
    11621101        Mask => 0x40,
    1163         PrintConv => {
    1164             0x00 => 'Off',
    1165             0x40 => 'On',
    1166         },
     1102        PrintConv => \%offOn,
    11671103    },
    11681104    32.1 => { # CSe2-eb
     
    11861122        Mask => 0xc0,
    11871123        PrintConv => {
    1188             0x00 => 'Face Priority', #(NC)
    1189             0x40 => 'Wide Area',
    1190             0x80 => 'Normal Area',
     1124            0 => 'Face Priority', #(NC)
     1125            1 => 'Wide Area',
     1126            2 => 'Normal Area',
    11911127        },
    11921128    },
     
    12211157        Notes => '"No" if any custom setting for this bank was changed from the default',
    12221158        Mask => 0x80,
    1223         PrintConv => { 0x00 => 'Yes', 0x80 => 'No' },
     1159        PrintConv => { 0 => 'Yes', 1 => 'No' },
    12241160    },
    12251161    1.1 => { # CSa1
     
    12271163        Mask => 0xc0,
    12281164        PrintConv => {
    1229             0x00 => 'Release',
    1230             0x40 => 'Release + Focus',
    1231             0x80 => 'Focus',
     1165            0 => 'Release',
     1166            1 => 'Release + Focus',
     1167            2 => 'Focus',
    12321168        },
    12331169    },
     
    12361172        Mask => 0x20,
    12371173        PrintConv => {
    1238             0x00 => 'Focus',
    1239             0x20 => 'Release',
     1174            0 => 'Focus',
     1175            1 => 'Release',
    12401176        },
    12411177    },
     
    12441180        Mask => 0x10,
    12451181        PrintConv => {
    1246             0x00 => '51 Points',
    1247             0x10 => '11 Points',
     1182            0 => '51 Points',
     1183            1 => '11 Points',
    12481184        },
    12491185    },
     
    12521188        Mask => 0x0c,
    12531189        PrintConv => {
    1254             0x00 => '9 Points',
    1255             0x04 => '21 Points',
    1256             0x08 => '51 Points',
    1257             0x0c => '51 Points (3D-tracking)',
     1190            0 => '9 Points',
     1191            1 => '21 Points',
     1192            2 => '51 Points',
     1193            3 => '51 Points (3D-tracking)',
    12581194        },
    12591195    },
     
    12641200        Mask => 0x03,
    12651201        PrintConv => {
    1266             0x00 => 'Long',
    1267             0x01 => 'Normal',
    1268             0x02 => 'Short',
    1269             0x03 => 'Off',
     1202            0 => 'Long',
     1203            1 => 'Normal',
     1204            2 => 'Short',
     1205            3 => 'Off',
    12701206        },
    12711207    },
     
    12741210        Mask => 0x80,
    12751211        PrintConv => {
    1276             0x00 => 'Shutter/AF-On',
    1277             0x80 => 'AF-On Only',
     1212            0 => 'Shutter/AF-On',
     1213            1 => 'AF-On Only',
    12781214        },
    12791215    },
     
    12821218        Mask => 0x08,
    12831219        PrintConv => {
    1284             0x00 => 'No Wrap',
    1285             0x08 => 'Wrap',
     1220            0 => 'No Wrap',
     1221            1 => 'Wrap',
    12861222        },
    12871223    },
     
    12921228            Notes => 'D3',
    12931229            Mask => 0x60,
    1294             PrintConv => { 
    1295                 0x00 => 'On in Continuous Shooting and Manual Focusing',
    1296                 0x20 => 'On During Manual Focusing',
    1297                 0x40 => 'On in Continuous Shooting Modes',
    1298                 0x60 => 'Off',
     1230            PrintConv => {
     1231                0 => 'On in Continuous Shooting and Manual Focusing',
     1232                1 => 'On During Manual Focusing',
     1233                2 => 'On in Continuous Shooting Modes',
     1234                3 => 'Off',
    12991235            },
    13001236        },
     
    13041240            Mask => 0x06,
    13051241            PrintConv => {
    1306                 0x00 => 'Auto',
    1307                 0x02 => 'Off',
    1308                 0x04 => 'On',
     1242                0 => 'Auto',
     1243                1 => 'Off',
     1244                2 => 'On',
    13091245            },
    13101246        },
     
    13161252        Mask => 0x06,
    13171253        PrintConv => {
    1318             0x00 => 'Low',
    1319             0x02 => 'Normal',
    1320             0x04 => 'High',
    1321             0x06 => 'Extra High',
     1254            0 => 'Low',
     1255            1 => 'Normal',
     1256            2 => 'High',
     1257            3 => 'Extra High',
    13221258        },
    13231259    },
     
    13271263        Notes => 'D300 only',
    13281264        Mask => 0x01,
    1329         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     1265        PrintConv => \%onOff,
    13301266    },
    13311267    3.1 => { # CSa9 (D3)
     
    13491285        Mask => 0x70,
    13501286        PrintConv => {
    1351             0x00 => 'AF On',
    1352             0x10 => 'AE/AF Lock',
    1353             0x20 => 'AE Lock Only',
    1354             0x30 => 'AE Lock (reset on release)',
    1355             0x40 => 'AE Lock (hold)',
    1356             0x50 => 'AF Lock Only',
    1357             0x70 => 'Same as AF On',
     1287            0 => 'AF On',
     1288            1 => 'AE/AF Lock',
     1289            2 => 'AE Lock Only',
     1290            3 => 'AE Lock (reset on release)',
     1291            4 => 'AE Lock (hold)',
     1292            5 => 'AF Lock Only',
     1293            7 => 'Same as AF On',
    13581294        },
    13591295    },
     
    13641300        Mask => 0x70,
    13651301        PrintConv => {
    1366             0x00 => 'AF-On',
    1367             0x10 => 'AE/AF Lock',
    1368             0x20 => 'AE Lock Only',
    1369             0x30 => 'AE Lock (reset on release)',
    1370             0x40 => 'AE Lock (hold)',
    1371             0x50 => 'AF Lock Only',
    1372             0x60 => 'Same as FUNC Button',
     1302            0 => 'AF-On',
     1303            1 => 'AE/AF Lock',
     1304            2 => 'AE Lock Only',
     1305            3 => 'AE Lock (reset on release)',
     1306            4 => 'AE Lock (hold)',
     1307            5 => 'AF Lock Only',
     1308            6 => 'Same as FUNC Button',
    13731309        },
    13741310    },
     
    13791315        Mask => 0x07,
    13801316        PrintConv => {
    1381             0x00 => '5 (Long)',
    1382             0x01 => '4',
    1383             0x02 => '3 (Normal)',
    1384             0x03 => '2',
    1385             0x04 => '1 (Short)',
    1386             0x05 => 'Off',
     1317            0 => '5 (Long)',
     1318            1 => '4',
     1319            2 => '3 (Normal)',
     1320            3 => '2',
     1321            4 => '1 (Short)',
     1322            5 => 'Off',
    13871323        },
    13881324    },
     
    13931329        Mask => 0x08,
    13941330        PrintConv => {
    1395             0x00 => 'Auto Bracketing',
    1396             0x08 => 'Multiple Exposure',
     1331            0 => 'Auto Bracketing',
     1332            1 => 'Multiple Exposure',
    13971333        },
    13981334    },
     
    14031339        Mask => 0xc0,
    14041340        PrintConv => {
    1405             0x00 => 'Reset',
    1406             0x40 => 'Zoom On/Off',
    1407             0x80 => 'Start Movie Recording',
    1408             0xc0 => 'Not Used',
     1341            0 => 'Reset',
     1342            1 => 'Zoom On/Off',
     1343            2 => 'Start Movie Recording',
     1344            3 => 'Not Used',
    14091345        },
    14101346    },
     
    14151351        Mask => 0x30,
    14161352        PrintConv => {
    1417             0x00 => 'Low Magnification',
    1418             0x10 => 'Medium Magnification',
    1419             0x20 => 'High Magnification',
     1353            0 => 'Low Magnification',
     1354            1 => 'Medium Magnification',
     1355            2 => 'High Magnification',
    14201356        },
    14211357    },
     
    14241360        Mask => 0xc0,
    14251361        PrintConv => {
    1426             0x00 => '1/3 EV',
    1427             0x40 => '1/2 EV',
    1428             0x80 => '1 EV',
     1362            0 => '1/3 EV',
     1363            1 => '1/2 EV',
     1364            2 => '1 EV',
    14291365        },
    14301366    },
     
    14331369        Mask => 0x30,
    14341370        PrintConv => {
    1435             0x00 => '1/3 EV',
    1436             0x10 => '1/2 EV',
    1437             0x20 => '1 EV',
     1371            0 => '1/3 EV',
     1372            1 => '1/2 EV',
     1373            2 => '1 EV',
    14381374        },
    14391375    },
     
    14421378        Mask => 0x0c,
    14431379        PrintConv => {
    1444             0x00 => '1/3 EV',
    1445             0x04 => '1/2 EV',
    1446             0x08 => '1 EV',
     1380            0 => '1/3 EV',
     1381            1 => '1/2 EV',
     1382            2 => '1 EV',
    14471383        },
    14481384    },
     
    14511387        Mask => 0x03,
    14521388        PrintConv => {
    1453             0x00 => 'Off',
    1454             0x01 => 'On',
    1455             0x02 => 'On (auto reset)',
     1389            0 => 'Off',
     1390            1 => 'On',
     1391            2 => 'On (auto reset)',
    14561392        },
    14571393    },
     
    14631399            Mask => 0xe0,
    14641400            PrintConv => {
    1465                 0x00 => '8 mm',
    1466                 0x20 => '12 mm',
    1467                 0x40 => '15 mm',
    1468                 0x60 => '20 mm',
    1469                 0x80 => 'Average',
     1401                0 => '8 mm',
     1402                1 => '12 mm',
     1403                2 => '15 mm',
     1404                3 => '20 mm',
     1405                4 => 'Average',
    14701406            },
    14711407        },
     
    14751411            Mask => 0xe0,
    14761412            PrintConv => {
    1477                 0x00 => '6 mm',
    1478                 0x20 => '8 mm',
    1479                 0x40 => '10 mm',
    1480                 0x60 => '13 mm',
    1481                 0x80 => 'Average',
     1413                0 => '6 mm',
     1414                1 => '8 mm',
     1415                2 => '10 mm',
     1416                3 => '13 mm',
     1417                4 => 'Average',
    14821418            },
    14831419        },
     
    14871423        Mask => 0x0f,
    14881424        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
    1489         ValueConvInv => 'int($val*6+($val>0?0.5:-0.5)) & 0x0f',
     1425        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    14901426        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    14911427        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    14941430        Name => 'FineTuneOptMatrixMetering',
    14951431        Mask => 0xf0,
    1496         ValueConv => '($val > 0x70 ? $val - 0x100 : $val) / 0x60',
    1497         ValueConvInv => '(int($val*6+($val>0?0.5:-0.5))<<4) & 0xf0',
     1432        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     1433        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    14981434        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    14991435        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    15031439        Mask => 0x0f,
    15041440        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
    1505         ValueConvInv => 'int($val*6+($val>0?0.5:-0.5)) & 0x0f',
     1441        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    15061442        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    15071443        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    15111447        Mask => 0xc0,
    15121448        PrintConv => {
    1513             0x00 => 'Select Center Focus Point',
    1514             0x40 => 'Highlight Active Focus Point',
    1515             0x80 => 'Not Used',
     1449            0 => 'Select Center Focus Point',
     1450            1 => 'Highlight Active Focus Point',
     1451            2 => 'Not Used',
    15161452        },
    15171453    },
     
    15221458        Mask => 0x30,
    15231459        PrintConv => {
    1524             0x00 => 'Thumbnail On/Off',
    1525             0x10 => 'View Histograms',
    1526             0x20 => 'Zoom On/Off',
    1527             0x30 => 'Choose Folder',
     1460            0 => 'Thumbnail On/Off',
     1461            1 => 'View Histograms',
     1462            2 => 'Zoom On/Off',
     1463            3 => 'Choose Folder',
    15281464        },
    15291465    },
     
    15351471            Mask => 0x0c,
    15361472            PrintConv => { #1
    1537                 0x00 => 'High Magnification',
    1538                 0x04 => 'Medium Magnification',
    1539                 0x08 => 'Low Magnification',
     1473                0 => 'High Magnification',
     1474                1 => 'Medium Magnification',
     1475                2 => 'Low Magnification',
    15401476            },
    15411477        },
     
    15451481            Mask => 0x0c,
    15461482            PrintConv => { #JD
    1547                 0x00 => 'Low Magnification',
    1548                 0x04 => 'Medium Magnification',
    1549                 0x08 => 'High Magnification',
     1483                0 => 'Low Magnification',
     1484                1 => 'Medium Magnification',
     1485                2 => 'High Magnification',
    15501486            },
    15511487        },
     
    15551491        Mask => 0x01,
    15561492        PrintConv => {
    1557             0x00 => 'Do Nothing',
    1558             0x01 => 'Reset Meter-off Delay',
     1493            0 => 'Do Nothing',
     1494            1 => 'Reset Meter-off Delay',
    15591495        },
    15601496    },
     
    15621498        Name => 'ExposureDelayMode',
    15631499        Mask => 0x40,
    1564         PrintConv => { 0x00 => 'Off', 0x40 => 'On' },
     1500        PrintConv => \%offOn,
    15651501    },
    15661502    10.2 => { # CSd4 (D300), CDs5 (D300S), CSd2-a (D3)
     
    15761512        Mask => 0x30,
    15771513        PrintConv => {
    1578             0x00 => '9 fps',
    1579             0x10 => '10 fps',
    1580             0x20 => '11 fps',
     1514            0 => '9 fps',
     1515            1 => '10 fps',
     1516            2 => '11 fps',
    15811517        },
    15821518    },
     
    15891525        Mask => 0x20,
    15901526        PrintConv => {
    1591             0x00 => '+ 0 -',
    1592             0x20 => '- 0 +',
     1527            0 => '+ 0 -',
     1528            1 => '- 0 +',
    15931529        },
    15941530    },
     
    15991535            Notes => 'D3',
    16001536            Mask => 0x02,
    1601             PrintConv => { 0x00 => 'On', 0x02 => 'Off' },
     1537            PrintConv => \%onOff,
    16021538        },
    16031539        {
     
    16051541            Notes => 'D300',
    16061542            Mask => 0x08,
    1607             PrintConv => { 0x00 => 'On', 0x08 => 'Off' },
     1543            PrintConv => \%onOff,
    16081544        },
    16091545    ],
     
    16141550        Mask => 0x80,
    16151551        PrintConv => {
    1616             0x00 => 'ISO',
    1617             0x80 => 'Exposures Remaining',
     1552            0 => 'ISO',
     1553            1 => 'Exposures Remaining',
    16181554        },
    16191555    },
     
    16241560        Mask => 0x40,
    16251561        PrintConv => {
    1626             0x00 => 'Frame Count',
    1627             0x40 => 'Exposures Remaining',
     1562            0 => 'Frame Count',
     1563            1 => 'Exposures Remaining',
    16281564        },
    16291565    },
     
    16341570        Mask => 0x04,
    16351571        PrintConv => {
    1636             0x00 => 'MB-D10 First',
    1637             0x04 => 'Camera Battery First',
     1572            0 => 'MB-D10 First',
     1573            1 => 'Camera Battery First',
    16381574        },
    16391575    },
     
    16441580        Mask => 0x03,
    16451581        PrintConv => {
    1646             0x00 => 'LR6 (AA alkaline)',
    1647             0x01 => 'HR6 (AA Ni-MH)',
    1648             0x02 => 'FR6 (AA lithium)',
    1649             0x03 => 'ZR6 (AA Ni-Mn)',
     1582            0 => 'LR6 (AA alkaline)',
     1583            1 => 'HR6 (AA Ni-MH)',
     1584            2 => 'FR6 (AA lithium)',
     1585            3 => 'ZR6 (AA Ni-Mn)',
    16501586        },
    16511587    },
     
    16541590        Condition => '$$self{Model} =~ /(D3S|D300S)\b/',
    16551591        Mask => 0x10,
    1656         PrintConv => {
    1657             0x00 => 'On',
    1658             0x10 => 'Off',
    1659         },
     1592        PrintConv => \%onOff,
    16601593    },
    16611594    13.1 => { # CSd1
     
    16631596        Mask => 0xc0,
    16641597        PrintConv => {
    1665             0x00 => 'High',
    1666             0x40 => 'Low',
    1667             0x80 => 'Off',
     1598            0 => 'High',
     1599            1 => 'Low',
     1600            2 => 'Off',
    16681601        },
    16691602    },
     
    16721605        Mask => 0x30,
    16731606        PrintConv => {
    1674             0x00 => 'Auto', #JD (D300)
    1675             0x10 => 'Auto', #1 (D3)
    1676             0x20 => 'Manual (dark on light)',
    1677             0x30 => 'Manual (light on dark)',
     1607            0 => 'Auto', #JD (D300)
     1608            1 => 'Auto', #1 (D3)
     1609            2 => 'Manual (dark on light)',
     1610            3 => 'Manual (light on dark)',
    16781611        },
    16791612    },
     
    16831616        Notes => 'D300 only',
    16841617        Mask => 0x02,
    1685         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     1618        PrintConv => \%offOn,
    16861619    },
    16871620    13.4 => { # CSd3 (D300)
     
    16901623        Notes => 'D300 only',
    16911624        Mask => 0x01,
    1692         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     1625        PrintConv => \%onOff,
    16931626    },
    16941627    13.5 => { # CSf1-b (D3S) (ref 1)
     
    16981631        Mask => 0x03,
    16991632        PrintConv => {
    1700             0x00 => 'Thumbnail On/Off',
    1701             0x01 => 'View Histograms',
    1702             0x02 => 'Zoom On/Off',
     1633            0 => 'Thumbnail On/Off',
     1634            1 => 'View Histograms',
     1635            2 => 'Zoom On/Off',
    17031636        },
    17041637    },
     
    17101643            Mask => 0xf8,
    17111644            PrintConv => {
    1712                 0x00 => 'None',
    1713                 0x08 => 'Preview',
    1714                 0x10 => 'FV Lock',
    1715                 0x18 => 'AE/AF Lock',
    1716                 0x20 => 'AE Lock Only',
    1717                 0x28 => 'AE Lock (reset on release)',
    1718                 0x30 => 'AE Lock (hold)',
    1719                 0x38 => 'AF Lock Only',
    1720                 0x40 => 'Flash Off',
    1721                 0x48 => 'Bracketing Burst',
    1722                 0x50 => 'Matrix Metering',
    1723                 0x58 => 'Center-weighted Metering',
    1724                 0x60 => 'Spot Metering',
    1725                 0x68 => 'Virtual Horizon',
    1726                 # 0x70 not used
    1727                 0x78 => 'Playback',
    1728                 0x80 => 'My Menu Top',
     1645                0 => 'None',
     1646                1 => 'Preview',
     1647                2 => 'FV Lock',
     1648                3 => 'AE/AF Lock',
     1649                4 => 'AE Lock Only',
     1650                5 => 'AE Lock (reset on release)',
     1651                6 => 'AE Lock (hold)',
     1652                7 => 'AF Lock Only',
     1653                8 => 'Flash Off',
     1654                9 => 'Bracketing Burst',
     1655                10 => 'Matrix Metering',
     1656                11 => 'Center-weighted Metering',
     1657                12 => 'Spot Metering',
     1658                13 => 'Virtual Horizon',
     1659                # 14 not used
     1660                15 => 'Playback',
     1661                16 => 'My Menu Top',
    17291662            },
    17301663        },
     
    17341667            Mask => 0xf8,
    17351668            PrintConv => {
    1736                 0x00 => 'None',
    1737                 0x08 => 'Preview',
    1738                 0x10 => 'FV Lock',
    1739                 0x18 => 'AE/AF Lock',
    1740                 0x20 => 'AE Lock Only',
    1741                 0x28 => 'AE Lock (reset on release)',
    1742                 0x30 => 'AE Lock (hold)',
    1743                 0x38 => 'AF Lock Only',
    1744                 # 0x40 not used
    1745                 0x48 => 'Flash Off',
    1746                 0x50 => 'Bracketing Burst',
    1747                 0x58 => 'Matrix Metering',
    1748                 0x60 => 'Center-weighted Metering',
    1749                 0x68 => 'Spot Metering',
    1750                 0x70 => 'Playback', #PH (guess)
    1751                 0x78 => 'My Menu Top', #PH (guess)
    1752                 0x80 => '+ NEF (RAW)', #PH (guess)
     1669                0 => 'None',
     1670                1 => 'Preview',
     1671                2 => 'FV Lock',
     1672                3 => 'AE/AF Lock',
     1673                4 => 'AE Lock Only',
     1674                5 => 'AE Lock (reset on release)',
     1675                6 => 'AE Lock (hold)',
     1676                7 => 'AF Lock Only',
     1677                # 8 not used
     1678                9 => 'Flash Off',
     1679                10 => 'Bracketing Burst',
     1680                11 => 'Matrix Metering',
     1681                12 => 'Center-weighted Metering',
     1682                13 => 'Spot Metering',
     1683                14 => 'Playback', #PH (guess)
     1684                15 => 'My Menu Top', #PH (guess)
     1685                16 => '+ NEF (RAW)', #PH (guess)
    17531686            },
    17541687        },
     
    17911724            Mask => 0xf8,
    17921725            PrintConv => {
    1793                 0x00 => 'None',
    1794                 0x08 => 'Preview',
    1795                 0x10 => 'FV Lock',
    1796                 0x18 => 'AE/AF Lock',
    1797                 0x20 => 'AE Lock Only',
    1798                 0x28 => 'AE Lock (reset on release)',
    1799                 0x30 => 'AE Lock (hold)',
    1800                 0x38 => 'AF Lock Only',
    1801                 0x40 => 'Flash Off',
    1802                 0x48 => 'Bracketing Burst',
    1803                 0x50 => 'Matrix Metering',
    1804                 0x58 => 'Center-weighted Metering',
    1805                 0x60 => 'Spot Metering',
    1806                 0x68 => 'Virtual Horizon',
    1807                 # 0x70 not used
    1808                 0x78 => 'Playback',
    1809                 0x80 => 'My Menu Top',
     1726                0 => 'None',
     1727                1 => 'Preview',
     1728                2 => 'FV Lock',
     1729                3 => 'AE/AF Lock',
     1730                4 => 'AE Lock Only',
     1731                5 => 'AE Lock (reset on release)',
     1732                6 => 'AE Lock (hold)',
     1733                7 => 'AF Lock Only',
     1734                8 => 'Flash Off',
     1735                9 => 'Bracketing Burst',
     1736                10 => 'Matrix Metering',
     1737                11 => 'Center-weighted Metering',
     1738                12 => 'Spot Metering',
     1739                13 => 'Virtual Horizon',
     1740                # 14 not used
     1741                15 => 'Playback',
     1742                16 => 'My Menu Top',
    18101743            },
    18111744        },
     
    18151748            Mask => 0xf8,
    18161749            PrintConv => {
    1817                 0x00 => 'None',
    1818                 0x08 => 'Preview',
    1819                 0x10 => 'FV Lock',
    1820                 0x18 => 'AE/AF Lock',
    1821                 0x20 => 'AE Lock Only',
    1822                 0x28 => 'AE Lock (reset on release)',
    1823                 0x30 => 'AE Lock (hold)',
    1824                 0x38 => 'AF Lock Only',
    1825                 # 0x40 not used
    1826                 0x48 => 'Flash Off',
    1827                 0x50 => 'Bracketing Burst',
    1828                 0x58 => 'Matrix Metering',
    1829                 0x60 => 'Center-weighted Metering',
    1830                 0x68 => 'Spot Metering',
    1831                 0x70 => 'Playback', #PH (guess)
    1832                 0x78 => 'My Menu Top', #PH (guess)
    1833                 0x80 => '+ NEF (RAW)', #PH (guess)
     1750                0 => 'None',
     1751                1 => 'Preview',
     1752                2 => 'FV Lock',
     1753                3 => 'AE/AF Lock',
     1754                4 => 'AE Lock Only',
     1755                5 => 'AE Lock (reset on release)',
     1756                6 => 'AE Lock (hold)',
     1757                7 => 'AF Lock Only',
     1758                # 8 not used
     1759                9 => 'Flash Off',
     1760                10 => 'Bracketing Burst',
     1761                11 => 'Matrix Metering',
     1762                12 => 'Center-weighted Metering',
     1763                13 => 'Spot Metering',
     1764                14 => 'Playback', #PH (guess)
     1765                15 => 'My Menu Top', #PH (guess)
     1766                16 => '+ NEF (RAW)', #PH (guess)
    18341767            },
    18351768        },
     
    18721805            Mask => 0xf8,
    18731806            PrintConv => {
    1874                 0x00 => 'None',
    1875                 0x08 => 'Preview',
    1876                 0x10 => 'FV Lock',
    1877                 0x18 => 'AE/AF Lock',
    1878                 0x20 => 'AE Lock Only',
    1879                 0x28 => 'AE Lock (reset on release)',
    1880                 0x30 => 'AE Lock (hold)',
    1881                 0x38 => 'AF Lock Only',
    1882                 0x40 => 'Flash Off',
    1883                 0x48 => 'Bracketing Burst',
    1884                 0x50 => 'Matrix Metering',
    1885                 0x58 => 'Center-weighted Metering',
    1886                 0x60 => 'Spot Metering',
    1887                 0x68 => 'Virtual Horizon',
    1888                 0x70 => 'AF On', # (AE-L/AF-L button only)
    1889                 0x78 => 'Playback',
    1890                 0x80 => 'My Menu Top',
     1807                0 => 'None',
     1808                1 => 'Preview',
     1809                2 => 'FV Lock',
     1810                3 => 'AE/AF Lock',
     1811                4 => 'AE Lock Only',
     1812                5 => 'AE Lock (reset on release)',
     1813                6 => 'AE Lock (hold)',
     1814                7 => 'AF Lock Only',
     1815                8 => 'Flash Off',
     1816                9 => 'Bracketing Burst',
     1817                10 => 'Matrix Metering',
     1818                11 => 'Center-weighted Metering',
     1819                12 => 'Spot Metering',
     1820                13 => 'Virtual Horizon',
     1821                14 => 'AF On', # (AE-L/AF-L button only)
     1822                15 => 'Playback',
     1823                16 => 'My Menu Top',
    18911824            },
    18921825        },
     
    18961829            Mask => 0xf8,
    18971830            PrintConv => {
    1898                 0x00 => 'None',
    1899                 0x08 => 'Preview',
    1900                 0x10 => 'FV Lock',
    1901                 0x18 => 'AE/AF Lock',
    1902                 0x20 => 'AE Lock Only',
    1903                 0x28 => 'AE Lock (reset on release)',
    1904                 0x30 => 'AE Lock (hold)',
    1905                 0x38 => 'AF Lock Only',
    1906                 0x40 => 'AF On', # (AE-L/AF-L button only)
    1907                 0x48 => 'Flash Off',
    1908                 0x50 => 'Bracketing Burst',
    1909                 0x58 => 'Matrix Metering',
    1910                 0x60 => 'Center-weighted Metering',
    1911                 0x68 => 'Spot Metering',
    1912                 0x70 => 'Playback', #PH (guess)
    1913                 0x78 => 'My Menu Top', #PH (guess)
    1914                 0x80 => '+ NEF (RAW)', #PH (guess)
     1831                0 => 'None',
     1832                1 => 'Preview',
     1833                2 => 'FV Lock',
     1834                3 => 'AE/AF Lock',
     1835                4 => 'AE Lock Only',
     1836                5 => 'AE Lock (reset on release)',
     1837                6 => 'AE Lock (hold)',
     1838                7 => 'AF Lock Only',
     1839                8 => 'AF On', # (AE-L/AF-L button only)
     1840                9 => 'Flash Off',
     1841                10 => 'Bracketing Burst',
     1842                11 => 'Matrix Metering',
     1843                12 => 'Center-weighted Metering',
     1844                13 => 'Spot Metering',
     1845                14 => 'Playback', #PH (guess)
     1846                15 => 'My Menu Top', #PH (guess)
     1847                16 => '+ NEF (RAW)', #PH (guess)
    19151848            },
    19161849        },
     
    19491882        Name => 'CommandDialsReverseRotation',
    19501883        Mask => 0x80,
    1951         PrintConv => { 0x00 => 'No', 0x80 => 'Yes' },
     1884        PrintConv => \%noYes,
    19521885    },
    19531886    17.2 => { # CSf7-b, CSf8-b (D3S,D300S)
    19541887        Name => 'CommandDialsChangeMainSub',
    19551888        Mask => 0x40,
    1956         PrintConv => { 0x00 => 'Off', 0x40 => 'On' },
     1889        PrintConv => \%offOn,
    19571890    },
    19581891    17.3 => { # CSf7-c, CSf8-c (D3S,D300S)
     
    19601893        Mask => 0x20,
    19611894        PrintConv => {
    1962             0x00 => 'Sub-command Dial',
    1963             0x20 => 'Aperture Ring',
     1895            0 => 'Sub-command Dial',
     1896            1 => 'Aperture Ring',
    19641897        },
    19651898    },
     
    19671900        Name => 'CommandDialsMenuAndPlayback',
    19681901        Mask => 0x10,
    1969         PrintConv => { 0x00 => 'Off', 0x10 => 'On' },
     1902        PrintConv => \%offOn,
    19701903    },
    19711904    17.5 => { # CSd8 (D300,D3S), CSd9 (D300S), CSd7 (D3)
    19721905        Name => 'LCDIllumination',
    19731906        Mask => 0x08,
    1974         PrintConv => { 0x00 => 'Off', 0x08 => 'On' },
     1907        PrintConv => \%offOn,
    19751908    },
    19761909    17.6 => { # CSf3, CSf4 (D300S)
     
    19781911        Mask => 0x04,
    19791912        PrintConv => {
    1980             0x00 => 'Info Up-down, Playback Left-right',
    1981             0x04 => 'Info Left-right, Playback Up-down',
     1913            0 => 'Info Up-down, Playback Left-right',
     1914            1 => 'Info Left-right, Playback Up-down',
    19821915        },
    19831916    },
     
    19851918        Name => 'ShutterReleaseButtonAE-L',
    19861919        Mask => 0x02,
    1987         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     1920        PrintConv => \%offOn,
    19881921    },
    19891922    17.8 => { # CSf8, CSf9 (D3S,D300S)
    19901923        Name => 'ReleaseButtonToUseDial',
    19911924        Mask => 0x01,
    1992         PrintConv => { 0x00 => 'No', 0x01 => 'Yes' },
     1925        PrintConv => \%noYes,
    19931926    },
    19941927    18.1 => { # CSc3
     
    19961929        Mask => 0x18,
    19971930        PrintConv => {
    1998             0x00 => '2 s',
    1999             0x08 => '5 s',
    2000             0x10 => '10 s',
    2001             0x18 => '20 s',
     1931            0 => '2 s',
     1932            1 => '5 s',
     1933            2 => '10 s',
     1934            3 => '20 s',
    20021935        },
    20031936    },
     
    20051938        Name => 'MonitorOffTime',
    20061939        # NOTE: The D3S and D300S have separate settings for Playback,
    2007         # Image Review, Menus, and Information Display times, but these
    2008         # have not yet been decoded - PH
     1940        # Image Review, Menus, and Information Display times
    20091941        Mask => 0x07,
    20101942        PrintConv => {
    2011             0x00 => '10 s',
    2012             0x01 => '20 s',
    2013             0x02 => '1 min',
    2014             0x03 => '5 min',
    2015             0x04 => '10 min',
     1943            0 => '10 s',
     1944            1 => '20 s',
     1945            2 => '1 min',
     1946            3 => '5 min',
     1947            4 => '10 min',
    20161948        },
    20171949    },
     
    20231955            Mask => 0xe0,
    20241956            PrintConv => {
    2025                 0x00 => '1/250 s (auto FP)',
    2026                 0x20 => '1/250 s',
    2027                 0x40 => '1/200 s',
    2028                 0x60 => '1/160 s',
    2029                 0x80 => '1/125 s',
    2030                 0xa0 => '1/100 s',
    2031                 0xc0 => '1/80 s',
    2032                 0xe0 => '1/60 s',
     1957                0 => '1/250 s (auto FP)',
     1958                1 => '1/250 s',
     1959                2 => '1/200 s',
     1960                3 => '1/160 s',
     1961                4 => '1/125 s',
     1962                5 => '1/100 s',
     1963                6 => '1/80 s',
     1964                7 => '1/60 s',
    20331965            },
    20341966        },
     
    20381970            Mask => 0xf0,
    20391971            PrintConv => {
    2040                 0x00 => '1/320 s (auto FP)',
    2041                 0x10 => '1/250 s (auto FP)',
    2042                 0x20 => '1/250 s',
    2043                 0x30 => '1/200 s',
    2044                 0x40 => '1/160 s',
    2045                 0x50 => '1/125 s',
    2046                 0x60 => '1/100 s',
    2047                 0x70 => '1/80 s',
    2048                 0x80 => '1/60 s',
     1972                0 => '1/320 s (auto FP)',
     1973                1 => '1/250 s (auto FP)',
     1974                2 => '1/250 s',
     1975                3 => '1/200 s',
     1976                4 => '1/160 s',
     1977                5 => '1/125 s',
     1978                6 => '1/100 s',
     1979                7 => '1/80 s',
     1980                8 => '1/60 s',
    20491981            },
    20501982        },
     
    20551987        PrintConvColumns => 2,
    20561988        PrintConv => {
    2057             0x00 => '1/60 s',
    2058             0x01 => '1/30 s',
    2059             0x02 => '1/15 s',
    2060             0x03 => '1/8 s',
    2061             0x04 => '1/4 s',
    2062             0x05 => '1/2 s',
    2063             0x06 => '1 s',
    2064             0x07 => '2 s',
    2065             0x08 => '4 s',
    2066             0x09 => '8 s',
    2067             0x0a => '15 s',
    2068             0x0b => '30 s',
    2069         },
    2070     },
    2071     21.1 => { # CSe5 (D300), CSe4 (D3)
     1989            0 => '1/60 s',
     1990            1 => '1/30 s',
     1991            2 => '1/15 s',
     1992            3 => '1/8 s',
     1993            4 => '1/4 s',
     1994            5 => '1/2 s',
     1995            6 => '1 s',
     1996            7 => '2 s',
     1997            8 => '4 s',
     1998            9 => '8 s',
     1999            10 => '15 s',
     2000            11 => '30 s',
     2001        },
     2002    },
     2003    21.1 => [{ # CSe5 (D300), CSe4 (D3)
    20722004        Name => 'AutoBracketSet',
     2005        Condition => '$$self{Model} !~ /(D3S|D300S)\b/',
     2006        Notes => 'D3 and D300',
    20732007        Mask => 0xc0,
    20742008        PrintConv => {
    2075             0x00 => 'AE & Flash',
    2076             0x40 => 'AE Only',
    2077             0x80 => 'Flash Only',
    2078             0xc0 => 'WB Bracketing',
    2079             # NOTE: D3S/D300S have an "ADL Bracketing" setting not decoded - PH
    2080         },
    2081     },
    2082     21.2 => { # CSe6 (D300), CSe5 (D3)
     2009            0 => 'AE & Flash',
     2010            1 => 'AE Only',
     2011            2 => 'Flash Only',
     2012            3 => 'WB Bracketing',
     2013        },
     2014    },{ # CSe4 (D3S) (NC for D300S)
     2015        Name => 'AutoBracketSet',
     2016        Notes => 'D3S and D300S',
     2017        Mask => 0xe0,
     2018        PrintConv => {
     2019            0 => 'AE & Flash',
     2020            1 => 'AE Only',
     2021            2 => 'Flash Only',
     2022            3 => 'WB Bracketing',
     2023            # D3S/D300S have an "ADL Bracketing" setting - PH
     2024            4 => 'ADL Bracketing',
     2025        },
     2026    }],
     2027    21.2 => [{ # CSe6 (D300), CSe5 (D3)
    20832028        Name => 'AutoBracketModeM',
     2029        Condition => '$$self{Model} !~ /(D3S|D300S)\b/',
     2030        Notes => 'D3 and D300',
    20842031        Mask => 0x30,
    20852032        PrintConv => {
    2086             0x00 => 'Flash/Speed',
    2087             0x10 => 'Flash/Speed/Aperture',
    2088             0x20 => 'Flash/Aperture',
    2089             0x30 => 'Flash Only',
    2090         },
    2091     },
    2092     21.3 => { # CSe7 (D300), CSe6 (D3)
     2033            0 => 'Flash/Speed',
     2034            1 => 'Flash/Speed/Aperture',
     2035            2 => 'Flash/Aperture',
     2036            3 => 'Flash Only',
     2037        },
     2038    },{ # CSe5 (D3S)
     2039        Name => 'AutoBracketModeM',
     2040        Notes => 'D3S and D300S',
     2041        Mask => 0x18,
     2042        PrintConv => {
     2043            0 => 'Flash/Speed',
     2044            1 => 'Flash/Speed/Aperture',
     2045            2 => 'Flash/Aperture',
     2046            3 => 'Flash Only',
     2047        },
     2048    }],
     2049    21.3 => [{ # CSe7 (D300), CSe6 (D3)
    20932050        Name => 'AutoBracketOrder',
     2051        Condition => '$$self{Model} !~ /(D3S|D300S)\b/',
     2052        Notes => 'D3 and D300',
    20942053        Mask => 0x08,
    20952054        PrintConv => {
    2096             0x00 => '0,-,+',
    2097             0x08 => '-,0,+',
    2098         },
    2099     },
     2055            0 => '0,-,+',
     2056            1 => '-,0,+',
     2057        },
     2058    },{ # CSe6 (D3S)
     2059        Name => 'AutoBracketOrder',
     2060        Notes => 'D3S and D300S',
     2061        Mask => 0x04,
     2062        PrintConv => {
     2063            0 => '0,-,+',
     2064            1 => '-,0,+',
     2065        },
     2066    }],
    21002067    21.4 => { # CSe4 (D300), CSe3 (D3)
    21012068        Name => 'ModelingFlash',
    21022069        Mask => 0x01,
    2103         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     2070        PrintConv => \%onOff,
    21042071    },
    21052072    22.1 => { # CSf9, CSf10 (D3S,D300S)
     
    21072074        Mask => 0x80,
    21082075        PrintConv => {
    2109             0x00 => 'Release Locked',
    2110             0x80 => 'Enable Release',
     2076            0 => 'Release Locked',
     2077            1 => 'Enable Release',
    21112078        },
    21122079    },
     
    21162083        PrintConvColumns => 2,
    21172084        PrintConv => {
    2118             0x00 => '4 s',
    2119             0x01 => '6 s',
    2120             0x02 => '8 s',
    2121             0x03 => '16 s',
    2122             0x04 => '30 s',
    2123             0x05 => '1 min',
    2124             0x06 => '5 min',
    2125             0x07 => '10 min',
    2126             0x08 => '30 min',
    2127             0x09 => 'No Limit',
     2085            0 => '4 s',
     2086            1 => '6 s',
     2087            2 => '8 s',
     2088            3 => '16 s',
     2089            4 => '30 s',
     2090            5 => '1 min',
     2091            6 => '5 min',
     2092            7 => '10 min',
     2093            8 => '30 min',
     2094            9 => 'No Limit',
    21282095        },
    21292096    },
     
    21322099        Mask => 0xc0,
    21332100        PrintConv => {
    2134             0x00 => 'TTL',
    2135             0x40 => 'Manual',
    2136             0x80 => 'Repeating Flash',
    2137             0xc0 => 'Commander Mode',
     2101            0 => 'TTL',
     2102            1 => 'Manual',
     2103            2 => 'Repeating Flash',
     2104            3 => 'Commander Mode',
     2105        },
     2106    },
     2107    25.1 => { #1 CSc4-d (D3S)
     2108        Name => 'ImageReviewTime',
     2109        Mask => 0xe0,
     2110        PrintConv => {
     2111            0 => '4 s',
     2112            1 => '10 s',
     2113            2 => '20 s',
     2114            3 => '1 min',
     2115            4 => '5 min',
     2116            5 => '10 min',
     2117        },
     2118    },
     2119    25.2 => { #1 CSc4-a (D3S)
     2120        Name => 'PlaybackMonitorOffTime',
     2121        Mask => 0x1c,
     2122        PrintConv => {
     2123            0 => '4 s',
     2124            1 => '10 s',
     2125            2 => '20 s',
     2126            3 => '1 min',
     2127            4 => '5 min',
     2128            5 => '10 min',
     2129        },
     2130    },
     2131    26.1 => { #1 CSc4-b (D3S)
     2132        Name => 'MenuMonitorOffTime',
     2133        Mask => 0xe0,
     2134        PrintConv => {
     2135            0 => '4 s',
     2136            1 => '10 s',
     2137            2 => '20 s',
     2138            3 => '1 min',
     2139            4 => '5 min',
     2140            5 => '10 min',
     2141        },
     2142    },
     2143    26.2 => { #1 CSc4-c (D3S)
     2144        Name => 'ShootingInfoMonitorOffTime',
     2145        Mask => 0x1c,
     2146        PrintConv => {
     2147            0 => '4 s',
     2148            1 => '10 s',
     2149            2 => '20 s',
     2150            3 => '1 min',
     2151            4 => '5 min',
     2152            5 => '10 min',
    21382153        },
    21392154    },
     
    21642179        Notes => '"No" if any custom setting for this bank was changed from the default',
    21652180        Mask => 0x80,
    2166         PrintConv => { 0x00 => 'Yes', 0x80 => 'No' },
     2181        PrintConv => { 0 => 'Yes', 1 => 'No' },
    21672182    },
    21682183    1.1 => { # CSa1
     
    21702185        Mask => 0xc0,
    21712186        PrintConv => {
    2172             0x00 => 'Release',
    2173             0x40 => 'Release + Focus',
    2174             0x80 => 'Focus',
     2187            0 => 'Release',
     2188            1 => 'Release + Focus',
     2189            2 => 'Focus',
    21752190        },
    21762191    },
     
    21792194        Mask => 0x20,
    21802195        PrintConv => {
    2181             0x00 => 'Focus',
    2182             0x20 => 'Release',
     2196            0 => 'Focus',
     2197            1 => 'Release',
    21832198        },
    21842199    },
     
    21872202        Mask => 0x10,
    21882203        PrintConv => {
    2189             0x00 => '51 Points',
    2190             0x10 => '11 Points',
     2204            0 => '51 Points',
     2205            1 => '11 Points',
    21912206        },
    21922207    },
     
    21952210        Mask => 0x0c,
    21962211        PrintConv => {
    2197             0x00 => '9 Points',
    2198             0x04 => '21 Points',
    2199             0x08 => '51 Points',
    2200             0x0c => '51 Points (3D-tracking)',
     2212            0 => '9 Points',
     2213            1 => '21 Points',
     2214            2 => '51 Points',
     2215            3 => '51 Points (3D-tracking)',
    22012216        },
    22022217    },
     
    22052220        Mask => 0x80,
    22062221        PrintConv => {
    2207             0x00 => 'Shutter/AF-On',
    2208             0x80 => 'AF-On Only',
     2222            0 => 'Shutter/AF-On',
     2223            1 => 'AF-On Only',
    22092224        },
    22102225    },
     
    22132228        Mask => 0x08,
    22142229        PrintConv => {
    2215             0x00 => 'No Wrap',
    2216             0x08 => 'Wrap',
     2230            0 => 'No Wrap',
     2231            1 => 'Wrap',
    22172232        },
    22182233    },
     
    22212236        Mask => 0x06,
    22222237        PrintConv => {
    2223             0x00 => 'Auto',
    2224             0x02 => 'Off',
    2225             0x04 => 'On',
     2238            0 => 'Auto',
     2239            1 => 'Off',
     2240            2 => 'On',
    22262241        },
    22272242    },
     
    22292244        Name => 'AFAssist',
    22302245        Mask => 0x01,
    2231         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     2246        PrintConv => \%onOff,
    22322247    },
    22332248    3.1 => { # CSa4
     
    22352250        Mask => 0x07,
    22362251        PrintConv => {
    2237             0x00 => '3 Normal',
    2238             0x01 => '4',
    2239             0x02 => '5 Long',
    2240             0x03 => '2',
    2241             0x04 => '1 Short',
    2242             0x05 => 'Off',
     2252            0 => '3 Normal',
     2253            1 => '4',
     2254            2 => '5 Long',
     2255            3 => '2',
     2256            4 => '1 Short',
     2257            5 => 'Off',
    22432258        },
    22442259    },
     
    22472262        Mask => 0x70,
    22482263        PrintConv => {
    2249             0x00 => 'AF-On',
    2250             0x10 => 'AE/AF Lock',
    2251             0x20 => 'AE Lock Only',
    2252             0x30 => 'AE Lock (reset on release)',
    2253             0x40 => 'AE Lock (hold)',
    2254             0x50 => 'AF Lock Only',
    2255             0x60 => 'Same as FUNC Button',
     2264            0 => 'AF-On',
     2265            1 => 'AE/AF Lock',
     2266            2 => 'AE Lock Only',
     2267            3 => 'AE Lock (reset on release)',
     2268            4 => 'AE Lock (hold)',
     2269            5 => 'AF Lock Only',
     2270            6 => 'Same as FUNC Button',
    22562271        },
    22572272    },
     
    22602275        Mask => 0xc0,
    22612276        PrintConv => {
    2262             0x00 => '1/3 EV',
    2263             0x40 => '1/2 EV',
    2264             0x80 => '1 EV',
     2277            0 => '1/3 EV',
     2278            1 => '1/2 EV',
     2279            2 => '1 EV',
    22652280        },
    22662281    },
     
    22692284        Mask => 0x30,
    22702285        PrintConv => {
    2271             0x00 => '1/3 EV',
    2272             0x10 => '1/2 EV',
    2273             0x20 => '1 EV',
     2286            0 => '1/3 EV',
     2287            1 => '1/2 EV',
     2288            2 => '1 EV',
    22742289        },
    22752290    },
     
    22782293        Mask => 0x0c,
    22792294        PrintConv => {
    2280             0x00 => '1/3 EV',
    2281             0x04 => '1/2 EV',
    2282             0x08 => '1 EV',
     2295            0 => '1/3 EV',
     2296            1 => '1/2 EV',
     2297            2 => '1 EV',
    22832298        },
    22842299    },
     
    22872302        Mask => 0x03,
    22882303        PrintConv => {
    2289             0x00 => 'Off',
    2290             0x01 => 'On',
    2291             0x02 => 'On (auto reset)',
     2304            0 => 'Off',
     2305            1 => 'On',
     2306            2 => 'On (auto reset)',
    22922307        },
    22932308    },
     
    22962311        Mask => 0x70,
    22972312        PrintConv => {
    2298             0x00 => '8 mm',
    2299             0x10 => '12 mm',
    2300             0x20 => '15 mm',
    2301             0x30 => '20 mm',
    2302             0x40 => 'Average',
     2313            0 => '8 mm',
     2314            1 => '12 mm',
     2315            2 => '15 mm',
     2316            3 => '20 mm',
     2317            4 => 'Average',
    23032318        },
    23042319    },
     
    23062321        Name => 'FineTuneOptMatrixMetering',
    23072322        Mask => 0xf0,
    2308         ValueConv => '($val > 0x70 ? $val - 0x100 : $val) / 0x60',
    2309         ValueConvInv => '(int($val*6+($val>0?0.5:-0.5))<<4) & 0xf0',
     2323        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     2324        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    23102325        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    23112326        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    23152330        Mask => 0x0f,
    23162331        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
    2317         ValueConvInv => 'int($val*6+($val>0?0.5:-0.5)) & 0x0f',
     2332        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
    23182333        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
    23192334        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    23222337        Name => 'ShutterReleaseButtonAE-L',
    23232338        Mask => 0x80,
    2324         PrintConv => { 0x00 => 'Off', 0x80 => 'On' },
     2339        PrintConv => \%offOn,
    23252340    },
    23262341    7.2 => { # CSc3
     
    23282343        Mask => 0x30,
    23292344        PrintConv => {
    2330             0x00 => '2 s',
    2331             0x10 => '5 s',
    2332             0x20 => '10 s',
    2333             0x30 => '20 s',
     2345            0 => '2 s',
     2346            1 => '5 s',
     2347            2 => '10 s',
     2348            3 => '20 s',
    23342349        },
    23352350    },
     
    23392354        PrintConvColumns => 2,
    23402355        PrintConv => {
    2341             0x00 => '4 s',
    2342             0x01 => '6 s',
    2343             0x02 => '8 s',
    2344             0x03 => '16 s',
    2345             0x04 => '30 s',
    2346             0x05 => '1 min',
    2347             0x06 => '5 min',
    2348             0x07 => '10 min',
    2349             0x08 => '30 min',
    2350             0x09 => 'No Limit',
     2356            0 => '4 s',
     2357            1 => '6 s',
     2358            2 => '8 s',
     2359            3 => '16 s',
     2360            4 => '30 s',
     2361            5 => '1 min',
     2362            6 => '5 min',
     2363            7 => '10 min',
     2364            8 => '30 min',
     2365            9 => 'No Limit',
    23512366        },
    23522367    },
     
    23552370        Mask => 0x38,
    23562371        PrintConv => {
    2357             0x00 => '4 s',
    2358             0x08 => '10 s',
    2359             0x10 => '20 s',
    2360             0x18 => '1 min',
    2361             0x20 => '5 min',
    2362             0x28 => '10 min',
     2372            0 => '4 s',
     2373            1 => '10 s',
     2374            2 => '20 s',
     2375            3 => '1 min',
     2376            4 => '5 min',
     2377            5 => '10 min',
    23632378        },
    23642379    },
     
    23672382        Mask => 0x07,
    23682383        PrintConv => {
    2369             0x00 => '4 s',
    2370             0x01 => '10 s',
    2371             0x02 => '20 s',
    2372             0x03 => '1 min',
    2373             0x04 => '5 min',
    2374             0x05 => '10 min',
     2384            0 => '4 s',
     2385            1 => '10 s',
     2386            2 => '20 s',
     2387            3 => '1 min',
     2388            4 => '5 min',
     2389            5 => '10 min',
    23752390        },
    23762391    },
     
    23792394        Mask => 0x38,
    23802395        PrintConv => {
    2381             0x00 => '4 s',
    2382             0x08 => '10 s',
    2383             0x10 => '20 s',
    2384             0x18 => '1 min',
    2385             0x20 => '5 min',
    2386             0x28 => '10 min',
     2396            0 => '4 s',
     2397            1 => '10 s',
     2398            2 => '20 s',
     2399            3 => '1 min',
     2400            4 => '5 min',
     2401            5 => '10 min',
    23872402        },
    23882403    },
     
    23912406        Mask => 0x07,
    23922407        PrintConv => {
    2393             0x00 => '4 s',
    2394             0x01 => '10 s',
    2395             0x02 => '20 s',
    2396             0x03 => '1 min',
    2397             0x04 => '5 min',
    2398             0x05 => '10 min',
     2408            0 => '4 s',
     2409            1 => '10 s',
     2410            2 => '20 s',
     2411            3 => '1 min',
     2412            4 => '5 min',
     2413            5 => '10 min',
    23992414        },
    24002415    },
     
    24032418        Mask => 0xc0,
    24042419        PrintConv => {
    2405             0x00 => 'High',
    2406             0x40 => 'Low',
    2407             0x80 => 'Off',
     2420            0 => 'High',
     2421            1 => 'Low',
     2422            2 => 'Off',
    24082423        },
    24092424    },
     
    24122427        Mask => 0x30,
    24132428        PrintConv => {
    2414             0x00 => 'Auto', #JD (D300)
    2415             0x10 => 'Auto', #1 (D3)
    2416             0x20 => 'Manual (dark on light)',
    2417             0x30 => 'Manual (light on dark)',
     2429            0 => 'Auto', #JD (D300)
     2430            1 => 'Auto', #1 (D3)
     2431            2 => 'Manual (dark on light)',
     2432            3 => 'Manual (light on dark)',
    24182433        },
    24192434    },
     
    24212436        Name => 'LCDIllumination',
    24222437        Mask => 0x08,
    2423         PrintConv => { 0x00 => 'Off', 0x08 => 'On' },
     2438        PrintConv => \%offOn,
    24242439    },
    24252440    10.4 => { # CSd9
    24262441        Name => 'ExposureDelayMode',
    24272442        Mask => 0x04,
    2428         PrintConv => { 0x00 => 'Off', 0x04 => 'On' },
     2443        PrintConv => \%offOn,
    24292444    },
    24302445    10.5 => { # CSd2
    24312446        Name => 'GridDisplay',
    24322447        Mask => 0x02,
    2433         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     2448        PrintConv => \%offOn,
    24342449    },
    24352450    11.1 => { # CSd6
    24362451        Name => 'FileNumberSequence',
    24372452        Mask => 0x40,
    2438         PrintConv => { 0x00 => 'On', 0x40 => 'Off' },
     2453        PrintConv => \%onOff,
    24392454    },
    24402455    11.2 => { # CSd4
     
    24512466        Name => 'ScreenTips',
    24522467        Mask => 0x08,
    2453         PrintConv => { 0x08 => 'On', 0x00 => 'Off' },
     2468        PrintConv => \%onOff,
    24542469    },
    24552470    13.2 => { # CSd11
     
    24572472        Mask => 0x04,
    24582473        PrintConv => {
    2459             0x00 => 'MB-D10 First',
    2460             0x04 => 'Camera Battery First',
     2474            0 => 'MB-D10 First',
     2475            1 => 'Camera Battery First',
    24612476        },
    24622477    },
     
    24652480        Mask => 0x03,
    24662481        PrintConv => {
    2467             0x00 => 'LR6 (AA alkaline)',
    2468             0x01 => 'HR6 (AA Ni-MH)',
    2469             0x02 => 'FR6 (AA lithium)',
    2470             0x03 => 'ZR6 (AA Ni-Mn)',
     2482            0 => 'LR6 (AA alkaline)',
     2483            1 => 'HR6 (AA Ni-MH)',
     2484            2 => 'FR6 (AA lithium)',
     2485            3 => 'ZR6 (AA Ni-Mn)',
    24712486        },
    24722487    },
     
    24752490        Mask => 0xf0,
    24762491        PrintConv => {
    2477             0x00 => '1/320 s (auto FP)',
    2478             0x10 => '1/250 s (auto FP)',
    2479             0x20 => '1/250 s',
    2480             0x30 => '1/200 s',
    2481             0x40 => '1/160 s',
    2482             0x50 => '1/125 s',
    2483             0x60 => '1/100 s',
    2484             0x70 => '1/80 s',
    2485             0x80 => '1/60 s',
     2492            0 => '1/320 s (auto FP)',
     2493            1 => '1/250 s (auto FP)',
     2494            2 => '1/250 s',
     2495            3 => '1/200 s',
     2496            4 => '1/160 s',
     2497            5 => '1/125 s',
     2498            6 => '1/100 s',
     2499            7 => '1/80 s',
     2500            8 => '1/60 s',
    24862501       },
    24872502    },
     
    24912506        PrintConvColumns => 2,
    24922507        PrintConv => {
    2493             0x00 => '1/60 s',
    2494             0x01 => '1/30 s',
    2495             0x02 => '1/15 s',
    2496             0x03 => '1/8 s',
    2497             0x04 => '1/4 s',
    2498             0x05 => '1/2 s',
    2499             0x06 => '1 s',
    2500             0x07 => '2 s',
    2501             0x08 => '4 s',
    2502             0x09 => '8 s',
    2503             0x0a => '15 s',
    2504             0x0b => '30 s',
     2508            0 => '1/60 s',
     2509            1 => '1/30 s',
     2510            2 => '1/15 s',
     2511            3 => '1/8 s',
     2512            4 => '1/4 s',
     2513            5 => '1/2 s',
     2514            6 => '1 s',
     2515            7 => '2 s',
     2516            8 => '4 s',
     2517            9 => '8 s',
     2518            10 => '15 s',
     2519            11 => '30 s',
    25052520        },
    25062521    },
     
    25102525        #      does not decode the detail settings.
    25112526        Mask => 0xc0,
    2512         RawConv => '$$self{FlashControlBuiltin} = $val & 0xc0',
    2513         PrintConv => {
    2514             0x00 => 'TTL',
    2515             0x40 => 'Manual',
    2516             0x80 => 'Repeating Flash',
    2517             0xc0 => 'Commander Mode',
     2527        RawConv => '$$self{FlashControlBuiltin} = $val',
     2528        PrintConv => {
     2529            0 => 'TTL',
     2530            1 => 'Manual',
     2531            2 => 'Repeating Flash',
     2532            3 => 'Commander Mode',
    25182533        },
    25192534    },
    25202535    16.2 => { # CSe3-b
    25212536        Name => 'ManualFlashOutput',
    2522         Condition => '$$self{FlashControlBuiltin} == 0x40',
     2537        Condition => '$$self{FlashControlBuiltin} == 1',
    25232538        Mask => 0x1f,
    25242539        ValueConv => '2 ** (-$val/3)',
     
    25322547    17.1 => { # CSe3-ca
    25332548        Name => 'RepeatingFlashOutput',
    2534         Condition => '$$self{FlashControlBuiltin} == 0x80',
     2549        Condition => '$$self{FlashControlBuiltin} == 2',
    25352550        Mask => 0x70,
    2536         ValueConv => '2 ** (-($val>>4)-2)',
    2537         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5)<<4 : 0',
     2551        ValueConv => '2 ** (-$val-2)',
     2552        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5) : 0',
    25382553        PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
    25392554        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    25412556    17.2 => { # CSe3-cb
    25422557        Name => 'RepeatingFlashCount',
    2543         Condition => '$$self{FlashControlBuiltin} == 0x80',
     2558        Condition => '$$self{FlashControlBuiltin} == 2',
    25442559        Mask => 0x0f,
    25452560        ValueConv => '$val < 10 ? $val + 1 : 5 * ($val - 7)',
     
    25482563    18.1 => { # CSe3-cc (NC)
    25492564        Name => 'RepeatingFlashRate',
    2550         Condition => '$$self{FlashControlBuiltin} == 0x80',
     2565        Condition => '$$self{FlashControlBuiltin} == 2',
    25512566        Mask => 0xf0,
    2552         ValueConv => 'my $v=($val>>4); $v < 10 ? $v + 1 : 10 * ($v - 8)',
    2553         ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5) << 4',
     2567        ValueConv => '$val < 10 ? $val + 1 : 10 * ($val - 8)',
     2568        ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5)',
    25542569        PrintConv => '"$val Hz"',
    25552570        PrintConvInv => '$val=~/(\d+)/; $1 || 0',
     
    25572572    18.2 => { # CSe3-dd
    25582573        Name => 'CommanderInternalTTLChannel',
    2559         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     2574        Condition => '$$self{FlashControlBuiltin} == 3',
    25602575        Mask => 0x03,
    25612576        PrintConv => {
    2562             0x00 => '1 ch',
    2563             0x01 => '2 ch',
    2564             0x02 => '3 ch',
    2565             0x03 => '4 ch',
     2577            0 => '1 ch',
     2578            1 => '2 ch',
     2579            2 => '3 ch',
     2580            3 => '4 ch',
    25662581        },
    25672582    },
    25682583    20.1 => { # CSe3-da
    25692584        Name => 'CommanderInternalTTLCompBuiltin',
    2570         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     2585        Condition => '$$self{FlashControlBuiltin} == 3',
    25712586        Mask => 0x1f,
    25722587        ValueConv => '($val - 9) / 3',
     
    25772592    21.1 => { # CSe3-db
    25782593        Name => 'CommanderInternalTTLCompGroupA',
    2579         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     2594        Condition => '$$self{FlashControlBuiltin} == 3',
    25802595        Mask => 0x1f,
    25812596        ValueConv => '($val - 9) / 3',
     
    25862601    22.1 => { # CSe3-dc
    25872602        Name => 'CommanderInternalTTLCompGroupB',
    2588         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     2603        Condition => '$$self{FlashControlBuiltin} == 3',
    25892604        Mask => 0x1f,
    25902605        ValueConv => '($val - 9) / 3',
     
    25972612        Mask => 0xc0,
    25982613        PrintConv => {
    2599             0x00 => 'AE & Flash',
    2600             0x40 => 'AE Only',
    2601             0x80 => 'Flash Only',
    2602             0xc0 => 'WB Bracketing',
     2614            0 => 'AE & Flash',
     2615            1 => 'AE Only',
     2616            2 => 'Flash Only',
     2617            3 => 'WB Bracketing',
    26032618        },
    26042619    },
     
    26072622        Mask => 0x30,
    26082623        PrintConv => {
    2609             0x00 => 'Flash/Speed',
    2610             0x10 => 'Flash/Speed/Aperture',
    2611             0x20 => 'Flash/Aperture',
    2612             0x30 => 'Flash Only',
     2624            0 => 'Flash/Speed',
     2625            1 => 'Flash/Speed/Aperture',
     2626            2 => 'Flash/Aperture',
     2627            3 => 'Flash Only',
    26132628        },
    26142629    },
     
    26172632        Mask => 0x08,
    26182633        PrintConv => {
    2619             0x00 => '0,-,+',
    2620             0x08 => '-,0,+',
     2634            0 => '0,-,+',
     2635            1 => '-,0,+',
    26212636        },
    26222637    },
     
    26242639        Name => 'ModelingFlash',
    26252640        Mask => 0x01,
    2626         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     2641        PrintConv => \%onOff,
    26272642    },
    26282643    27.1 => { # CSf2-a
     
    26302645        Mask => 0xc0,
    26312646        PrintConv => {
    2632             0x00 => 'Select Center Focus Point',
    2633             0x40 => 'Highlight Active Focus Point',
    2634             0x80 => 'Not Used',
     2647            0 => 'Select Center Focus Point',
     2648            1 => 'Highlight Active Focus Point',
     2649            2 => 'Not Used',
    26352650        },
    26362651    },
     
    26392654        Mask => 0x30,
    26402655        PrintConv => {
    2641             0x00 => 'Thumbnail On/Off',
    2642             0x10 => 'View Histograms',
    2643             0x20 => 'Zoom On/Off',
    2644             0x30 => 'Choose Folder',
     2656            0 => 'Thumbnail On/Off',
     2657            1 => 'View Histograms',
     2658            2 => 'Zoom On/Off',
     2659            3 => 'Choose Folder',
    26452660        },
    26462661    },
     
    26492664        Mask => 0x0c,
    26502665        PrintConv => { #1
    2651             0x00 => 'Low Magnification',
    2652             0x04 => 'Medium Magnification',
    2653             0x08 => 'High Magnification',
     2666            0 => 'Low Magnification',
     2667            1 => 'Medium Magnification',
     2668            2 => 'High Magnification',
    26542669        },
    26552670    },
     
    26582673        Mask => 0x01,
    26592674        PrintConv => {
    2660             0x00 => 'Do Nothing',
    2661             0x01 => 'Reset Meter-off Delay',
     2675            0 => 'Do Nothing',
     2676            1 => 'Reset Meter-off Delay',
    26622677        },
    26632678    },
     
    26662681        Mask => 0xf8,
    26672682        PrintConv => {
    2668             0x00 => 'None',
    2669             0x08 => 'Preview',
    2670             0x10 => 'FV Lock',
    2671             0x18 => 'AE/AF Lock',
    2672             0x20 => 'AE Lock Only',
    2673             0x28 => 'AE Lock (reset on release)',
    2674             0x30 => 'AE Lock (hold)',
    2675             0x38 => 'AF Lock Only',
    2676             # 0x40 not used
    2677             0x48 => 'Flash Off',
    2678             0x50 => 'Bracketing Burst',
    2679             0x58 => 'Matrix Metering',
    2680             0x60 => 'Center-weighted Metering',
    2681             0x68 => 'Spot Metering',
    2682             0x70 => 'My Menu Top',
    2683             0x78 => 'Live View',
    2684             0x80 => '+ NEF (RAW)',
    2685             0x88 => 'Virtual Horizon',
     2683            0 => 'None',
     2684            1 => 'Preview',
     2685            2 => 'FV Lock',
     2686            3 => 'AE/AF Lock',
     2687            4 => 'AE Lock Only',
     2688            5 => 'AE Lock (reset on release)',
     2689            6 => 'AE Lock (hold)',
     2690            7 => 'AF Lock Only',
     2691            # 8 not used
     2692            9 => 'Flash Off',
     2693            10 => 'Bracketing Burst',
     2694            11 => 'Matrix Metering',
     2695            12 => 'Center-weighted Metering',
     2696            13 => 'Spot Metering',
     2697            14 => 'My Menu Top',
     2698            15 => 'Live View',
     2699            16 => '+ NEF (RAW)',
     2700            17 => 'Virtual Horizon',
    26862701        },
    26872702    },
     
    26902705        Mask => 0xf8,
    26912706        PrintConv => {
    2692             0x00 => 'None',
    2693             0x08 => 'Preview',
    2694             0x10 => 'FV Lock',
    2695             0x18 => 'AE/AF Lock',
    2696             0x20 => 'AE Lock Only',
    2697             0x28 => 'AE Lock (reset on release)',
    2698             0x30 => 'AE Lock (hold)',
    2699             0x38 => 'AF Lock Only',
    2700             0x40 => 'AF-ON',
    2701             0x48 => 'Flash Off',
    2702             0x50 => 'Bracketing Burst',
    2703             0x58 => 'Matrix Metering',
    2704             0x60 => 'Center-weighted Metering',
    2705             0x68 => 'Spot Metering',
    2706             0x70 => 'My Menu Top',
    2707             0x78 => 'Live View',
    2708             0x80 => '+ NEF (RAW)',
    2709             0x88 => 'Virtual Horizon',
     2707            0 => 'None',
     2708            1 => 'Preview',
     2709            2 => 'FV Lock',
     2710            3 => 'AE/AF Lock',
     2711            4 => 'AE Lock Only',
     2712            5 => 'AE Lock (reset on release)',
     2713            6 => 'AE Lock (hold)',
     2714            7 => 'AF Lock Only',
     2715            8 => 'AF-ON',
     2716            9 => 'Flash Off',
     2717            10 => 'Bracketing Burst',
     2718            11 => 'Matrix Metering',
     2719            12 => 'Center-weighted Metering',
     2720            13 => 'Spot Metering',
     2721            14 => 'My Menu Top',
     2722            15 => 'Live View',
     2723            16 => '+ NEF (RAW)',
     2724            17 => 'Virtual Horizon',
    27102725        },
    27112726    },
     
    27152730        Mask => 0xf8,
    27162731        PrintConv => {
    2717             0x00 => 'None',
    2718             0x08 => 'Preview',
    2719             0x10 => 'FV Lock',
    2720             0x18 => 'AE/AF Lock',
    2721             0x20 => 'AE Lock Only',
    2722             0x28 => 'AE Lock (reset on release)',
    2723             0x30 => 'AE Lock (hold)',
    2724             0x38 => 'AF Lock Only',
    2725             0x40 => 'AF-ON',
    2726             0x48 => 'Flash Off',
    2727             0x50 => 'Bracketing Burst',
    2728             0x58 => 'Matrix Metering',
    2729             0x60 => 'Center-weighted Metering',
    2730             0x68 => 'Spot Metering',
    2731             0x70 => 'My Menu Top',
    2732             0x78 => 'Live View',
    2733             0x80 => '+ NEF (RAW)',
    2734             0x88 => 'Virtual Horizon',
     2732            0 => 'None',
     2733            1 => 'Preview',
     2734            2 => 'FV Lock',
     2735            3 => 'AE/AF Lock',
     2736            4 => 'AE Lock Only',
     2737            5 => 'AE Lock (reset on release)',
     2738            6 => 'AE Lock (hold)',
     2739            7 => 'AF Lock Only',
     2740            8 => 'AF-ON',
     2741            9 => 'Flash Off',
     2742            10 => 'Bracketing Burst',
     2743            11 => 'Matrix Metering',
     2744            12 => 'Center-weighted Metering',
     2745            13 => 'Spot Metering',
     2746            14 => 'My Menu Top',
     2747            15 => 'Live View',
     2748            16 => '+ NEF (RAW)',
     2749            17 => 'Virtual Horizon',
    27352750        },
    27362751    },
     
    27392754        Mask => 0x70,
    27402755        PrintConv => {
    2741             0x00 => 'None',
    2742             0x10 => 'Choose Image Area',
    2743             0x20 => 'One Step Speed/Aperture',
    2744             0x30 => 'Choose Non-CPU Lens Number',
    2745             # n/a  0x40 => 'Focus Point Selection',
    2746             0x50 => 'Auto bracketing',
    2747             0x60 => 'Dynamic AF Area',
    2748             0x70 => 'Shutter speed & Aperture lock',
     2756            0 => 'None',
     2757            1 => 'Choose Image Area',
     2758            2 => 'One Step Speed/Aperture',
     2759            3 => 'Choose Non-CPU Lens Number',
     2760            # n/a  4 => 'Focus Point Selection',
     2761            5 => 'Auto bracketing',
     2762            6 => 'Dynamic AF Area',
     2763            7 => 'Shutter speed & Aperture lock',
    27492764        },
    27502765    },
     
    27532768        Mask => 0x07,
    27542769        PrintConv => {
    2755             0x00 => 'None',
    2756             0x01 => 'Choose Image Area',
    2757             0x02 => 'One Step Speed/Aperture',
    2758             0x03 => 'Choose Non-CPU Lens Number',
    2759             # n/a  0x04 => 'Focus Point Selection',
    2760             0x05 => 'Auto bracketing',
    2761             0x06 => 'Dynamic AF Area',
    2762             0x07 => 'Shutter speed & Aperture lock',
     2770            0 => 'None',
     2771            1 => 'Choose Image Area',
     2772            2 => 'One Step Speed/Aperture',
     2773            3 => 'Choose Non-CPU Lens Number',
     2774            # n/a  4 => 'Focus Point Selection',
     2775            5 => 'Auto bracketing',
     2776            6 => 'Dynamic AF Area',
     2777            7 => 'Shutter speed & Aperture lock',
    27632778        },
    27642779    },
     
    27662781        Name => 'AELockButtonPlusDials',
    27672782        Mask => 0x70,
    2768         PrintConv => {
    2769             0x00 => 'None',
    2770             0x10 => 'Choose Image Area',
    2771             0x20 => 'One Step Speed/Aperture',
    2772             0x30 => 'Choose Non-CPU Lens Number',
    2773             # n/a  0x40 => 'Focus Point Selection',
    2774             0x50 => 'Auto bracketing',
    2775             0x60 => 'Dynamic AF Area',
    2776             0x70 => 'Shutter speed & Aperture lock',
     2783        Prinonv => {
     2784            0 => 'None',
     2785            1 => 'Choose Image Area',
     2786            2 => 'One Step Speed/Aperture',
     2787            3 => 'Choose Non-CPU Lens Number',
     2788            # n/a  4 => 'Focus Point Selection',
     2789            5 => 'Auto bracketing',
     2790            6 => 'Dynamic AF Area',
     2791            7 => 'Shutter speed & Aperture lock',
    27772792        },
    27782793    },
     
    27802795        Name => 'CommandDialsReverseRotation',
    27812796        Mask => 0x80,
    2782         PrintConv => { 0x00 => 'No', 0x80 => 'Yes' },
     2797        PrintConv => \%noYes,
    27832798    },
    27842799    33.2 => { # CSf9-b
    27852800        Name => 'CommandDialsChangeMainSub',
    27862801        Mask => 0x40,
    2787         PrintConv => { 0x00 => 'Off', 0x40 => 'On' },
     2802        PrintConv => \%offOn,
    27882803    },
    27892804    33.3 => { # CSf9-c
     
    27912806        Mask => 0x20,
    27922807        PrintConv => {
    2793             0x00 => 'Sub-command Dial',
    2794             0x20 => 'Aperture Ring',
     2808            0 => 'Sub-command Dial',
     2809            1 => 'Aperture Ring',
    27952810        },
    27962811    },
     
    27982813        Name => 'CommandDialsMenuAndPlayback',
    27992814        Mask => 0x10,
    2800         PrintConv => { 0x00 => 'Off', 0x10 => 'On' },
     2815        PrintConv => \%offOn,
    28012816    },
    28022817    33.5 => { # CSf12
     
    28042819        Mask => 0x08,
    28052820        PrintConv => {
    2806             0x00 => '+ 0 -',
    2807             0x08 => '- 0 +',
     2821            0 => '+ 0 -',
     2822            1 => '- 0 +',
    28082823        },
    28092824    },
     
    28112826        Name => 'PhotoInfoPlayback',
    28122827        Mask => 0x04,
    2813         PrintConv => { 0x00 => 'Off', 0x04 => 'On' },
     2828        PrintConv => \%offOn,
    28142829    },
    28152830    33.7 => { # CSf11
     
    28172832        Mask => 0x02,
    28182833        PrintConv => {
    2819             0x00 => 'Release Locked',
    2820             0x02 => 'Enable Release',
     2834            0 => 'Release Locked',
     2835            1 => 'Enable Release',
    28212836        },
    28222837    },
     
    28242839        Name => 'ReleaseButtonToUseDial',
    28252840        Mask => 0x01,
    2826         PrintConv => { 0x00 => 'No', 0x01 => 'Yes' },
     2841        PrintConv => \%noYes,
     2842    },
     2843);
     2844
     2845# D800 custom settings (ref PH)
     2846%Image::ExifTool::NikonCustom::SettingsD800 = (
     2847    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     2848    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     2849    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     2850    WRITABLE => 1,
     2851    FIRST_ENTRY => 0,
     2852    DATAMEMBER => [ 23.1 ],
     2853    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     2854    NOTES => 'Custom settings for the D800 and D800E.',
     2855    12.1 => { # CSe5
     2856        Name => 'AutoBracketingSet',
     2857        Mask => 0xe0, #(NC)
     2858        PrintConv => {
     2859            0 => 'AE & Flash', # default
     2860            1 => 'AE Only', #(NC)
     2861            2 => 'Flash Only',
     2862            3 => 'WB Bracketing', #(NC)
     2863            4 => 'Active D-Lighting', #(NC)
     2864        },
     2865    },
     2866    12.2 => { # CSe7
     2867        Name => 'AutoBracketOrder',
     2868        Mask => 0x10,
     2869        PrintConv => {
     2870            0 => '0,-,+',
     2871            1 => '-,0,+',
     2872        },
     2873    },
     2874    12.3 => { # CSe6
     2875        Name => 'AutoBracketingMode',
     2876        Mask => 0x0c,
     2877        PrintConv => {
     2878            0 => 'Flash/Speed',
     2879            1 => 'Flash/Speed/Aperture',
     2880            2 => 'Flash/Aperture',
     2881            3 => 'Flash Only',
     2882        },
     2883    },
     2884    # 21 - 100 (MaxContinuousRelease?)
     2885    22.1 => { # CSe1
     2886        Name => 'FlashSyncSpeed',
     2887        Mask => 0xf0,
     2888        PrintConv => {
     2889            0 => '1/320 s (auto FP)',
     2890            1 => '1/250 s (auto FP)',
     2891            2 => '1/250 s',
     2892            3 => '1/200 s',
     2893            4 => '1/160 s',
     2894            5 => '1/125 s',
     2895            6 => '1/100 s',
     2896            7 => '1/80 s',
     2897            8 => '1/60 s',
     2898       },
     2899    },
     2900    22.2 => { # CSe2
     2901        Name => 'FlashShutterSpeed',
     2902        Mask => 0x0f,
     2903        PrintConvColumns => 2,
     2904        PrintConv => {
     2905            0 => '1/60 s',
     2906            1 => '1/30 s',
     2907            2 => '1/15 s',
     2908            3 => '1/8 s',
     2909            4 => '1/4 s',
     2910            5 => '1/2 s',
     2911            6 => '1 s',
     2912            7 => '2 s',
     2913            8 => '4 s',
     2914            9 => '8 s',
     2915            10 => '15 s',
     2916            11 => '30 s',
     2917        },
     2918    },
     2919    23.1 => { # CSe3
     2920        Name => 'FlashControlBuilt-in',
     2921        Mask => 0xc0,
     2922        RawConv => '$$self{FlashControlBuiltin} = $val',
     2923        PrintConv => {
     2924            0 => 'TTL',
     2925            1 => 'Manual',
     2926            2 => 'Repeating Flash',
     2927            3 => 'Commander Mode',
     2928        },
     2929    },
     2930    23.2 => { # CSe3-b
     2931        Name => 'ManualFlashOutput',
     2932        Condition => '$$self{FlashControlBuiltin} == 1',
     2933        Mask => 0x1f,
     2934        ValueConv => '2 ** (-$val/3)',
     2935        ValueConvInv => '$val > 0 ? -3*log($val)/log(2) : 0',
     2936        PrintConv => q{
     2937            return 'Full' if $val > 0.99;
     2938            Image::ExifTool::Exif::PrintExposureTime($val);
     2939        },
     2940        PrintConvInv => '$val=~/F/i ? 1 : Image::ExifTool::Exif::ConvertFraction($val)',
     2941    },
     2942    24.1 => { # CSe3-ca
     2943        Name => 'RepeatingFlashOutput',
     2944        Condition => '$$self{FlashControlBuiltin} == 2',
     2945        Mask => 0x70,
     2946        ValueConv => '2 ** (-$val-2)',
     2947        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5) : 0',
     2948        PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
     2949        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     2950    },
     2951    24.2 => { # CSe3-cb
     2952        Name => 'RepeatingFlashCount',
     2953        Condition => '$$self{FlashControlBuiltin} == 2',
     2954        Mask => 0x0f,
     2955        ValueConv => '$val < 10 ? $val + 1 : 5 * ($val - 7)',
     2956        ValueConvInv => '$val <= 10 ? $val - 1 : $val / 5 + 7',
     2957    },
     2958    25.1 => { # CSe3-cc
     2959        Name => 'RepeatingFlashRate',
     2960        Condition => '$$self{FlashControlBuiltin} == 2',
     2961        Mask => 0xf0,
     2962        ValueConv => '$val < 10 ? $val + 1 : 10 * ($val - 8)',
     2963        ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5)',
     2964        PrintConv => '"$val Hz"',
     2965        PrintConvInv => '$val=~/(\d+)/; $1 || 0',
     2966    },
     2967    25.2 => { # CSe3
     2968        Name => 'CommanderChannel',
     2969        Mask => 0x03,
     2970        ValueConv => '$val + 1',
     2971        ValueConvInv => '$val - 1',
     2972    },
     2973    27.1 => { # CSe3
     2974        Name => 'CommanderInternalFlash',
     2975        Mask => 0xc0,
     2976        PrintConv => {
     2977            0 => 'TTL',
     2978            1 => 'Manual',
     2979            2 => 'Off',
     2980        },
     2981    },
     2982    27.2 => { # CSe3
     2983        Name => 'CommanderInternalManualOutput',
     2984        Mask => 0x1f,
     2985        ValueConv => '2 ** (-$val/3)',
     2986        ValueConvInv => '$val > 0 ? int(-log($val)/log(2) * 3 + 0.5): 0',
     2987        PrintConv => q{
     2988            return 'Full' if $val > 0.99;
     2989            Image::ExifTool::Exif::PrintExposureTime($val);
     2990        },
     2991        PrintConvInv => '$val=~/F/i ? 1 : Image::ExifTool::Exif::ConvertFraction($val)',
     2992    },
     2993    28.1 => { # CSe3
     2994        Name => 'CommanderGroupAMode',
     2995        Mask => 0xc0,
     2996        PrintConv => {
     2997            0 => 'TTL',
     2998            1 => 'Auto Aperture',
     2999            2 => 'Manual',
     3000            3 => 'Off',
     3001        },
     3002    },
     3003    28.2 => { # CSe3
     3004        Name => 'CommanderGroupAManualOutput',
     3005        Mask => 0x1f,
     3006        ValueConv => '2 ** (-$val/3)',
     3007        ValueConvInv => '$val > 0 ? int(-log($val)/log(2) * 3 + 0.5): 0',
     3008        PrintConv => q{
     3009            return 'Full' if $val > 0.99;
     3010            Image::ExifTool::Exif::PrintExposureTime($val);
     3011        },
     3012        PrintConvInv => '$val=~/F/i ? 1 : Image::ExifTool::Exif::ConvertFraction($val)',
     3013    },
     3014    29.1 => { # CSe3
     3015        Name => 'CommanderGroupBMode',
     3016        Mask => 0xc0,
     3017        PrintConv => {
     3018            0 => 'TTL',
     3019            1 => 'Auto Aperture',
     3020            2 => 'Manual',
     3021            3 => 'Off',
     3022        },
     3023    },
     3024    29.2 => { # CSe3
     3025        Name => 'CommanderGroupBManualOutput',
     3026        Mask => 0x1f,
     3027        ValueConv => '2 ** (-$val/3)',
     3028        ValueConvInv => '$val > 0 ? int(-log($val)/log(2) * 3 + 0.5): 0',
     3029        PrintConv => q{
     3030            return 'Full' if $val > 0.99;
     3031            Image::ExifTool::Exif::PrintExposureTime($val);
     3032        },
     3033        PrintConvInv => '$val=~/F/i ? 1 : Image::ExifTool::Exif::ConvertFraction($val)',
     3034    },
     3035    30.1 => { # CSe4
     3036        Name => 'ModelingFlash',
     3037        Mask => 0x20,
     3038        PrintConv => \%onOff,
     3039    },
     3040    30.2 => { # CSe3
     3041        Name => 'CommanderInternalTTLComp',
     3042        Mask => 0x1f,
     3043        ValueConv => '($val - 9) / 3',
     3044        ValueConvInv => '$val * 3 + 9',
     3045        PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
     3046        PrintConvInv => '$val',
     3047    },
     3048    31.1 => { # CSe3
     3049        Name => 'CommanderGroupA_TTL-AAComp',
     3050        Mask => 0x1f,
     3051        ValueConv => '($val - 9) / 3',
     3052        ValueConvInv => '$val * 3 + 9',
     3053        PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
     3054        PrintConvInv => '$val',
     3055    },
     3056    32.1 => { # CSe3
     3057        Name => 'CommanderGroupB_TTL-AAComp',
     3058        Mask => 0x1f,
     3059        ValueConv => '($val - 9) / 3',
     3060        ValueConvInv => '$val * 3 + 9',
     3061        PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
     3062        PrintConvInv => '$val',
     3063    },
     3064    # 47 - related to flash
     3065);
     3066
     3067# D5 custom settings (ref 1)
     3068%Image::ExifTool::NikonCustom::SettingsD5 = (
     3069    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     3070    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     3071    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     3072    WRITABLE => 1,
     3073    FIRST_ENTRY => 0,
     3074    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     3075    NOTES => 'Custom settings for the D5.',
     3076    0.1 => {
     3077        Name => 'CustomSettingsBank',
     3078        Mask => 0x03,
     3079        PrintConv => {
     3080            0 => 'A',
     3081            1 => 'B',
     3082            2 => 'C',
     3083            3 => 'D',
     3084        },
     3085    },
     3086    1.1 => { # CSa1
     3087        Name => 'AF-CPrioritySelection',
     3088        Mask => 0xc0,
     3089        PrintConv => {
     3090            0 => 'Release',
     3091            1 => 'Release + Focus',
     3092            2 => 'Focus',
     3093            3 => 'Focus + Release',
     3094        },
     3095    },
     3096    1.2 => { # CSa2
     3097        Name => 'AF-SPrioritySelection',
     3098        Mask => 0x20,
     3099        PrintConv => {
     3100            0 => 'Focus',
     3101            1 => 'Release',
     3102        },
     3103    },
     3104    1.3 => { # CSa6
     3105        Name => 'NumberOfFocusPoints',
     3106        Mask => 0x10,
     3107        PrintConv => {
     3108            0 => '55 Points',
     3109            1 => '15 Points',
     3110        },
     3111    },
     3112    1.4 => { # CSa4
     3113        Name => 'Three-DTrackingFaceDetection',
     3114        Mask => 0x08,
     3115        PrintConv => {
     3116            0 => 'Off',
     3117            1 => 'On',
     3118        },
     3119    },
     3120    1.5 => { # CSa3-a
     3121        Name => 'BlockShotAFResponse',
     3122        Mask => 0x07,
     3123        #values 1-5
     3124    },
     3125    2.1 => { # CSa11
     3126        Name => 'FocusPointWrap',
     3127        Mask => 0x08,
     3128        PrintConv => {
     3129            0 => 'No Wrap',
     3130            1 => 'Wrap',
     3131        },
     3132    },
     3133    2.2 => { # CSa12-d
     3134        Name => 'AFPointBrightness',
     3135        Mask => 0x06,
     3136        PrintConv => {
     3137            0 => 'Auto',
     3138            1 => 'On',
     3139            2 => 'Off',
     3140        },
     3141    },
     3142    4.1 => { # CSd3
     3143        Name => 'ISODisplay',
     3144        Mask => 0x08,
     3145        PrintConv => {
     3146            0 => 'Show ISO Sensitivity',
     3147            1 => 'Show Frame Count',
     3148        },
     3149    },
     3150    4.2 => { # CSd8
     3151        Name => 'GridDisplay',
     3152        Mask => 0x02,
     3153        PrintConv => \%onOff,
     3154    },
     3155    5.1 => { # CSd9
     3156        Name => 'LCDIllumination',
     3157        Mask => 0x20,
     3158        PrintConv => \%offOn,
     3159    },
     3160    5.2 => { # CSd6
     3161        Name => 'ElectronicFront-CurtainShutter',
     3162        Mask => 0x08,
     3163        PrintConv => \%offOn,
     3164    },
     3165    6.1 => { # CSf7
     3166        Name => 'ReverseIndicators',
     3167        Mask => 0x80,
     3168        PrintConv => {
     3169            0 => '+ 0 -',
     3170            1 => '- 0 +',
     3171        },
     3172    },
     3173    6.2 => { # CSf4-a
     3174        Name => 'CommandDialsReverseRotation',
     3175        Mask => 0x18,
     3176        PrintConv => {
     3177            0 => 'No',
     3178            1 => 'Shutter Speed & Aperture',
     3179            2 => 'Exposure Compensation',
     3180            3 => 'Exposure Compensation, Shutter Speed & Aperture',
     3181        },
     3182    },
     3183    6.3 => { # CSb4
     3184        Name => 'EasyExposureCompensation',
     3185        Mask => 0x03,
     3186        PrintConv => {
     3187            0 => 'Off',
     3188            1 => 'On',
     3189            2 => 'On (auto reset)',
     3190        },
     3191    },
     3192    7.1 => { # CSb2
     3193        Name => 'ExposureControlStepSize',
     3194        Mask => 0xc0,
     3195        PrintConv => {
     3196            0 => '1/3 EV',
     3197            1 => '1/2 EV',
     3198            2 => '1 EV',
     3199        },
     3200    },
     3201    7.2 => { # CSb1
     3202        Name => 'ISOStepSize',
     3203        Mask => 0x30,
     3204        PrintConv => {
     3205            0 => '1/3 EV',
     3206            1 => '1/2 EV',
     3207            2 => '1 EV',
     3208        },
     3209    },
     3210    7.3 => { # CSb3
     3211        Name => 'ExposureCompStepSize',
     3212        Mask => 0x0c,
     3213        PrintConv => {
     3214            0 => '1/3 EV',
     3215            1 => '1/2 EV',
     3216            2 => '1 EV',
     3217        },
     3218    },
     3219    8.1 => { # CSb6
     3220        Name => 'CenterWeightedAreaSize',
     3221        Mask => 0xe0,
     3222        PrintConv => {
     3223            0 => '8 mm',
     3224            1 => '12 mm',
     3225            2 => '15 mm',
     3226            3 => '20 mm',
     3227            4 => 'Average',
     3228        },
     3229    },
     3230    8.2 => { # CSb7-a
     3231        Name => 'FineTuneOptMatrixMetering',
     3232        Mask => 0x0f,
     3233        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     3234        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     3235        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     3236        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     3237    },
     3238    9.1 => { # CSb7-b
     3239        Name => 'FineTuneOptCenterWeighted',
     3240        Mask => 0xf0,
     3241        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     3242        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     3243        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     3244        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     3245    },
     3246    9.2 => { # CSb7-c
     3247        Name => 'FineTuneOptSpotMetering',
     3248        Mask => 0x0f,
     3249        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     3250        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     3251        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     3252        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     3253    },
     3254    10.1 => { # CSf2-a
     3255        Name => 'MultiSelectorShootMode',
     3256        Mask => 0xe0,
     3257        PrintConv => {
     3258            0 => 'Select Center Focus Point (Reset)',
     3259            1 => 'Zoom On/Off',  # this is the documented (and actual) default value, but the choice does not appear on the camera menu
     3260            2 => 'Preset Focus Point (Pre)',
     3261            4 => 'Not Used (None)',
     3262        },
     3263    },
     3264#    10.2 => { # CSf2-b             # moved from the D500 position to Nikon_ShotInfoD5_0x0ab1 with the Mask and PrintConv as specified below.  Further research required.
     3265#        Name => 'MultiSelectorPlaybackMode',
     3266#        Mask => 0x70,
     3267#        PrintConv => {
     3268#            0 => 'Zoom On/Off',
     3269#            1 => 'Choose Folder',
     3270#            6 => 'Thumbnail On/Off',
     3271#            7 => 'View Histograms',
     3272#        },
     3273#    },
     3274    10.3 => { # CSf5
     3275        Name => 'MultiSelector',
     3276        Mask => 0x01,
     3277        PrintConv => {
     3278            0 => 'Do Nothing',
     3279            1 => 'Reset Meter-off Delay',
     3280        },
     3281    },
     3282    11.1 => { # CSd5
     3283        Name => 'ExposureDelayMode',
     3284        Mask => 0xc0,
     3285        PrintConv => {
     3286            0 => 'Off',
     3287            1 => '1 s',
     3288            2 => '2 s',
     3289            3 => '3 s',
     3290        },
     3291    },
     3292    11.2 => { # CSd1
     3293        Name => 'CLModeShootingSpeed',
     3294        Mask => 0x0f,
     3295        PrintConv => '"$val fps"',
     3296        PrintConvInv => '$val=~s/\s*fps//i; $val',
     3297    },
     3298    12.1 => { # CSd2
     3299        Name => 'MaxContinuousRelease',
     3300        # values: 1-100
     3301    },
     3302    13.1 => { # CSe7
     3303        Name => 'AutoBracketOrder',
     3304        Mask => 0x10,
     3305        PrintConv => {
     3306            0 => '0,-,+',
     3307            1 => '-,0,+',
     3308        },
     3309    },
     3310    13.2 => { # CSe6
     3311        Name => 'AutoBracketModeM',
     3312        Mask => 0x0c,
     3313        PrintConv => {
     3314            0 => 'Flash/Speed',
     3315            1 => 'Flash/Speed/Aperture',
     3316            2 => 'Flash/Aperture',
     3317            3 => 'Flash Only',
     3318        },
     3319    },
     3320    14.1 => { # CSf1-c
     3321        Name => 'Func1Button',
     3322        Mask => 0x3f,
     3323        PrintConv => {
     3324            0 => 'None',
     3325            1 => 'Preview',
     3326            2 => 'FV Lock',
     3327            3 => 'AE/AF Lock',
     3328            4 => 'AE Lock Only',
     3329            5 => 'AE Lock (reset on release)',
     3330            6 => 'AE Lock (hold)',
     3331            7 => 'AF Lock Only',
     3332            8 => 'AF-On',
     3333            10 => 'Bracketing Burst',
     3334            11 => 'Matrix Metering',
     3335            12 => 'Center-weighted Metering',
     3336            13 => 'Spot Metering',
     3337            14 => 'Playback',
     3338            15 => 'My Menu Top Item',
     3339            16 => '+NEF(RAW)',
     3340            17 => 'Virtual Horizon',
     3341            19 => 'Grid Display',
     3342            20 => 'My Menu',
     3343            21 => 'Disable Synchronized Release',
     3344            22 => 'Remote Release Only',
     3345            26 => 'Flash Disable/Enable',
     3346            27 => 'Highlight-weighted Metering',
     3347            36 => 'AF-Area Mode (Single)',
     3348            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     3349            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     3350            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     3351            40 => 'AF-Area Mode (Group Area AF)',
     3352            41 => 'AF-Area Mode (Auto Area AF)',
     3353            42 => 'AF-Area Mode + AF-On (Single)',
     3354            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     3355            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     3356            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     3357            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     3358            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     3359            49 => 'Sync Release (Master Only)',
     3360            50 => 'Sync Release (Remote Only)',
     3361        },
     3362    },
     3363    15.1 => { # CSf1-a
     3364        Name => 'PreviewButton',
     3365        Mask => 0x3f,
     3366        PrintConv => {
     3367            0 => 'None',
     3368            1 => 'Preview',
     3369            2 => 'FV Lock',
     3370            3 => 'AE/AF Lock',
     3371            4 => 'AE Lock Only',
     3372            5 => 'AE Lock (reset on release)',
     3373            6 => 'AE Lock (hold)',
     3374            7 => 'AF Lock Only',
     3375            8 => 'AF-On',
     3376            10 => 'Bracketing Burst',
     3377            11 => 'Matrix Metering',
     3378            12 => 'Center-weighted Metering',
     3379            13 => 'Spot Metering',
     3380            14 => 'Playback',
     3381            15 => 'My Menu Top Item',
     3382            16 => '+NEF(RAW)',
     3383            17 => 'Virtual Horizon',
     3384            19 => 'Grid Display',
     3385            20 => 'My Menu',
     3386            21 => 'Disable Synchronized Release',
     3387            22 => 'Remote Release Only',
     3388            26 => 'Flash Disable/Enable',
     3389            27 => 'Highlight-weighted Metering',
     3390            36 => 'AF-Area Mode (Single)',
     3391            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     3392            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     3393            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     3394            40 => 'AF-Area Mode (Group Area AF)',
     3395            41 => 'AF-Area Mode (Auto Area AF)',
     3396            42 => 'AF-Area Mode + AF-On (Single)',
     3397            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     3398            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     3399            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     3400            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     3401            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     3402            49 => 'Sync Release (Master Only)',
     3403            50 => 'Sync Release (Remote Only)',
     3404        },
     3405    },
     3406    16.1 => { # CSf1-p
     3407        Name => 'AssignBktButton',
     3408        Mask => 0x07,
     3409        PrintConv => {
     3410            0 => 'Auto Bracketing',
     3411            1 => 'Multiple Exposure',
     3412            2 => 'HDR (high dynamic range)',
     3413            3 => 'None',
     3414        },
     3415    },
     3416    18.1 => { # CSf4-b
     3417        Name => 'CommandDialsChangeMainSub',
     3418        Mask => 0xe0,
     3419        PrintConv => {
     3420            0 => 'Autofocus Off, Exposure Off',
     3421            1 => 'Autofocus Off, Exposure On',
     3422            2 => 'Autofocus Off, Exposure On (Mode A)',
     3423            4 => 'Autofocus On, Exposure Off',
     3424            5 => 'Autofocus On, Exposure On',
     3425            6 => 'Autofocus On, Exposure On (Mode A)',
     3426        },
     3427    },
     3428    18.2 => { # CSf4-d
     3429        Name => 'CommandDialsMenuAndPlayback',
     3430        Mask => 0x18,
     3431        PrintConv => {
     3432            0 => 'On',
     3433            1 => 'Off',
     3434            2 => 'On (Image Review Excluded)',
     3435        },
     3436    },
     3437    18.3 => { # CSf4-c
     3438        Name => 'CommandDialsApertureSetting',
     3439        Mask => 0x04,
     3440        PrintConv => {
     3441            0 => 'Sub-command Dial',
     3442            1 => 'Aperture Ring',
     3443        },
     3444    },
     3445    18.4 => { # CSf6
     3446        Name => 'ReleaseButtonToUseDial',
     3447        Mask => 0x01,
     3448        PrintConv => \%noYes,
     3449    },
     3450    19.1 => { # CSc2
     3451        Name => 'StandbyTimer',
     3452        Mask => 0xf0,
     3453        PrintConv => {
     3454            0 => '4 s',
     3455            1 => '6 s',
     3456            3 => '10 s',
     3457            5 => '30 s',
     3458            6 => '1 min',
     3459            7 => '5 min',
     3460            8 => '10 min',
     3461            9 => '30 min',
     3462            10 => 'No Limit',
     3463        },
     3464    },
     3465    20.1 => { # CSc3-a
     3466        Name => 'SelfTimerTime',
     3467        Mask => 0xc0,
     3468        PrintConv => {
     3469            0 => '2 s',
     3470            1 => '5 s',
     3471            2 => '10 s',
     3472            3 => '20 s',
     3473        },
     3474    },
     3475    20.2 => { # CSc3-c
     3476        Name => 'SelfTimerShotInterval',
     3477        Mask => 0x30,
     3478        PrintConv => {
     3479            0 => '0.5 s',
     3480            1 => '1 s',
     3481            2 => '2 s',
     3482            3 => '3 s',
     3483        },
     3484    },
     3485    20.3 => { # CSc3-b
     3486        Name => 'SelfTimerShotCount',
     3487        Mask => 0x0f,
     3488    },
     3489    21.1 => { # CSc4-d
     3490        Name => 'ImageReviewMonitorOffTime',
     3491        Mask => 0xe0,
     3492        PrintConv => {
     3493            0 => '2 s',
     3494            1 => '4 s',
     3495            3 => '10 s',
     3496            4 => '20 s',
     3497            5 => '1 min',
     3498            6 => '5 min',
     3499            7 => '10 min',
     3500        },
     3501    },
     3502    21.2 => { # CSc4-e
     3503        Name => 'LiveViewMonitorOffTime',
     3504        Mask => 0x1c,
     3505        PrintConv => {
     3506            1 => '5 min',
     3507            2 => '10 min',
     3508            3 => '15 min',
     3509            4 => '20 min',
     3510            5 => '30 min',
     3511            6 => 'No Limit',
     3512        },
     3513    },
     3514    22.1 => { # CSc4-b
     3515        Name => 'MenuMonitorOffTime',
     3516        Mask => 0xe0,
     3517        PrintConv => {
     3518            0 => '4 s',
     3519            2 => '10 s',
     3520            4 => '20 s',
     3521            5 => '1 min',
     3522            6 => '5 min',
     3523            7 => '10 min',
     3524        },
     3525    },
     3526    22.2 => { # CSc4-c
     3527        Name => 'ShootingInfoMonitorOffTime',
     3528        Mask => 0x1c,
     3529        PrintConv => {
     3530            0 => '4 s',
     3531            2 => '10 s',
     3532            4 => '20 s',
     3533            5 => '1 min',
     3534            6 => '5 min',
     3535            7 => '10 min',
     3536        },
     3537    },
     3538    23.1 => { # CSe1
     3539        Name => 'FlashSyncSpeed',
     3540        Mask => 0xf0,
     3541        PrintConv => {
     3542            2 => '1/250 s (auto FP)',
     3543            3 => '1/250 s',
     3544            5 => '1/200 s',
     3545            6 => '1/160 s',
     3546            7 => '1/125 s',
     3547            8 => '1/100 s',
     3548            9 => '1/80 s',
     3549            10 => '1/60 s',
     3550        },
     3551    },
     3552    23.2 => { # CSe2
     3553        Name => 'FlashShutterSpeed',
     3554        Mask => 0x0f,
     3555        PrintConvColumns => 2,
     3556        PrintConv => {
     3557            0 => '1/60 s',
     3558            1 => '1/30 s',
     3559            2 => '1/15 s',
     3560            3 => '1/8 s',
     3561            4 => '1/4 s',
     3562            5 => '1/2 s',
     3563            6 => '1 s',
     3564            7 => '2 s',
     3565            8 => '4 s',
     3566            9 => '8 s',
     3567            10 => '15 s',
     3568            11 => '30 s',
     3569        },
     3570    },
     3571    31.1 => { # CSe5
     3572        Name => 'ModelingFlash',
     3573        Mask => 0x20,
     3574        PrintConv => \%onOff,
     3575    },
     3576    36.1 => { # CSc4-a
     3577        Name => 'PlaybackMonitorOffTime',
     3578        Mask => 0xe0,
     3579        PrintConv => {
     3580            0 => '4 s',
     3581            1 => '10 s',
     3582            2 => '20 s',
     3583            3 => '1 min',
     3584            4 => '5 min',
     3585            5 => '10 min',
     3586        },
     3587    },
     3588    37.1 => { # CSf2-c
     3589        Name => 'MultiSelectorLiveView',
     3590        Mask => 0xc0,
     3591        PrintConv => {
     3592            0 => 'Reset',
     3593            1 => 'Zoom',
     3594            3 => 'Not Used',
     3595        },
     3596    },
     3597    38.1 => { # CSf3-a
     3598        Name => 'ShutterSpeedLock',
     3599        Mask => 0x80,
     3600        PrintConv => \%offOn,
     3601    },
     3602    38.2 => { # CSf3-b
     3603        Name => 'ApertureLock',
     3604        Mask => 0x40,
     3605        PrintConv => \%offOn,
     3606    },
     3607    38.3 => { # CSg1-h
     3608        Name => 'MovieShutterButton',
     3609        Mask => 0x10,
     3610        PrintConv => {
     3611            0 => 'Take Photo',
     3612            1 => 'Record Movies',
     3613        },
     3614    },
     3615    38.4 => { # CSe3
     3616        Name => 'FlashExposureCompArea',
     3617        Mask => 0x04,
     3618        PrintConv => {
     3619            0 => 'Entire Frame',
     3620            1 => 'Background Only',
     3621        },
     3622    },
     3623    38.5 => { # CSe4
     3624        Name => 'AutoFlashISOSensitivity',
     3625        Mask => 0x02,
     3626        PrintConv => {
     3627            0 => 'Subject and Background',
     3628            1 => 'Subject Only',
     3629        },
     3630    },
     3631    41.1 => { # CSg1-c
     3632        Name => 'MovieFunc1Button',
     3633        Mask => 0xf0,
     3634        PrintConv => {
     3635            0 => 'None',
     3636            2 => 'Power Aperture (close)',
     3637            3 => 'Index Marking',
     3638            4 => 'View Photo Shooting Info',
     3639            11 => 'Exposure Compensation -',
     3640        },
     3641    },
     3642    41.2 => { # CSg1-a
     3643        Name => 'MoviePreviewButton',
     3644        Mask => 0x0f,
     3645        PrintConv => {
     3646            0 => 'None',
     3647            1 => 'Power Aperture (open)',
     3648            3 => 'Index Marking',
     3649            4 => 'View Photo Shooting Info',
     3650            10 => 'Exposure Compensation +',
     3651        },
     3652    },
     3653    42.1 => { # CSf1-d
     3654        Name => 'Func1ButtonPlusDials',
     3655        Mask => 0x0f,
     3656        PrintConv => {
     3657            0 => 'None',
     3658            1 => 'Choose Image Area',
     3659            2 => 'Shutter Speed & Aperture Lock',
     3660            3 => 'One Step Speed / Aperture',
     3661            4 => 'Choose Non-CPU Lens Number',
     3662            5 => 'Active D-Lighting',
     3663            7 => 'Photo Shooting Menu Bank',
     3664            8 => 'Exposure Delay Mode',
     3665        },
     3666    },
     3667    43.1 => { # CSf1-b
     3668        Name => 'PreviewButtonPlusDials',
     3669        Mask => 0x0f,
     3670        PrintConv => {
     3671            0 => 'None',
     3672            1 => 'Choose Image Area',
     3673            2 => 'Shutter Speed & Aperture Lock',
     3674            3 => 'One Step Speed / Aperture',
     3675            4 => 'Choose Non-CPU Lens Number',
     3676            5 => 'Active D-Lighting',
     3677            7 => 'Photo Shooting Menu Bank',    # new with D500
     3678            8 => 'Exposure Delay Mode',
     3679        },
     3680    },
     3681    45.1 => { # CSf1-q
     3682        Name => 'AssignMovieRecordButtonPlusDials',
     3683        Mask => 0x0f,
     3684        PrintConv => {
     3685            0 => 'None',
     3686            1 => 'Choose Image Area',
     3687            2 => 'Shutter Speed & Aperture Lock',
     3688            7 => 'Photo Shooting Menu Bank',
     3689            11 => 'Exposure Mode',
     3690        },
     3691    },
     3692    46.1 => { # CSb7-d
     3693        Name => 'FineTuneOptHighlightWeighted',
     3694        Mask => 0x0f,
     3695        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     3696        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     3697        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     3698        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     3699    },
     3700    47.1 => { # CSa12-b
     3701        Name => 'DynamicAreaAFDisplay',
     3702        Mask => 0x80,
     3703        PrintConv => \%offOn,
     3704    },
     3705    47.2 => { # CSa12-a
     3706        Name => 'AFPointIllumination',
     3707        Mask => 0x40,
     3708        PrintConv => {
     3709            0 => 'Off',
     3710            1 => 'On During Manual Focusing',
     3711        },
     3712    },
     3713    47.3 => { # CSa7
     3714        Name => 'StoreByOrientation',
     3715        Mask => 0x18,
     3716        PrintConv => {
     3717            0 => 'Off',
     3718            1 => 'Focus Point',
     3719            2 => 'Focus Point and AF-area Mode',
     3720        },
     3721    },
     3722    48.1 => { # CSb5
     3723        Name => 'MatrixMetering',
     3724        Mask => 0x80,
     3725        PrintConv => {
     3726            0 => 'Face Detection On',
     3727            1 => 'Face Detection Off',
     3728        },
     3729    },
     3730    48.2 => { # CSf8
     3731        Name => 'LiveViewButtonOptions',
     3732        Mask => 0x30,
     3733        PrintConv => {
     3734            0 => 'Enable',
     3735            1 => 'Enable (Standby Timer Active)',    # new with D500
     3736            2 => 'Disable',
     3737        },
     3738    },
     3739    48.3 => { # CSa10
     3740        Name => 'AFModeRestrictions',
     3741        Mask => 0x03,
     3742        PrintConv => {
     3743            0 => 'No Restrictions',
     3744            1 => 'AF-C',
     3745            2 => 'AF-S',
     3746        },
     3747    },
     3748    49.1 => { # CSa9
     3749        Name => 'LimitAFAreaModeSelection',
     3750        Mask => 0x7e,
     3751        PrintConv => {
     3752            0 => 'No Restrictions',
     3753            BITMASK => {
     3754                0 => 'Auto-area',
     3755                1 => 'Group-area',
     3756                2 => '3D-tracking',
     3757                3 => 'Dynamic area (153 points)',
     3758                4 => 'Dynamic area (72 points)',
     3759                5 => 'Dynamic area (25 points)',
     3760            },
     3761        },
     3762    },
     3763    52.1 => { # CSf1-r
     3764        Name => 'LensFocusFunctionButtons',
     3765        Mask => 0x3f,
     3766        PrintConv => {
     3767            3 => 'AE/AF Lock',
     3768            4 => 'AE Lock Only',
     3769            7 => 'AF Lock Only',
     3770            8 => 'AF-On',
     3771            24 => 'Preset Focus Point',
     3772            26 => 'Flash Disable/Enable',
     3773            36 => 'AF-Area Mode (Single)',
     3774            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     3775            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     3776            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     3777            40 => 'AF-Area Mode (Group Area AF)',
     3778            41 => 'AF-Area Mode (Auto Area AF)',
     3779            42 => 'AF-Area Mode + AF-On (Single)',
     3780            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     3781            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     3782            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     3783            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     3784            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     3785            49 => 'Sync Release (Master Only)',
     3786            50 => 'Sync Release (Remote Only)',
     3787        },
     3788    },
     3789    66.1 => { # CSf1-o
     3790        Name => 'VerticalMultiSelector',
     3791        Mask => 0xff,
     3792        PrintHex => 1,
     3793        PrintConv => {
     3794            0x00 => 'Same as Multi-Selector with Info(U/D) & Playback(R/L)',
     3795            0x08 => 'Same as Multi-Selector with Info(R/L) & Playback(U/D)',
     3796            0x80 => 'Focus Point Selection',
     3797        },
     3798    },
     3799    67.1 => { # CSf1-g
     3800        Name => 'VerticalFuncButton',
     3801        Mask => 0x3f,
     3802        PrintConv => {
     3803            0 => 'None',
     3804            1 => 'Preview',
     3805            2 => 'FV Lock',
     3806            3 => 'AE/AF Lock',
     3807            4 => 'AE Lock Only',
     3808            5 => 'AE Lock (reset on release)',
     3809            6 => 'AE Lock (hold)',
     3810            7 => 'AF Lock Only',
     3811            8 => 'AF-On',
     3812            10 => 'Bracketing Burst',
     3813            11 => 'Matrix Metering',
     3814            12 => 'Center-weighted Metering',
     3815            13 => 'Spot Metering',
     3816            14 => 'Playback',
     3817            15 => 'My Menu Top Item',
     3818            16 => '+NEF(RAW)',
     3819            17 => 'Virtual Horizon',
     3820            18 => 'Reset Focus Point',
     3821            19 => 'Grid Display',
     3822            20 => 'My Menu',
     3823            22 => 'Remote Release Only',
     3824            23 => 'Preset Focus Point',
     3825            26 => 'Flash Disable/Enable',
     3826            27 => 'Highlight-weighted Metering',
     3827            36 => 'AF-Area Mode (Single)',
     3828            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     3829            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     3830            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     3831            40 => 'AF-Area Mode (Group Area AF)',
     3832            41 => 'AF-Area Mode (Auto Area AF)',
     3833            42 => 'AF-Area Mode + AF-On (Single)',
     3834            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     3835            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     3836            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     3837            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     3838            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     3839            49 => 'Sync Release (Master Only)',
     3840            50 => 'Sync Release (Remote Only)',
     3841            54 => 'Highlight Active Focus Point',
     3842        },
     3843    },
     3844    68.1 => { # CSf1-h
     3845        Name => 'VerticalFuncPlusDials',
     3846        Mask => 0x0f,
     3847        PrintConv => {
     3848            0 => 'None',
     3849            1 => 'Choose Image Area',
     3850            2 => 'Shutter Speed & Aperture Lock',
     3851            3 => 'One Step Speed / Aperture',
     3852            4 => 'Choose Non-CPU Lens Number',
     3853            5 => 'Active D-Lighting',
     3854            7 => 'Photo Shooting Menu Bank',
     3855            8 => 'Exposure Delay Mode',
     3856            10 => 'ISO Sensitivity',
     3857            11 => 'Exposure Mode',
     3858            12 => 'Exposure Compensation',
     3859            13 => 'Metering',
     3860        },
     3861    },
     3862    70.1 => { # CSf1-j
     3863        Name => 'AF-OnButton',
     3864        Mask => 0x3f,
     3865        PrintConv => {
     3866            0 => 'None',
     3867            3 => 'AE/AF Lock',
     3868            4 => 'AE Lock Only',
     3869            5 => 'AE Lock (reset on release)',
     3870            6 => 'AE Lock (hold)',
     3871            7 => 'AF Lock Only',
     3872            8 => 'AF-On',
     3873            36 => 'AF-Area Mode (Single)',
     3874            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     3875            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     3876            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     3877            40 => 'AF-Area Mode (Group Area AF)',
     3878            41 => 'AF-Area Mode (Auto Area AF)',
     3879            42 => 'AF-Area Mode + AF-On (Single)',
     3880            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     3881            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     3882            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     3883            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     3884            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     3885        },
     3886    },
     3887    71.1 => { # CSf1-k
     3888        Name => 'SubSelector',
     3889        Mask => 0x80,
     3890        PrintConv => {
     3891            0 => 'Focus Point Selection',
     3892            1 => 'Same as MultiSelector',
     3893        },
     3894    },
     3895    72.1 => { # CSf1-l
     3896        Name => 'SubSelectorCenter',
     3897        Mask => 0x3f,
     3898        PrintConv => {
     3899            0 => 'None',
     3900            1 => 'Preview',
     3901            2 => 'FV Lock',
     3902            3 => 'AE/AF Lock',
     3903            4 => 'AE Lock Only',
     3904            5 => 'AE Lock (reset on release)',
     3905            6 => 'AE Lock (hold)',
     3906            7 => 'AF Lock Only',
     3907            8 => 'AF-On',
     3908            10 => 'Bracketing Burst',
     3909            11 => 'Matrix Metering',
     3910            12 => 'Center-weighted Metering',
     3911            13 => 'Spot Metering',
     3912            14 => 'Playback',
     3913            15 => 'My Menu Top Item',
     3914            16 => '+NEF(RAW)',
     3915            17 => 'Virtual Horizon',
     3916            18 => 'Reset Focus Point',
     3917            19 => 'Grid Display',
     3918            20 => 'My Menu',
     3919            22 => 'Remote Release Only',
     3920            23 => 'Preset Focus Point',
     3921            26 => 'Flash Disable/Enable',
     3922            27 => 'Highlight-weighted Metering',
     3923            36 => 'AF-Area Mode (Single)',
     3924            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     3925            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     3926            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     3927            40 => 'AF-Area Mode (Group Area AF)',
     3928            41 => 'AF-Area Mode (Auto Area AF)',
     3929            42 => 'AF-Area Mode + AF-On (Single)',
     3930            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     3931            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     3932            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     3933            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     3934            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     3935            49 => 'Sync Release (Master Only)',
     3936            50 => 'Sync Release (Remote Only)',
     3937            54 => 'Highlight Active Focus Point',
     3938        },
     3939    },
     3940    73.1 => { # CSf1-m
     3941        Name => 'SubSelectorPlusDials',
     3942        Mask => 0x0f,
     3943        PrintConv => {
     3944            0 => 'None',
     3945            1 => 'Choose Image Area',
     3946            2 => 'Shutter Speed & Aperture Lock',
     3947            4 => 'Choose Non-CPU Lens Number',
     3948            7 => 'Photo Shooting Menu Bank',
     3949        },
     3950    },
     3951    74.1 => { # CSg1-f
     3952        Name => 'AssignMovieSubselector',
     3953        Mask => 0xf0,
     3954        PrintConv => {
     3955            0 => 'None',
     3956            3 => 'Index Marking',
     3957            4 => 'View Photo Shooting Info',
     3958            5 => 'AE/AF Lock',
     3959            6 => 'AE Lock (Only)',
     3960            7 => 'AE Lock (Hold)',
     3961            8 => 'AF Lock (Only)',
     3962        },
     3963    },
     3964    75.1 => { # CSg1-d
     3965        Name => 'AssignMovieFunc1ButtonPlusDials',
     3966        Mask => 0x10,
     3967        PrintConv => {
     3968            0  => 'None',
     3969            1  => 'Choose Image Area',
     3970        },
     3971    },
     3972    75.2 => { # CSg1-b
     3973        Name => 'AssignMoviePreviewButtonPlusDials',
     3974        Mask => 0x01,
     3975        PrintConv => {
     3976            0 => 'None',
     3977            1 => 'Choose Image Area (DX/1.3x)',
     3978        },
     3979    },
     3980    76.1 => { # CSg1-g
     3981        Name => 'AssignMovieSubselectorPlusDials',
     3982        Mask => 0x10,
     3983        PrintConv => {
     3984            0  => 'None',
     3985            1  => 'Choose Image Area',
     3986        },
     3987    },
     3988    77.1 => { # CSd4
     3989        Name => 'SyncReleaseMode',              # new with D500
     3990        Mask => 0x80,
     3991        PrintConv => {
     3992            0 => 'No Sync',
     3993            1 => 'Sync',
     3994        },
     3995    },
     3996    78.1 => { # CSa5
     3997        Name => 'Three-DTrackingWatchArea',     # new with D500
     3998        Mask => 0x80,
     3999        PrintConv => {
     4000            0 => 'Wide',
     4001            1 => 'Normal',
     4002        },
     4003    },
     4004    78.2 => { # CSa3-b
     4005        Name => 'SubjectMotion',
     4006        Mask => 0x60,
     4007        PrintConv => {
     4008            0 => 'Steady',
     4009            1 => 'Middle',
     4010            2 => 'Erratic',
     4011        },
     4012    },
     4013    78.3 => { # CSa8
     4014        Name => 'AFActivation',
     4015        Mask => 0x08,
     4016        PrintConv => {
     4017            0 => 'Shutter/AF-On',
     4018            1 => 'AF-On Only',
     4019        },
     4020    },
     4021    78.4 => { # CSc1
     4022        Name => 'ShutterReleaseButtonAE-L',
     4023        Mask => 0x03,
     4024        PrintConv => {
     4025            0 => 'Off',
     4026            1 => 'On (Half Press)',
     4027            2 => 'On (Burst Mode)'
     4028        },
     4029    },
     4030    79.1 => { # CSf1-n
     4031        Name => 'VerticalAFOnButton',
     4032        Mask => 0x7f,
     4033        PrintConv => {
     4034            0 => 'None',
     4035            3 => 'AE/AF Lock',
     4036            4 => 'AE Lock Only',
     4037            5 => 'AE Lock (reset on release)',
     4038            6 => 'AE Lock (hold)',
     4039            7 => 'AF Lock Only',
     4040            8 => 'AF-On',
     4041            36 => 'AF-Area Mode (Single)',
     4042            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4043            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4044            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4045            40 => 'AF-Area Mode (Group Area AF)',
     4046            41 => 'AF-Area Mode (Auto Area AF)',
     4047            42 => 'AF-Area Mode + AF-On (Single)',
     4048            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     4049            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     4050            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     4051            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     4052            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     4053            100 => 'Same as AF-On',
     4054        },
     4055    },
     4056    80.1 => { # CSf1-e
     4057        Name => 'Func2Button',
     4058        Mask => 0x3f,
     4059        PrintConv => {
     4060            0 => 'None',
     4061            1 => 'Preview',
     4062            2 => 'FV Lock',
     4063            3 => 'AE/AF Lock',
     4064            4 => 'AE Lock Only',
     4065            5 => 'AE Lock (reset on release)',
     4066            6 => 'AE Lock (hold)',
     4067            7 => 'AF Lock Only',
     4068            8 => 'AF-On',
     4069            10 => 'Bracketing Burst',
     4070            11 => 'Matrix Metering',
     4071            12 => 'Center-weighted Metering',
     4072            13 => 'Spot Metering',
     4073            14 => 'Playback',
     4074            15 => 'My Menu Top Item',
     4075            16 => '+NEF(RAW)',
     4076            17 => 'Virtual Horizon',
     4077            19 => 'Grid Display',
     4078            20 => 'My Menu',
     4079            21 => 'Disable Synchronized Release',
     4080            22 => 'Remote Release Only',
     4081            26 => 'Flash Disable/Enable',
     4082            27 => 'Highlight-weighted Metering',
     4083            36 => 'AF-Area Mode (Single)',
     4084            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4085            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4086            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4087            40 => 'AF-Area Mode (Group Area AF)',
     4088            41 => 'AF-Area Mode (Auto Area AF)',
     4089            42 => 'AF-Area Mode + AF-On (Single)',
     4090            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     4091            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     4092            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     4093            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     4094            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     4095            49 => 'Sync Release (Master Only)',
     4096            50 => 'Sync Release (Remote Only)',
     4097        },
     4098    },
     4099    81.1 => { # CSf1-f
     4100        Name => 'Func2ButtonPlusDials',
     4101        Mask => 0x0f,
     4102        PrintConv => {
     4103            0 => 'None',
     4104            1 => 'Choose Image Area',
     4105            2 => 'Shutter Speed & Aperture Lock',
     4106            3 => 'One Step Speed / Aperture',
     4107            4 => 'Choose Non-CPU Lens Number',
     4108            5 => 'Active D-Lighting',
     4109            7 => 'Photo Shooting Menu Bank',
     4110            8 => 'Exposure Delay Mode',
     4111        },
     4112    },
     4113    82.1 => { # CSg1-e
     4114        Name => 'AssignMovieFunc2Button',
     4115        Mask => 0x70,
     4116        PrintConv => {
     4117            0 => 'None',
     4118            3 => 'Index Marking',
     4119            4 => 'View Photo Shooting Info',
     4120        },
     4121    },
     4122    83.1 => { # CSf1-i
     4123        Name => 'Func3Button',
     4124        Mask => 0x03,
     4125        PrintConv => {
     4126            0 => 'None',
     4127            1 => 'Voice Memo',
     4128            2 => 'Rating',
     4129            3 => 'Connect To Network',
     4130        },
     4131    },
     4132);
     4133
     4134# D500 custom settings (ref 1)
     4135%Image::ExifTool::NikonCustom::SettingsD500 = (
     4136    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     4137    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     4138    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     4139    WRITABLE => 1,
     4140    FIRST_ENTRY => 0,
     4141    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     4142    NOTES => 'Custom settings for the D500.',
     4143    0.1 => {
     4144        Name => 'CustomSettingsBank',
     4145        Mask => 0x03,
     4146        PrintConv => {
     4147            0 => 'A',
     4148            1 => 'B',
     4149            2 => 'C',
     4150            3 => 'D',
     4151        },
     4152    },
     4153    1.1 => { # CSa1
     4154        Name => 'AF-CPrioritySelection',
     4155        Mask => 0xc0,
     4156        PrintConv => {
     4157            0 => 'Release',
     4158            1 => 'Release + Focus',
     4159            2 => 'Focus',
     4160            3 => 'Focus + Release',
     4161        },
     4162    },
     4163    1.2 => { # CSa2
     4164        Name => 'AF-SPrioritySelection',
     4165        Mask => 0x20,
     4166        PrintConv => {
     4167            0 => 'Focus',
     4168            1 => 'Release',
     4169        },
     4170    },
     4171    1.3 => { # CSa6
     4172        Name => 'NumberOfFocusPoints',
     4173        Mask => 0x10,
     4174        PrintConv => {
     4175            0 => '55 Points',
     4176            1 => '15 Points',
     4177        },
     4178    },
     4179    1.4 => { # CSa4
     4180        Name => 'Three-DTrackingFaceDetection',
     4181        Mask => 0x08,
     4182        PrintConv => \%offOn,
     4183    },
     4184    1.5 => { # CSa3-a
     4185        Name => 'BlockShotAFResponse',
     4186        Mask => 0x07,
     4187        #values 1-5
     4188    },
     4189    2.1 => { # CSa11
     4190        Name => 'FocusPointWrap',
     4191        Mask => 0x08,
     4192        PrintConv => {
     4193            0 => 'No Wrap',
     4194            1 => 'Wrap',
     4195        },
     4196    },
     4197    2.2 => { # CSa12-c
     4198        Name => 'AFPointBrightness',
     4199        Mask => 0x06,
     4200        PrintConv => {
     4201            0 => 'Auto',
     4202            1 => 'On',
     4203            2 => 'Off',
     4204        },
     4205    },
     4206    4.1 => { # CSd3
     4207        Name => 'ISODisplay',
     4208        Mask => 0x08,
     4209        PrintConv => {
     4210            0 => 'Show ISO Sensitivity',
     4211            1 => 'Show Frame Count',
     4212        },
     4213    },
     4214    4.2 => { # CSd8
     4215        Name => 'GridDisplay',
     4216        Mask => 0x02,
     4217        PrintConv => \%onOff,
     4218    },
     4219    5.1 => { # CSd9
     4220        Name => 'LCDIllumination',
     4221        Mask => 0x20,
     4222        PrintConv => \%offOn,
     4223    },
     4224    5.2 => { # CSd6
     4225        Name => 'ElectronicFront-CurtainShutter',
     4226        Mask => 0x08,
     4227        PrintConv => \%offOn,
     4228    },
     4229    6.1 => { # CSf7
     4230        Name => 'ReverseIndicators',
     4231        Mask => 0x80,
     4232        PrintConv => {
     4233            0 => '+ 0 -',
     4234            1 => '- 0 +',
     4235        },
     4236    },
     4237    6.2 => { # CSf4-a
     4238        Name => 'CommandDialsReverseRotation',
     4239        Mask => 0x18,
     4240        PrintConv => {
     4241            0 => 'No',
     4242            1 => 'Shutter Speed & Aperture',
     4243            2 => 'Exposure Compensation',
     4244            3 => 'Exposure Compensation, Shutter Speed & Aperture',
     4245        },
     4246    },
     4247    6.3 => { # CSb4
     4248        Name => 'EasyExposureCompensation',
     4249        Mask => 0x03,
     4250        PrintConv => {
     4251            0 => 'Off',
     4252            1 => 'On',
     4253            2 => 'On (auto reset)',
     4254        },
     4255    },
     4256    7.1 => { # CSb2
     4257        Name => 'ExposureControlStepSize',
     4258        Mask => 0xc0,
     4259        PrintConv => {
     4260            0 => '1/3 EV',
     4261            1 => '1/2 EV',
     4262            2 => '1 EV',
     4263        },
     4264    },
     4265    7.2 => { # CSb1
     4266        Name => 'ISOStepSize',
     4267        Mask => 0x30,
     4268        PrintConv => {
     4269            0 => '1/3 EV',
     4270            1 => '1/2 EV',
     4271            2 => '1 EV',
     4272        },
     4273    },
     4274    7.3 => { # CSb3
     4275        Name => 'ExposureCompStepSize',
     4276        Mask => 0x0c,
     4277        PrintConv => {
     4278            0 => '1/3 EV',
     4279            1 => '1/2 EV',
     4280            2 => '1 EV',
     4281        },
     4282    },
     4283    8.1 => { # CSb6
     4284        Name => 'CenterWeightedAreaSize',
     4285        Mask => 0xe0,
     4286        PrintConv => {
     4287            0 => '6 mm',
     4288            1 => '8 mm',
     4289            2 => '10 mm',
     4290            3 => '13 mm',
     4291            4 => 'Average',
     4292        },
     4293    },
     4294    8.2 => { # CSb7-a
     4295        Name => 'FineTuneOptMatrixMetering',
     4296        Mask => 0x0f,
     4297        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     4298        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     4299        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     4300        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     4301    },
     4302    9.1 => { # CSb7-b
     4303        Name => 'FineTuneOptCenterWeighted',
     4304        Mask => 0xf0,
     4305        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     4306        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     4307        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     4308        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     4309    },
     4310    9.2 => { # CSb7-c
     4311        Name => 'FineTuneOptSpotMetering',
     4312        Mask => 0x0f,
     4313        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     4314        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     4315        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     4316        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     4317    },
     4318    10.1 => { # CSf2-a
     4319        Name => 'MultiSelectorShootMode',
     4320        Mask => 0xe0,                       #same offset and settings as D810 but with a different decoding
     4321        PrintConv => {
     4322            0 => 'Select Center Focus Point (Reset)',
     4323            2 => 'Preset Focus Point (Pre)',
     4324            3 => 'Highlight Active Focus Point',
     4325            4 => 'Not Used (None)',
     4326        },
     4327    },
     4328    10.2 => { # CSf2-b                      #same offset and settings as D810 but with a different decoding
     4329        Name => 'MultiSelectorPlaybackMode',
     4330        Mask => 0x0c,
     4331        PrintConv => {
     4332            0 => 'Thumbnail On/Off',
     4333            1 => 'View Histograms',
     4334            2 => 'Zoom On/Off',
     4335            3 => 'Choose Folder',
     4336        },
     4337    },
     4338    10.3 => { # CSf5
     4339        Name => 'MultiSelector',
     4340        Mask => 0x01,
     4341        PrintConv => {
     4342            0 => 'Do Nothing',
     4343            1 => 'Reset Meter-off Delay',
     4344        },
     4345    },
     4346    11.1 => { # CSd5
     4347        Name => 'ExposureDelayMode',
     4348        Mask => 0xc0,
     4349        PrintConv => {
     4350            0 => 'Off',
     4351            1 => '1 s',
     4352            2 => '2 s',
     4353            3 => '3 s',
     4354        },
     4355    },
     4356    11.2 => { # CSd1
     4357        Name => 'CLModeShootingSpeed',
     4358        Mask => 0x0f,
     4359        PrintConv => '"$val fps"',
     4360        PrintConvInv => '$val=~s/\s*fps//i; $val',
     4361    },
     4362    12.1 => { # CSd2
     4363        Name => 'MaxContinuousRelease',
     4364        # values: 1-100
     4365    },
     4366    13.1 => { # CSe7
     4367        Name => 'AutoBracketOrder',
     4368        Mask => 0x10,
     4369        PrintConv => {
     4370            0 => '0,-,+',
     4371            1 => '-,0,+',
     4372        },
     4373    },
     4374    13.2 => { # CSe6
     4375        Name => 'AutoBracketModeM',
     4376        Mask => 0x0c,
     4377        PrintConv => {
     4378            0 => 'Flash/Speed',
     4379            1 => 'Flash/Speed/Aperture',
     4380            2 => 'Flash/Aperture',
     4381            3 => 'Flash Only',
     4382        },
     4383    },
     4384    14.1 => { # CSf1-c
     4385        Name => 'Func1Button',
     4386        Mask => 0x3f,
     4387        PrintConv => {
     4388            0 => 'None',
     4389            1 => 'Preview',
     4390            2 => 'FV Lock',
     4391            3 => 'AE/AF Lock',
     4392            4 => 'AE Lock Only',
     4393            5 => 'AE Lock (reset on release)',
     4394            6 => 'AE Lock (hold)',
     4395            7 => 'AF Lock Only',
     4396            8 => 'AF-On',
     4397            10 => 'Bracketing Burst',
     4398            11 => 'Matrix Metering',
     4399            12 => 'Center-weighted Metering',
     4400            13 => 'Spot Metering',
     4401            14 => 'Playback',
     4402            15 => 'My Menu Top Item',
     4403            16 => '+NEF(RAW)',
     4404            17 => 'Virtual Horizon',
     4405            19 => 'Grid Display',
     4406            20 => 'My Menu',
     4407            22 => 'Remote Release Only',
     4408            26 => 'Flash Disable/Enable',
     4409            27 => 'Highlight-weighted Metering',
     4410            36 => 'AF-Area Mode (Single)',
     4411            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4412            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4413            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4414            40 => 'AF-Area Mode (Group Area AF)',
     4415            41 => 'AF-Area Mode (Auto Area AF)',
     4416            42 => 'AF-Area Mode + AF-On (Single)',
     4417            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     4418            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     4419            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     4420            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     4421            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     4422            49 => 'Sync Release (Master Only)',
     4423            50 => 'Sync Release (Remote Only)',
     4424        },
     4425    },
     4426    15.1 => { # CSf1-a
     4427        Name => 'PreviewButton',
     4428        Mask => 0x3f,
     4429        PrintConv => {
     4430            0 => 'None',
     4431            1 => 'Preview',
     4432            2 => 'FV Lock',
     4433            3 => 'AE/AF Lock',
     4434            4 => 'AE Lock Only',
     4435            5 => 'AE Lock (reset on release)',
     4436            6 => 'AE Lock (hold)',
     4437            7 => 'AF Lock Only',
     4438            8 => 'AF-On',
     4439            10 => 'Bracketing Burst',
     4440            11 => 'Matrix Metering',
     4441            12 => 'Center-weighted Metering',
     4442            13 => 'Spot Metering',
     4443            14 => 'Playback',
     4444            15 => 'My Menu Top Item',
     4445            16 => '+NEF(RAW)',
     4446            17 => 'Virtual Horizon',
     4447            19 => 'Grid Display',
     4448            20 => 'My Menu',
     4449#           21 => 'Disable Synchronized Release',   # removed with D500
     4450            22 => 'Remote Release Only',
     4451            26 => 'Flash Disable/Enable',
     4452            27 => 'Highlight-weighted Metering',
     4453            36 => 'AF-Area Mode (Single)',                         # new with D500
     4454            37 => 'AF-Area Mode (Dynamic Area 25 Points)',         # new with D500
     4455            38 => 'AF-Area Mode (Dynamic Area 72 Points)',         # new with D500
     4456            39 => 'AF-Area Mode (Dynamic Area 152 Points)',        # new with D500
     4457            40 => 'AF-Area Mode (Group Area AF)',                  # new with D500
     4458            41 => 'AF-Area Mode (Auto Area AF)',                   # new with D500
     4459            42 => 'AF-Area Mode + AF-On (Single)',                 # new with D500
     4460            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)', # new with D500
     4461            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)', # new with D500
     4462            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',# new with D500
     4463            46 => 'AF-Area Mode + AF-On (Group Area AF)',          # new with D500
     4464            47 => 'AF-Area Mode + AF-On (Auto Area AF)',           # new with D500
     4465            49 => 'Sync Release (Master Only)',                    # new with D500
     4466            50 => 'Sync Release (Remote Only)',                    # new with D500
     4467        },
     4468    },
     4469    16.1 => { # CSf1-j
     4470        Name => 'AssignBktButton',
     4471        Mask => 0x07,
     4472        PrintConv => {
     4473            0 => 'Auto Bracketing',
     4474            1 => 'Multiple Exposure',
     4475            2 => 'HDR (high dynamic range)',
     4476            3 => 'None',
     4477        },
     4478    },
     4479    18.1 => { # CSf4-b
     4480        Name => 'CommandDialsChangeMainSub',
     4481        Mask => 0xe0,
     4482        PrintConv => {
     4483            0 => 'Autofocus Off, Exposure Off',
     4484            1 => 'Autofocus Off, Exposure On',
     4485            2 => 'Autofocus Off, Exposure On (Mode A)',
     4486            4 => 'Autofocus On, Exposure Off',
     4487            5 => 'Autofocus On, Exposure On',
     4488            6 => 'Autofocus On, Exposure On (Mode A)',
     4489        },
     4490    },
     4491    18.2 => { # CSf4-d
     4492        Name => 'CommandDialsMenuAndPlayback',
     4493        Mask => 0x18,
     4494        PrintConv => {
     4495            0 => 'On',
     4496            1 => 'Off',
     4497            2 => 'On (Image Review Excluded)',
     4498        },
     4499    },
     4500    18.3 => { # CSf4-c
     4501        Name => 'CommandDialsApertureSetting',
     4502        Mask => 0x04,
     4503        PrintConv => {
     4504            0 => 'Sub-command Dial',
     4505            1 => 'Aperture Ring',
     4506        },
     4507    },
     4508    18.4 => { # CSf6
     4509        Name => 'ReleaseButtonToUseDial',
     4510        Mask => 0x01,
     4511        PrintConv => \%noYes,
     4512    },
     4513    19.1 => { # CSc2
     4514        Name => 'StandbyTimer',
     4515        Mask => 0xf0,
     4516        PrintConv => {
     4517            0 => '4 s',
     4518            1 => '6 s',
     4519            3 => '10 s',
     4520            5 => '30 s',
     4521            6 => '1 min',
     4522            7 => '5 min',
     4523            8 => '10 min',
     4524            9 => '30 min',
     4525            10 => 'No Limit',
     4526        },
     4527    },
     4528    20.1 => { # CSc3-a
     4529        Name => 'SelfTimerTime',
     4530        Mask => 0xc0,
     4531        PrintConv => {
     4532            0 => '2 s',
     4533            1 => '5 s',
     4534            2 => '10 s',
     4535            3 => '20 s',
     4536        },
     4537    },
     4538    20.2 => { # CSc3-c
     4539        Name => 'SelfTimerShotInterval',
     4540        Mask => 0x30,
     4541        PrintConv => {
     4542            0 => '0.5 s',
     4543            1 => '1 s',
     4544            2 => '2 s',
     4545            3 => '3 s',
     4546        },
     4547    },
     4548    20.3 => { # CSc3-b
     4549        Name => 'SelfTimerShotCount',
     4550        Mask => 0x0f,
     4551    },
     4552    21.1 => { # CSc4-d
     4553        Name => 'ImageReviewMonitorOffTime',
     4554        Mask => 0xe0,
     4555        PrintConv => {
     4556            0 => '2 s',
     4557            1 => '4 s',
     4558            3 => '10 s',
     4559            4 => '20 s',
     4560            5 => '1 min',
     4561            6 => '5 min',
     4562            7 => '10 min',
     4563        },
     4564    },
     4565    21.2 => { # CSc4-e
     4566        Name => 'LiveViewMonitorOffTime',
     4567        Mask => 0x1c,
     4568        PrintConv => {
     4569            1 => '5 min',
     4570            2 => '10 min',
     4571            3 => '15 min',
     4572            4 => '20 min',
     4573            5 => '30 min',
     4574            6 => 'No Limit',
     4575        },
     4576    },
     4577    22.1 => { # CSc4-b
     4578        Name => 'MenuMonitorOffTime',
     4579        Mask => 0xe0,
     4580        PrintConv => {
     4581            0 => '4 s',
     4582            2 => '10 s',
     4583            4 => '20 s',
     4584            5 => '1 min',
     4585            6 => '5 min',
     4586            7 => '10 min',
     4587        },
     4588    },
     4589    22.2 => { # CSc4-c
     4590        Name => 'ShootingInfoMonitorOffTime',
     4591        Mask => 0x1c,
     4592        PrintConv => {
     4593            0 => '4 s',
     4594            2 => '10 s',
     4595            4 => '20 s',
     4596            5 => '1 min',
     4597            6 => '5 min',
     4598            7 => '10 min',
     4599        },
     4600    },
     4601    23.1 => { # CSe1
     4602        Name => 'FlashSyncSpeed',
     4603        Mask => 0xf0,
     4604        PrintConv => {
     4605            2 => '1/250 s (auto FP)',
     4606            3 => '1/250 s',
     4607            5 => '1/200 s',
     4608            6 => '1/160 s',
     4609            7 => '1/125 s',
     4610            8 => '1/100 s',
     4611            9 => '1/80 s',
     4612            10 => '1/60 s',
     4613        },
     4614    },
     4615    23.2 => { # CSe2
     4616        Name => 'FlashShutterSpeed',
     4617        Mask => 0x0f,
     4618        PrintConvColumns => 2,
     4619        PrintConv => {
     4620            0 => '1/60 s',
     4621            1 => '1/30 s',
     4622            2 => '1/15 s',
     4623            3 => '1/8 s',
     4624            4 => '1/4 s',
     4625            5 => '1/2 s',
     4626            6 => '1 s',
     4627            7 => '2 s',
     4628            8 => '4 s',
     4629            9 => '8 s',
     4630            10 => '15 s',
     4631            11 => '30 s',
     4632        },
     4633    },
     4634    31.1 => { # CSe5
     4635        Name => 'ModelingFlash',
     4636        Mask => 0x20,
     4637        PrintConv => \%onOff,
     4638    },
     4639    36.1 => { # CSc4-a
     4640        Name => 'PlaybackMonitorOffTime',
     4641        Mask => 0xe0,
     4642        PrintConv => {
     4643            0 => '4 s',
     4644            1 => '10 s',
     4645            2 => '20 s',
     4646            3 => '1 min',
     4647            4 => '5 min',
     4648            5 => '10 min',
     4649        },
     4650    },
     4651    37.1 => { # CSf2-c
     4652        Name => 'MultiSelectorLiveView',
     4653        Mask => 0xc0,
     4654        PrintConv => {
     4655            0 => 'Reset',
     4656            1 => 'Zoom',
     4657            3 => 'Not Used',
     4658        },
     4659    },
     4660    38.1 => { # CSf3-a
     4661        Name => 'ShutterSpeedLock',
     4662        Mask => 0x80,
     4663        PrintConv => \%offOn,
     4664    },
     4665    38.2 => { # CSf3-b
     4666        Name => 'ApertureLock',
     4667        Mask => 0x40,
     4668        PrintConv => \%offOn,
     4669    },
     4670    38.3 => { # CSg1-h
     4671        Name => 'MovieShutterButton',
     4672        Mask => 0x10,
     4673        PrintConv => {
     4674            0 => 'Take Photo',
     4675            1 => 'Record Movies',
     4676        },
     4677    },
     4678    38.4 => { # CSe3
     4679        Name => 'FlashExposureCompArea',
     4680        Mask => 0x04,
     4681        PrintConv => {
     4682            0 => 'Entire Frame',
     4683            1 => 'Background Only',
     4684        },
     4685    },
     4686    38.5 => { # CSe4
     4687        Name => 'AutoFlashISOSensitivity',
     4688        Mask => 0x02,
     4689        PrintConv => {
     4690            0 => 'Subject and Background',
     4691            1 => 'Subject Only',
     4692        },
     4693    },
     4694    41.1 => { # CSg1-c
     4695        Name => 'MovieFunc1Button',
     4696        Mask => 0xf0,
     4697        PrintConv => {
     4698            0 => 'None',
     4699            2 => 'Power Aperture (close)',
     4700            3 => 'Index Marking',
     4701            4 => 'View Photo Shooting Info',
     4702            11 => 'Exposure Compensation -',
     4703        },
     4704    },
     4705    41.2 => { # CSg1-a
     4706        Name => 'MoviePreviewButton',
     4707        Mask => 0x0f,
     4708        PrintConv => {
     4709            0 => 'None',
     4710            1 => 'Power Aperture (open)',
     4711            3 => 'Index Marking',
     4712            4 => 'View Photo Shooting Info',
     4713            10 => 'Exposure Compensation +',
     4714        },
     4715    },
     4716    42.1 => { # CSf1-d
     4717        Name => 'Func1ButtonPlusDials',
     4718        Mask => 0x0f,
     4719        PrintConv => {
     4720            0 => 'None',
     4721            1 => 'Choose Image Area (DX/1.3x)',
     4722            2 => 'Shutter Speed & Aperture Lock',
     4723            3 => 'One Step Speed / Aperture',
     4724            4 => 'Choose Non-CPU Lens Number',
     4725            5 => 'Active D-Lighting',
     4726            7 => 'Photo Shooting Menu Bank',
     4727            8 => 'Exposure Delay Mode',
     4728        },
     4729    },
     4730    43.1 => { # CSf1-b
     4731        Name => 'PreviewButtonPlusDials',
     4732        Mask => 0x0f,
     4733        PrintConv => {
     4734            0 => 'None',
     4735            1 => 'Choose Image Area (DX/1.3x)',
     4736            2 => 'Shutter Speed & Aperture Lock',
     4737            3 => 'One Step Speed / Aperture',
     4738            4 => 'Choose Non-CPU Lens Number',
     4739            5 => 'Active D-Lighting',
     4740            7 => 'Photo Shooting Menu Bank',    # new with D500
     4741            8 => 'Exposure Delay Mode',
     4742        },
     4743    },
     4744    45.1 => { # CSf1-k
     4745        Name => 'AssignMovieRecordButtonPlusDials',
     4746        Mask => 0x0f,
     4747        PrintConv => {
     4748            0 => 'None',
     4749            1 => 'Choose Image Area (DX/1.3x)',
     4750            2 => 'Shutter Speed & Aperture Lock',
     4751            7 => 'Photo Shooting Menu Bank',
     4752            11 => 'Exposure Mode',
     4753        },
     4754    },
     4755    46.1 => { # CSb7-d
     4756        Name => 'FineTuneOptHighlightWeighted',
     4757        Mask => 0x0f,
     4758        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     4759        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     4760        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     4761        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     4762    },
     4763    47.1 => { # CSa12-b
     4764        Name => 'DynamicAreaAFDisplay',
     4765        Mask => 0x80,
     4766        PrintConv => \%offOn,
     4767    },
     4768    47.2 => { # CSa12-a
     4769        Name => 'AFPointIllumination',
     4770        Mask => 0x40,
     4771        PrintConv => {
     4772            0 => 'Off',
     4773            1 => 'On During Manual Focusing',
     4774        },
     4775    },
     4776    47.3 => { # CSa7
     4777        Name => 'StoreByOrientation',
     4778        Mask => 0x18,
     4779        PrintConv => {
     4780            0 => 'Off',
     4781            1 => 'Focus Point',
     4782            2 => 'Focus Point and AF-area Mode',
     4783        },
     4784    },
     4785    47.4 => { # CSa12-c
     4786        Name => 'GroupAreaAFIllumination',
     4787        Mask => 0x04,
     4788        PrintConv => {
     4789            0 => 'Squares',
     4790            1 => 'Dots',
     4791        },
     4792    },
     4793    48.1 => { # CSb5
     4794        Name => 'MatrixMetering',
     4795        Mask => 0x80,
     4796        PrintConv => {
     4797            0 => 'Face Detection On',
     4798            1 => 'Face Detection Off',
     4799        },
     4800    },
     4801    48.2 => { # CSf8
     4802        Name => 'LiveViewButtonOptions',
     4803        Mask => 0x30,
     4804        PrintConv => {
     4805            0 => 'Enable',
     4806            1 => 'Enable (Standby Timer Active)',    # new with D500
     4807            2 => 'Disable',
     4808        },
     4809    },
     4810    48.3 => { # CSa10
     4811        Name => 'AFModeRestrictions',
     4812        Mask => 0x03,
     4813        PrintConv => {
     4814            0 => 'No Restrictions',
     4815            1 => 'AF-C',
     4816            2 => 'AF-S',
     4817        },
     4818    },
     4819    49.1 => { # CSa9
     4820        Name => 'LimitAFAreaModeSelection',
     4821        Mask => 0x7e,
     4822        PrintConv => {
     4823            0 => 'No Restrictions',
     4824            BITMASK => {
     4825                0 => 'Auto-area',
     4826                1 => 'Group-area',
     4827                2 => '3D-tracking',
     4828                3 => 'Dynamic area (153 points)',
     4829                4 => 'Dynamic area (72 points)',
     4830                5 => 'Dynamic area (25 points)',
     4831            },
     4832        },
     4833    },
     4834    52.1 => { # CSf1-l
     4835        Name => 'LensFocusFunctionButtons',
     4836        Mask => 0x3f,
     4837        PrintConv => {
     4838            3 => 'AE/AF Lock',
     4839            4 => 'AE Lock Only',
     4840            7 => 'AF Lock Only',
     4841            8 => 'AF-On',
     4842            24 => 'Preset Focus Point',
     4843            26 => 'Flash Disable/Enable',
     4844            36 => 'AF-Area Mode (Single)',
     4845            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4846            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4847            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4848            40 => 'AF-Area Mode (Group Area AF)',
     4849            41 => 'AF-Area Mode (Auto Area AF)',
     4850            42 => 'AF-Area Mode + AF-On (Single)',
     4851            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     4852            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     4853            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     4854            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     4855            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     4856            49 => 'Sync Release (Master Only)',
     4857            50 => 'Sync Release (Remote Only)',
     4858        },
     4859    },
     4860    66.1 => { # CSf10-d
     4861        Name => 'VerticalMultiSelector',
     4862        Mask => 0xff,
     4863        PrintHex => 1,
     4864        PrintConv => {
     4865            0x00 => 'Same as Multi-Selector with Info(U/D) & Playback(R/L)',
     4866            0x08 => 'Same as Multi-Selector with Info(R/L) & Playback(U/D)',
     4867            0x80 => 'Focus Point Selection',
     4868        },
     4869    },
     4870    67.1 => { # CSf10-a
     4871        Name => 'AssignMB-D17FuncButton',
     4872        Mask => 0x3f,
     4873        PrintConv => {
     4874            0 => 'None',
     4875            1 => 'Preview',
     4876            2 => 'FV Lock',
     4877            3 => 'AE/AF Lock',
     4878            4 => 'AE Lock Only',
     4879            5 => 'AE Lock (reset on release)',
     4880            6 => 'AE Lock (hold)',
     4881            7 => 'AF Lock Only',
     4882            8 => 'AF-On',
     4883            10 => 'Bracketing Burst',
     4884            11 => 'Matrix Metering',
     4885            12 => 'Center-weighted Metering',
     4886            13 => 'Spot Metering',
     4887            14 => 'Playback',
     4888            15 => 'My Menu Top Item',
     4889            16 => '+NEF(RAW)',
     4890            17 => 'Virtual Horizon',
     4891            18 => 'Reset Focus Point',
     4892            19 => 'Grid Display',
     4893            20 => 'My Menu',
     4894            22 => 'Remote Release Only',
     4895            23 => 'Preset Focus Point',
     4896            26 => 'Flash Disable/Enable',
     4897            27 => 'Highlight-weighted Metering',
     4898            36 => 'AF-Area Mode (Single)',
     4899            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4900            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4901            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4902            40 => 'AF-Area Mode (Group Area AF)',
     4903            41 => 'AF-Area Mode (Auto Area AF)',
     4904            42 => 'AF-Area Mode + AF-On (Single)',
     4905            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     4906            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     4907            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     4908            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     4909            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     4910            49 => 'Sync Release (Master Only)',
     4911            50 => 'Sync Release (Remote Only)',
     4912            54 => 'Highlight Active Focus Point',
     4913        },
     4914    },
     4915    68.1 => { # CSf10-b
     4916        Name => 'AssignMB-D17FuncButtonPlusDials',
     4917        Mask => 0x0f,
     4918        PrintConv => {
     4919            0 => 'None',
     4920            1 => 'Choose Image Area (DX/1.3x)',
     4921            2 => 'Shutter Speed & Aperture Lock',
     4922            3 => 'One Step Speed / Aperture',
     4923            4 => 'Choose Non-CPU Lens Number',
     4924            5 => 'Active D-Lighting',
     4925            7 => 'Photo Shooting Menu Bank',
     4926            8 => 'Exposure Delay Mode',
     4927            10 => 'ISO Sensitivity',
     4928            11 => 'Exposure Mode',
     4929            12 => 'Exposure Compensation',
     4930            13 => 'Metering Mode',
     4931        },
     4932    },
     4933    70.1 => { # CSf1-f
     4934        Name => 'AF-OnButton',
     4935        Mask => 0x3f,
     4936        PrintConv => {
     4937            0 => 'None',
     4938            3 => 'AE/AF Lock',
     4939            4 => 'AE Lock Only',
     4940            5 => 'AE Lock (reset on release)',
     4941            6 => 'AE Lock (hold)',
     4942            7 => 'AF Lock Only',
     4943            8 => 'AF-On',
     4944            36 => 'AF-Area Mode (Single)',
     4945            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4946            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4947            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4948            40 => 'AF-Area Mode (Group Area AF)',
     4949            41 => 'AF-Area Mode (Auto Area AF)',
     4950            42 => 'AF-Area Mode + AF-On (Single)',
     4951            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     4952            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     4953            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     4954            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     4955            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     4956        },
     4957    },
     4958    71.1 => { # CSf1-g
     4959        Name => 'SubSelector',
     4960        Mask => 0x80,
     4961        PrintConv => {
     4962            0 => 'Focus Point Selection',
     4963            1 => 'Same as MultiSelector',
     4964        },
     4965    },
     4966    72.1 => { # CSf1-h
     4967        Name => 'SubSelectorCenter',
     4968        Mask => 0x3f,
     4969        PrintConv => {
     4970            0 => 'None',
     4971            1 => 'Preview',
     4972            2 => 'FV Lock',
     4973            3 => 'AE/AF Lock',
     4974            4 => 'AE Lock Only',
     4975            5 => 'AE Lock (reset on release)',
     4976            6 => 'AE Lock (hold)',
     4977            7 => 'AF Lock Only',
     4978            8 => 'AF-On',
     4979            10 => 'Bracketing Burst',
     4980            11 => 'Matrix Metering',
     4981            12 => 'Center-weighted Metering',
     4982            13 => 'Spot Metering',
     4983            14 => 'Playback',
     4984            15 => 'My Menu Top Item',
     4985            16 => '+NEF(RAW)',
     4986            17 => 'Virtual Horizon',
     4987            18 => 'Reset Focus Point',
     4988            19 => 'Grid Display',
     4989            20 => 'My Menu',
     4990            22 => 'Remote Release Only',
     4991            23 => 'Preset Focus Point',
     4992            26 => 'Flash Disable/Enable',
     4993            27 => 'Highlight-weighted Metering',
     4994            36 => 'AF-Area Mode (Single)',
     4995            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     4996            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     4997            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     4998            40 => 'AF-Area Mode (Group Area AF)',
     4999            41 => 'AF-Area Mode (Auto Area AF)',
     5000            42 => 'AF-Area Mode + AF-On (Single)',
     5001            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     5002            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     5003            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     5004            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     5005            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     5006            49 => 'Sync Release (Master Only)',
     5007            50 => 'Sync Release (Remote Only)',
     5008            54 => 'Highlight Active Focus Point',
     5009        },
     5010    },
     5011    73.1 => { # CSf1-i
     5012        Name => 'SubSelectorPlusDials',
     5013        Mask => 0x0f,
     5014        PrintConv => {
     5015            0 => 'None',
     5016            1 => 'Choose Image Area (DX/1.3x)',
     5017            2 => 'Shutter Speed & Aperture Lock',
     5018            4 => 'Choose Non-CPU Lens Number',
     5019            7 => 'Photo Shooting Menu Bank',
     5020        },
     5021    },
     5022    74.1 => { # CSg1-f
     5023        Name => 'AssignMovieSubselector',
     5024        Mask => 0xf0,
     5025        PrintConv => {
     5026            0 => 'None',
     5027            3 => 'Index Marking',
     5028            4 => 'View Photo Shooting Info',
     5029            5 => 'AE/AF Lock',
     5030            6 => 'AE Lock (Only)',
     5031            7 => 'AE Lock (Hold)',
     5032            8 => 'AF Lock (Only)',
     5033        },
     5034    },
     5035    75.1 => { # CSg1-d
     5036        Name => 'AssignMovieFunc1ButtonPlusDials',
     5037        Mask => 0x10,
     5038        PrintConv => {
     5039            0  => 'None',
     5040            1  => 'Choose Image Area (DX/1.3x)',
     5041        },
     5042    },
     5043    75.2 => { # CSg1-b
     5044        Name => 'AssignMoviePreviewButtonPlusDials',
     5045        Mask => 0x01,
     5046        PrintConv => {
     5047            0 => 'None',
     5048            1 => 'Choose Image Area (DX/1.3x)',
     5049        },
     5050    },
     5051    76.1 => { # CSg1-g
     5052        Name => 'AssignMovieSubselectorPlusDials',
     5053        Mask => 0x10,
     5054        PrintConv => {
     5055            0  => 'None',
     5056            1  => 'Choose Image Area (DX/1.3x)',
     5057        },
     5058    },
     5059    77.1 => { # CSd4
     5060        Name => 'SyncReleaseMode',          # new with D500
     5061        Mask => 0x80,
     5062        PrintConv => {
     5063            0 => 'No Sync',
     5064            1 => 'Sync',
     5065        },
     5066    },
     5067    78.1 => { # CSa5
     5068        Name => 'Three-DTrackingWatchArea', # new with D500
     5069        Mask => 0x80,
     5070        PrintConv => {
     5071            0 => 'Wide',
     5072            1 => 'Normal',
     5073        },
     5074    },
     5075    78.2 => { # CSa3-b
     5076        Name => 'SubjectMotion',
     5077        Mask => 0x60,
     5078        PrintConv => {
     5079            0 => 'Steady',
     5080            1 => 'Middle',
     5081            2 => 'Erratic',
     5082        },
     5083    },
     5084    78.3 => { # CSa8
     5085        Name => 'AFActivation',
     5086        Mask => 0x08,
     5087        PrintConv => {
     5088            0 => 'Shutter/AF-On',
     5089            1 => 'AF-On Only',
     5090        },
     5091    },
     5092    78.4 => { # CSc1
     5093        Name => 'ShutterReleaseButtonAE-L',
     5094        Mask => 0x03,
     5095        PrintConv => {
     5096            0 => 'Off',
     5097            1 => 'On (Half Press)',
     5098            2 => 'On (Burst Mode)'
     5099        },
     5100    },
     5101    79.1 => { # CSf10-c
     5102        Name => 'AssignMB-D17AF-OnButton',
     5103        Mask => 0x7f,
     5104        PrintConv => {
     5105            0 => 'None',
     5106            3 => 'AE/AF Lock',
     5107            4 => 'AE Lock Only',
     5108            5 => 'AE Lock (reset on release)',
     5109            6 => 'AE Lock (hold)',
     5110            7 => 'AF Lock Only',
     5111            8 => 'AF-On',
     5112            36 => 'AF-Area Mode (Single)',
     5113            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     5114            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     5115            39 => 'AF-Area Mode (Dynamic Area 152 Points)',
     5116            40 => 'AF-Area Mode (Group Area AF)',
     5117            41 => 'AF-Area Mode (Auto Area AF)',
     5118            42 => 'AF-Area Mode + AF-On (Single)',
     5119            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     5120            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     5121            45 => 'AF-Area Mode + AF-On (Dynamic Area 152 Points)',
     5122            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     5123            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     5124            100 => 'Same as Camera AF-On Button',
     5125        },
     5126    },
     5127    80.1 => { # CSf1-e
     5128        Name => 'Func2Button',
     5129        Mask => 0x3f,
     5130        PrintConv => {
     5131            0 => 'None',
     5132            15 => 'My Menu Top Item',
     5133            20 => 'My Menu',
     5134            55 => 'Rating',
     5135        },
     5136    },
     5137    82.1 => { # CSg1-e
     5138        Name => 'AssignMovieFunc2Button',
     5139        Mask => 0x70,
     5140        PrintConv => {
     5141            0 => 'None',
     5142            3 => 'Index Marking',
     5143            4 => 'View Photo Shooting Info',
     5144        },
     5145    },
     5146);
     5147
     5148# D610 custom settings (ref forum6942)
     5149%Image::ExifTool::NikonCustom::SettingsD610 = (
     5150    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     5151    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     5152    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     5153    WRITABLE => 1,
     5154    FIRST_ENTRY => 0,
     5155    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     5156    NOTES => 'Custom settings for the D610.',
     5157    0.1 => { #CSa1
     5158        Name => 'AF-CPrioritySelection',
     5159        Mask => 0x80,
     5160        PrintConv => {
     5161            0 => 'Release',
     5162            1 => 'Focus',
     5163        },
     5164    },
     5165    0.2 => { #CSa2
     5166        Name => 'AF-SPrioritySelection',
     5167        Mask => 0x20,
     5168        PrintConv => {
     5169            0 => 'Release',
     5170            1 => 'Focus',
     5171        },
     5172    },
     5173    0.3 => { # CSa6
     5174        Name => 'NumberOfFocusPoints',
     5175        Mask => 0x10,
     5176        PrintConv => {
     5177            0 => '39 Points',
     5178            1 => '11 Points',
     5179        },
     5180    },
     5181    0.4 => { # CSa3
     5182        Name => 'FocusTrackingLockOn',
     5183        Mask => 0x07,
     5184        PrintConv => {
     5185            0 => 'Off',
     5186            1 => '1 Short',
     5187            2 => '2',
     5188            3 => '3 Normal',
     5189            4 => '4',
     5190            5 => '5 Long',
     5191        },
     5192    },
     5193    1.1 => { # CSa5
     5194        Name => 'FocusPointWrap',
     5195        Mask => 0x08,
     5196        PrintConv => {
     5197            0 => 'No Wrap',
     5198            1 => 'Wrap',
     5199        },
     5200    },
     5201    1.2 => { # CSa4
     5202        Name => 'AFPointIllumination',
     5203        Mask => 0x06,
     5204        PrintConv => {
     5205            0 => 'Auto',
     5206            1 => 'On',
     5207            2 => 'Off',
     5208        },
     5209    },
     5210    1.3 => { # CSa7
     5211        Name => 'AFAssist',
     5212        Mask => 0x01,
     5213        PrintConv => \%onOff,
     5214    },
     5215    5.1 => { # CSb3
     5216        Name => 'EasyExposureCompensation',
     5217        Mask => 0x03,
     5218        PrintConv => {
     5219            0 => 'Off',
     5220            1 => 'On',
     5221            2 => 'On Auto Reset',
     5222        },
     5223    },
     5224    6.1 => { # CSb2
     5225        Name => 'ExposureControlStep',
     5226        Mask => 0x40,
     5227        PrintConv => {
     5228            0 => '1/3 EV',
     5229            1 => '1/2 EV',
     5230        },
     5231    },
     5232    6.2 => { # CSb1
     5233        Name => 'ISOSensitivityStep',
     5234        Mask => 0x10,
     5235        PrintConv => {
     5236            0 => '1/3 EV',
     5237            1 => '1/2 EV',
     5238        },
     5239    },
     5240    7.1 => { # CSb4
     5241        Name => 'CenterWeightedAreaSize',
     5242        Mask => 0xe0,
     5243        PrintConv => {
     5244            0 => '8 mm',
     5245            1 => '12 mm',
     5246            2 => '15 mm',
     5247            3 => '20 mm',
     5248            4 => 'Average',
     5249        },
     5250    },
     5251    7.2 => { # CSb5-a
     5252        Name => 'FineTuneOptMatrixMetering',
     5253        Mask => 0x0f,
     5254        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     5255        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     5256        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     5257        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     5258    },
     5259    8.1 => { # CSb5-b
     5260        Name => 'FineTuneOptCenterWeighted',
     5261        Mask => 0xf0,
     5262        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     5263        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     5264        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     5265        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     5266    },
     5267    8.2 => { # CSb5-c
     5268        Name => 'FineTuneOptSpotMetering',
     5269        Mask => 0x0f,
     5270        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     5271        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     5272        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     5273        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     5274    },
     5275    17.1 => { # CSc1
     5276        Name => 'ShutterReleaseButtonAE-L',
     5277        Mask => 0x02,
     5278        PrintConv => \%offOn,
     5279    },
     5280    18.1 => { # CSc2
     5281        Name => 'StandbyTimer',
     5282        Mask => 0xf0,
     5283        PrintConv => {
     5284            0 => '4 s',
     5285            1 => '6 s',
     5286            2 => '10 s',
     5287            3 => '30 s',
     5288            4 => '1 min',
     5289            5 => '5 min',
     5290            6 => '10 min',
     5291            7 => '30 min',
     5292            8 => 'No Limit',
     5293        },
     5294    },
     5295    18.2 => { # CSc5
     5296        Name => 'RemoteOnDuration',
     5297        Mask => 0x03,
     5298        PrintConv => {
     5299            0 => '1 min',
     5300            1 => '5 min',
     5301            2 => '10 min',
     5302            3 => '20 min',
     5303        },
     5304    },
     5305    19.1 => { # CSc3-a
     5306        Name => 'SelfTimerTime',
     5307        Mask => 0xc0,
     5308        PrintConv => {
     5309            0 => '2 s',
     5310            1 => '5 s',
     5311            2 => '10 s',
     5312            3 => '20 s',
     5313        },
     5314    },
     5315    19.2 => { # CSc3-c
     5316        Name => 'SelfTimerShotInterval',
     5317        Mask => 0x30,
     5318        PrintConv => {
     5319            0 => '0.5 s',
     5320            1 => '1 s',
     5321            2 => '2 s',
     5322            3 => '3 s',
     5323        },
     5324    },
     5325    19.3 => { # CSc3-b
     5326        Name => 'SelfTimerShotCount',
     5327        Mask => 0x0f,
     5328    },
     5329    20.1 => { # CSc4-d
     5330        Name => 'ImageReviewMonitorOffTime',
     5331        Mask => 0xe0,
     5332        PrintConv => {
     5333            0 => '2 s',
     5334            1 => '4 s',
     5335            2 => '10 s',
     5336            3 => '20 s',
     5337            4 => '1 min',
     5338            5 => '5 min',
     5339            6 => '10 min',
     5340        },
     5341    },
     5342    20.2 => { # CSc4-e
     5343        Name => 'LiveViewMonitorOffTime',
     5344        Mask => 0x1c,
     5345        PrintConv => {
     5346            0 => '5 min',
     5347            1 => '10 min',
     5348            2 => '15 min',
     5349            3 => '20 min',
     5350            4 => '30 min',
     5351            5 => 'No Limit',
     5352        },
     5353    },
     5354    21.1 => { # CSc4-b
     5355        Name => 'MenuMonitorOffTime',
     5356        Mask => 0xe0,
     5357        PrintConv => {
     5358            0 => '4 s',
     5359            1 => '10 s',
     5360            2 => '20 s', # default
     5361            3 => '1 min',
     5362            4 => '5 min',
     5363            5 => '10 min',
     5364        },
     5365    },
     5366    21.2 => { # CSc4-c
     5367        Name => 'ShootingInfoMonitorOffTime',
     5368        Mask => 0x1c,
     5369        PrintConv => {
     5370            0 => '4 s',
     5371            1 => '10 s', # default
     5372            2 => '20 s',
     5373            3 => '1 min',
     5374            4 => '5 min',
     5375            5 => '10 min',
     5376        },
     5377    },
     5378    35.1 => { # CSc4-a
     5379        Name => 'PlaybackMonitorOffTime',
     5380        Mask => 0xe0,
     5381        PrintConv => {
     5382            0 => '4 s',
     5383            1 => '10 s',
     5384            2 => '20 s',
     5385            3 => '1 min',
     5386            4 => '5 min',
     5387            5 => '10 min',
     5388        },
     5389    },
     5390);
     5391
     5392# D810 custom settings (ref 1)
     5393%Image::ExifTool::NikonCustom::SettingsD810 = (
     5394    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     5395    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     5396    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     5397    WRITABLE => 1,
     5398    FIRST_ENTRY => 0,
     5399    DATAMEMBER => [ 24.1 ],
     5400    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     5401    NOTES => 'Custom settings for the D810.',
     5402    0.1 => { # CSf1
     5403        Name => 'LightSwitch',
     5404        Mask => 0x08,
     5405        PrintConv => {
     5406            0 => 'LCD Backlight',
     5407            1 => 'LCD Backlight and Shooting Information',
     5408        },
     5409    },
     5410    0.2 => {
     5411        Name => 'CustomSettingsBank',
     5412        Mask => 0x03,
     5413        PrintConv => {
     5414            0 => 'A',
     5415            1 => 'B',
     5416            2 => 'C',
     5417            3 => 'D',
     5418        },
     5419    },
     5420    1.1 => { #CSa1
     5421        Name => 'AF-CPrioritySelection',
     5422        Mask => 0xc0,
     5423        PrintConv => {
     5424            0 => 'Release',
     5425            1 => 'Release + Focus',
     5426            2 => 'Focus',
     5427        },
     5428    },
     5429    1.2 => { # CSa2
     5430        Name => 'AF-SPrioritySelection',
     5431        Mask => 0x20,
     5432        PrintConv => {
     5433            0 => 'Focus',
     5434            1 => 'Release',
     5435        },
     5436    },
     5437    1.3 => { # CSa7
     5438        Name => 'AFPointSelection',
     5439        Mask => 0x10,
     5440        PrintConv => {
     5441            0 => '51 Points',
     5442            1 => '11 Points',
     5443        },
     5444    },
     5445    1.4 => { # CSa3
     5446        Name => 'FocusTrackingLockOn',
     5447        Mask => 0x07,
     5448        PrintConv => {
     5449            0 => 'Off',
     5450            1 => '1 (Short)',
     5451            2 => '2',
     5452            3 => '3 (Normal)',
     5453            4 => '4',
     5454            5 => '5 (Long)',
     5455        },
     5456    },
     5457    2.1 => { # CSa4
     5458        Name => 'AFActivation',
     5459        Mask => 0x80,
     5460        PrintConv => {
     5461            0 => 'Shutter/AF-On',
     5462            1 => 'AF-On Only',
     5463        },
     5464    },
     5465    2.2 => { # CSa7
     5466        Name => 'FocusPointWrap',
     5467        Mask => 0x08,
     5468        PrintConv => {
     5469            0 => 'No Wrap',
     5470            1 => 'Wrap',
     5471        },
     5472    },
     5473    2.3 => { # CSa6
     5474        Name => 'AFPointBrightness',
     5475        Mask => 0x06,
     5476        PrintConv => {
     5477            0 => 'Auto',
     5478            1 => 'On',
     5479            2 => 'Off',
     5480        },
     5481    },
     5482    2.4 => { # CSa10
     5483        Name => 'AFAssist',
     5484        Mask => 0x01,
     5485        PrintConv => \%onOff,
     5486    },
     5487    3.1 => { # CSd13
     5488        Name => 'BatteryOrder',
     5489        Mask => 0x40,
     5490        PrintConv => {
     5491            0 => 'MB-D12 First',
     5492            1 => 'Camera Battery First',
     5493        },
     5494    },
     5495    3.2 => { # CSd12
     5496        Name => 'MB-D12BatteryType',
     5497        Mask => 0x03,
     5498        PrintConv => {
     5499            0 => 'LR6 (AA alkaline)',
     5500            1 => 'HR6 (AA Ni-MH)',
     5501            2 => 'FR6 (AA lithium)',
     5502        },
     5503    },
     5504    4.1 => { # CSd1-b
     5505        Name => 'Pitch',
     5506        Mask => 0x40,
     5507        PrintConv => { 0 => 'High', 1 => 'Low' },
     5508    },
     5509    4.2 => { # CSf11
     5510        Name => 'NoMemoryCard',
     5511        Mask => 0x20,
     5512        PrintConv => {
     5513            0 => 'Release Locked',
     5514            1 => 'Enable Release',
     5515        },
     5516    },
     5517    4.3 => { # CSd8
     5518        Name => 'ISODisplay',
     5519        Mask => 0x0c,
     5520        PrintConv => {
     5521            0 => 'Show ISO/Easy ISO',
     5522            1 => 'Show ISO Sensitivity',
     5523            3 => 'Show Frame Count',
     5524        },
     5525    },
     5526    4.4 => { # CSd7
     5527        Name => 'GridDisplay',
     5528        Mask => 0x02,
     5529        PrintConv => \%onOff,
     5530    },
     5531    5.1 => { # CSd10
     5532        Name => 'ShootingInfoDisplay',
     5533        Mask => 0xc0,
     5534        PrintConv => {
     5535            0 => 'Not Set', # observed on a new camera prior to applying a setting for the first time
     5536            1 => 'Auto',
     5537            2 => 'Manual (dark on light)',
     5538            3 => 'Manual (light on dark)',
     5539        },
     5540    },
     5541    5.2 => { # CSd11
     5542        Name => 'LCDIllumination',
     5543        Mask => 0x20,
     5544        PrintConv => \%offOn,
     5545    },
     5546    5.3 => { # CSd5
     5547        Name => 'ElectronicFront-CurtainShutter',
     5548        Mask => 0x08,
     5549        PrintConv => \%offOn,
     5550    },
     5551    5.4 => { # CSd9
     5552        Name => 'ScreenTips',
     5553        Mask => 0x04,
     5554        PrintConv => \%offOn,
     5555    },
     5556    5.5 => { # CSd1-a
     5557        Name => 'Beep',
     5558        Mask => 0x03,
     5559        PrintConv => {
     5560            0 => 'Off',
     5561            1 => 'Low',
     5562            2 => 'Medium',
     5563            3 => 'High',
     5564        },
     5565    },
     5566    6.1 => { # CSf12
     5567        Name => 'ReverseIndicators',
     5568        Mask => 0x80,
     5569        PrintConv => {
     5570            0 => '+ 0 -',
     5571            1 => '- 0 +',
     5572        },
     5573    },
     5574    6.2 => { # CSf9-a
     5575        Name => 'CommandDialsReverseRotation',
     5576        Mask => 0x18,
     5577        PrintConv => {
     5578            0 => 'No',
     5579            1 => 'Shutter Speed & Aperture',
     5580            2 => 'Exposure Compensation',
     5581            3 => 'Exposure Compensation, Shutter Speed & Aperture',
     5582        },
     5583    },
     5584    6.3 => { # CSb4
     5585        Name => 'EasyExposureCompensation',
     5586        Mask => 0x03,
     5587        PrintConv => {
     5588            0 => 'Off',
     5589            1 => 'On',
     5590            2 => 'On (auto reset)',
     5591        },
     5592    },
     5593    7.1 => { # CSb2
     5594        Name => 'ExposureControlStepSize',
     5595        Mask => 0xc0,
     5596        PrintConv => {
     5597            0 => '1/3 EV',
     5598            1 => '1/2 EV',
     5599            2 => '1 EV',
     5600        },
     5601    },
     5602    7.2 => { # CSb1
     5603        Name => 'ISOStepSize',
     5604        Mask => 0x30,
     5605        PrintConv => {
     5606            0 => '1/3 EV',
     5607            1 => '1/2 EV',
     5608            2 => '1 EV',
     5609        },
     5610    },
     5611    7.3 => { # CSb3
     5612        Name => 'ExposureCompStepSize',
     5613        Mask => 0x0c,
     5614        PrintConv => {
     5615            0 => '1/3 EV',
     5616            1 => '1/2 EV',
     5617            2 => '1 EV',
     5618        },
     5619    },
     5620    8.1 => { # CSb6
     5621        Name => 'CenterWeightedAreaSize',
     5622        Mask => 0xe0,
     5623        PrintConv => {
     5624            0 => '8 mm',
     5625            1 => '12 mm',
     5626            2 => '15 mm',
     5627            3 => '20 mm',
     5628            4 => 'Average',
     5629        },
     5630    },
     5631    8.2 => { # CSb7-a
     5632        Name => 'FineTuneOptMatrixMetering',
     5633        Mask => 0x0f,
     5634        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     5635        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     5636        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     5637        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     5638    },
     5639    9.1 => { # CSb7-b
     5640        Name => 'FineTuneOptCenterWeighted',
     5641        Mask => 0xf0,
     5642        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     5643        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     5644        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     5645        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     5646    },
     5647    9.2 => { # CSb7-c
     5648        Name => 'FineTuneOptSpotMetering',
     5649        Mask => 0x0f,
     5650        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     5651        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     5652        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     5653        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     5654    },
     5655    10.1 => { # CSf2-a
     5656        Name => 'MultiSelectorShootMode',
     5657        Mask => 0xc0,
     5658        PrintConv => {
     5659            0 => 'Select Center Focus Point (Reset)',
     5660            1 => 'Highlight Active Focus Point',
     5661            2 => 'Preset Focus Point (Pre)',
     5662            3 => 'Not Used (None)',
     5663        },
     5664    },
     5665    10.2 => { # CSf2-b
     5666        Name => 'MultiSelectorPlaybackMode',
     5667        Mask => 0x30,
     5668        PrintConv => {
     5669            0 => 'Thumbnail On/Off',
     5670            1 => 'View Histograms',
     5671            2 => 'Zoom On/Off',
     5672            3 => 'Choose Folder',
     5673        },
     5674    },
     5675    10.3 => { # CSf3
     5676        Name => 'MultiSelector',
     5677        Mask => 0x01,
     5678        PrintConv => {
     5679            0 => 'Do Nothing',
     5680            1 => 'Reset Meter-off Delay',
     5681        },
     5682    },
     5683    11.1 => { # CSd4
     5684        Name => 'ExposureDelayMode',
     5685        Mask => 0xc0,
     5686        PrintConv => {
     5687            0 => 'Off',
     5688            1 => '1 s',
     5689            2 => '2 s',
     5690            3 => '3 s',
     5691        },
     5692    },
     5693    11.2 => { # CSd2
     5694        Name => 'CLModeShootingSpeed',
     5695        Mask => 0x0f,
     5696        PrintConv => '"$val fps"',
     5697        PrintConvInv => '$val=~s/\s*fps//i; $val',
     5698    },
     5699    12.1 => { # CSd3
     5700        Name => 'MaxContinuousRelease',
     5701        # values: 1-100
     5702    },
     5703    13.1 => { # CSe6
     5704        Name => 'AutoBracketSet',
     5705        Mask => 0xe0,
     5706        PrintConv => {
     5707            0 => 'AE & Flash',
     5708            1 => 'AE Only',
     5709            2 => 'Flash Only',
     5710            3 => 'WB Bracketing',
     5711            4 => 'Active D-Lighting',
     5712        },
     5713    },
     5714    13.2 => { # CSe8
     5715        Name => 'AutoBracketOrder',
     5716        Mask => 0x10,
     5717        PrintConv => {
     5718            0 => '0,-,+',
     5719            1 => '-,0,+',
     5720        },
     5721    },
     5722    13.3 => { # CSe7
     5723        Name => 'AutoBracketModeM',
     5724        Mask => 0x0c,
     5725        PrintConv => {
     5726            0 => 'Flash/Speed',
     5727            1 => 'Flash/Speed/Aperture',
     5728            2 => 'Flash/Aperture',
     5729            3 => 'Flash Only',
     5730        },
     5731    },
     5732    14.1 => { # CSf4-a
     5733        Name => 'FuncButton',
     5734        Mask => 0x1f,
     5735        PrintConv => {
     5736            0 => 'None',
     5737            1 => 'Preview',
     5738            2 => 'FV Lock',
     5739            3 => 'AE/AF Lock',
     5740            4 => 'AE Lock Only',
     5741            5 => 'AE Lock (reset on release)',
     5742            6 => 'AE Lock (hold)',
     5743            7 => 'AF Lock Only',
     5744            8 => 'AF-On',
     5745            10 => 'Bracketing Burst',
     5746            11 => 'Matrix Metering',
     5747            12 => 'Center-weighted Metering',
     5748            13 => 'Spot Metering',
     5749            14 => 'Playback',
     5750            15 => 'My Menu Top Item',
     5751            16 => '+NEF(RAW)',
     5752            17 => 'Virtual Horizon',
     5753            19 => 'Grid Display', # values 19 and 20 are swapped from the D4s encodings
     5754            20 => 'My Menu',
     5755            21 => 'Disable Synchronized Release',
     5756            22 => 'Remote Release Only',
     5757            26 => 'Flash Disable/Enable',
     5758            27 => 'Highlight-weighted Metering',    # new value with D810
     5759        },
     5760    },
     5761    15.1 => { # CSf5-a
     5762        Name => 'PreviewButton',
     5763        Mask => 0x1f,
     5764        PrintConv => {
     5765            0 => 'None',
     5766            1 => 'Preview',
     5767            2 => 'FV Lock',
     5768            3 => 'AE/AF Lock',
     5769            4 => 'AE Lock Only',
     5770            5 => 'AE Lock (reset on release)',
     5771            6 => 'AE Lock (hold)',
     5772            7 => 'AF Lock Only',
     5773            8 => 'AF-On',
     5774            10 => 'Bracketing Burst',
     5775            11 => 'Matrix Metering',
     5776            12 => 'Center-weighted Metering',
     5777            13 => 'Spot Metering',
     5778            14 => 'Playback',
     5779            15 => 'My Menu Top Item',
     5780            16 => '+NEF(RAW)',
     5781            17 => 'Virtual Horizon',
     5782            19 => 'Grid Display', # values 19 and 20 are swapped from the D4s encodings
     5783            20 => 'My Menu',
     5784            21 => 'Disable Synchronized Release',
     5785            22 => 'Remote Release Only',
     5786            26 => 'Flash Disable/Enable',
     5787            27 => 'Highlight-weighted Metering',        # new value with D810
     5788        },
     5789    },
     5790    16.1 => { # CSf8
     5791        Name => 'AssignBktButton',
     5792        Mask => 0x07,
     5793        PrintConv => {
     5794            0 => 'Auto Bracketing',
     5795            1 => 'Multiple Exposure',
     5796            2 => 'HDR (high dynamic range)',
     5797            3 => 'None',
     5798        },
     5799    },
     5800    17.1 => { # CSf6-a
     5801        Name => 'AELockButton',
     5802        Mask => 0x1f,
     5803        PrintConv => {
     5804            0 => 'None',
     5805            1 => 'Preview',
     5806            2 => 'FV Lock',
     5807            3 => 'AE/AF Lock',
     5808            4 => 'AE Lock Only',
     5809            5 => 'AE Lock (reset on release)',
     5810            6 => 'AE Lock (hold)',
     5811            7 => 'AF Lock Only',
     5812            8 => 'AF-On',
     5813            10 => 'Bracketing Burst',
     5814            11 => 'Matrix Metering',
     5815            12 => 'Center-weighted Metering',
     5816            13 => 'Spot Metering',
     5817            14 => 'Playback',
     5818            15 => 'My Menu Top Item',
     5819            16 => '+NEF(RAW)',
     5820            17 => 'Virtual Horizon',
     5821            19 => 'Grid Display', # values 19 and 20 are swapped from the D4s encodings
     5822            20 => 'My Menu',
     5823            21 => 'Disable Synchronized Release',
     5824            22 => 'Remote Release Only',
     5825            26 => 'Flash Disable/Enable',
     5826            27 => 'Highlight-weighted Metering',        # new value with D810
     5827        },
     5828    },
     5829    18.1 => { # CSf9-b
     5830        Name => 'CommandDialsChangeMainSub',
     5831        Mask => 0xe0,
     5832        PrintConv => {
     5833            0 => 'Autofocus Off, Exposure Off',
     5834            1 => 'Autofocus Off, Exposure On',
     5835            2 => 'Autofocus Off, Exposure On (Mode A)',
     5836            4 => 'Autofocus On, Exposure Off',
     5837            5 => 'Autofocus On, Exposure On',
     5838            6 => 'Autofocus On, Exposure On (Mode A)',
     5839        },
     5840    },
     5841    18.2 => { # CSf9-d
     5842        Name => 'CommandDialsMenuAndPlayback',
     5843        Mask => 0x18,
     5844        PrintConv => {
     5845            0 => 'On',
     5846            1 => 'Off',
     5847            2 => 'On (Image Review Excluded)',
     5848        },
     5849    },
     5850    18.3 => { # CSf9-c
     5851        Name => 'CommandDialsApertureSetting',
     5852        Mask => 0x04,
     5853        PrintConv => {
     5854            0 => 'Sub-command Dial',
     5855            1 => 'Aperture Ring',
     5856        },
     5857    },
     5858    18.4 => { # CSc1
     5859        Name => 'ShutterReleaseButtonAE-L',
     5860        Mask => 0x02,
     5861        PrintConv => \%offOn,
     5862    },
     5863    18.5 => { # CSf10
     5864        Name => 'ReleaseButtonToUseDial',
     5865        Mask => 0x01,
     5866        PrintConv => \%noYes,
     5867    },
     5868    19.1 => { # CSc2
     5869        Name => 'StandbyTimer',
     5870        Mask => 0xf0,
     5871        PrintConv => {
     5872            0 => '4 s',
     5873            1 => '6 s',
     5874            3 => '10 s',
     5875            5 => '30 s',
     5876            6 => '1 min',
     5877            7 => '5 min',
     5878            8 => '10 min',
     5879            9 => '30 min',
     5880            10 => 'No Limit', #1
     5881        },
     5882    },
     5883    20.1 => { # CSc3-a
     5884        Name => 'SelfTimerTime',
     5885        Mask => 0xc0,
     5886        PrintConv => {
     5887            0 => '2 s',
     5888            1 => '5 s',
     5889            2 => '10 s',
     5890            3 => '20 s',
     5891        },
     5892    },
     5893    20.2 => { # CSc3-c
     5894        Name => 'SelfTimerShotInterval',
     5895        Mask => 0x30,
     5896        PrintConv => {
     5897            0 => '0.5 s',
     5898            1 => '1 s',
     5899            2 => '2 s',
     5900            3 => '3 s',
     5901        },
     5902    },
     5903    20.3 => { # CSc3-b
     5904        Name => 'SelfTimerShotCount',
     5905        Mask => 0x0f,
     5906    },
     5907    21.1 => { # CSc4-d
     5908        Name => 'ImageReviewMonitorOffTime',  # note: decode changed from D4s
     5909        Mask => 0xe0,
     5910        PrintConv => {
     5911            0 => '2 s',
     5912            1 => '4 s',
     5913            3 => '10 s',
     5914            4 => '20 s',
     5915            5 => '1 min',
     5916            6 => '5 min',
     5917            7 => '10 min',
     5918        },
     5919    },
     5920    21.2 => { # CSc4-e                        # note: decode changed from D4s
     5921        Name => 'LiveViewMonitorOffTime',
     5922        Mask => 0x1c,
     5923        PrintConv => {
     5924            1 => '5 min',
     5925            2 => '10 min',
     5926            3 => '15 min',
     5927            4 => '20 min',
     5928            5 => '30 min',
     5929            6 => 'No Limit',
     5930        },
     5931    },
     5932    22.1 => { # CSc4-b                        # note: decode changed from D4s
     5933        Name => 'MenuMonitorOffTime',
     5934        Mask => 0xe0,
     5935        PrintConv => {
     5936            0 => '4 s',
     5937            2 => '10 s',
     5938            4 => '20 s',
     5939            5 => '1 min',
     5940            6 => '5 min',
     5941            7 => '10 min',
     5942        },
     5943    },
     5944    22.2 => { # CSc4-c                        # note: decode changed from D4s
     5945        Name => 'ShootingInfoMonitorOffTime',
     5946        Mask => 0x1c,
     5947        PrintConv => {
     5948            0 => '4 s',
     5949            2 => '10 s',
     5950            4 => '20 s',
     5951            5 => '1 min',
     5952            6 => '5 min',
     5953            7 => '10 min',
     5954        },
     5955    },
     5956    23.1 => { # CSe1
     5957        Name => 'FlashSyncSpeed',
     5958        Mask => 0xf0,
     5959        PrintConv => {
     5960            0 => '1/320 s (auto FP)',
     5961            2 => '1/250 s (auto FP)',
     5962            3 => '1/250 s',
     5963            5 => '1/200 s',
     5964            6 => '1/160 s',
     5965            7 => '1/125 s',
     5966            8 => '1/100 s',
     5967            9 => '1/80 s',
     5968            10 => '1/60 s',
     5969        },
     5970    },
     5971    23.2 => { # CSe2
     5972        Name => 'FlashShutterSpeed',
     5973        Mask => 0x0f,
     5974        PrintConvColumns => 2,
     5975        PrintConv => {
     5976            0 => '1/60 s',
     5977            1 => '1/30 s',
     5978            2 => '1/15 s',
     5979            3 => '1/8 s',
     5980            4 => '1/4 s',
     5981            5 => '1/2 s',
     5982            6 => '1 s',
     5983            7 => '2 s',
     5984            8 => '4 s',
     5985            9 => '8 s',
     5986            10 => '15 s',
     5987            11 => '30 s',
     5988        },
     5989    },
     5990    24.1 => { # CSe3
     5991        Name => 'FlashControlBuilt-in',
     5992        Mask => 0xc0,
     5993        RawConv => '$$self{FlashControlBuiltin} = $val',
     5994        PrintConv => {
     5995            0 => 'TTL',
     5996            1 => 'Manual',
     5997            2 => 'Repeating Flash',
     5998            3 => 'Commander Mode',
     5999        },
     6000    },
     6001    31.1 => { # CSe5
     6002        Name => 'ModelingFlash',
     6003        Mask => 0x20,
     6004        PrintConv => \%onOff,
     6005    },
     6006    36.1 => { # CSc4-a
     6007        Name => 'PlaybackMonitorOffTime',
     6008        Mask => 0xe0,
     6009        PrintConv => {
     6010            0 => '4 s',
     6011            1 => '10 s',
     6012            2 => '20 s',
     6013            3 => '1 min',
     6014            4 => '5 min',
     6015            5 => '10 min',
     6016        },
     6017    },
     6018    37.1 => { # CSf2-c
     6019        Name => 'MultiSelectorLiveView',
     6020        Mask => 0xc0,
     6021        PrintConv => {
     6022            0 => 'Reset',
     6023            1 => 'Zoom',
     6024            3 => 'Not Used',
     6025        },
     6026    },
     6027    38.1 => { # CSf7-a
     6028        Name => 'ShutterSpeedLock',
     6029        Mask => 0x80,
     6030        PrintConv => \%offOn,
     6031    },
     6032    38.2 => { # CSf7-b
     6033        Name => 'ApertureLock',
     6034        Mask => 0x40,
     6035        PrintConv => \%offOn,
     6036    },
     6037    38.3 => { # CSg4
     6038        Name => 'MovieShutterButton',
     6039        Mask => 0x20,
     6040        PrintConv => {
     6041            0 => 'Take Photo',
     6042            1 => 'Record Movies',
     6043        },
     6044    },
     6045    38.4 => { # CSe4
     6046        Name => 'FlashExposureCompArea',
     6047        Mask => 0x04,
     6048        PrintConv => {
     6049            0 => 'Entire frame',
     6050            1 => 'Background only',
     6051        },
     6052    },
     6053    40.1 => { # CSg3
     6054        Name => 'MovieAELockButtonAssignment',
     6055        Mask => 0x0f,
     6056        PrintConv => {
     6057            0 => 'None',
     6058            3 => 'Index Marking',
     6059            4 => 'View Photo Shooting Info',
     6060            5 => 'AE/AF Lock',
     6061            6 => 'AE Lock Only',
     6062            7 => 'AE Lock (hold)',
     6063            8 => 'AF Lock Only',
     6064        },
     6065    },
     6066    41.1 => { # CSg1
     6067        Name => 'MovieFunctionButton',
     6068        Mask => 0x70,
     6069        PrintConv => {
     6070            0 => 'None',
     6071            1 => 'Power Aperture (open)', # bit '02' is also toggled on for this setting
     6072            3 => 'Index Marking',
     6073            4 => 'View Photo Shooting Info',
     6074        },
     6075    },
     6076    41.2 => { # CSg2
     6077        Name => 'MoviePreviewButton',
     6078        Mask => 0x07,
     6079        PrintConv => {
     6080            0 => 'None',
     6081            2 => 'Power Aperture (open)', # bit '10' is also toggled on for this setting
     6082            3 => 'Index Marking',
     6083            4 => 'View Photo Shooting Info',
     6084        },
     6085    },
     6086    42.1 => { # CSf4-b
     6087        Name => 'FuncButtonPlusDials',
     6088        Mask => 0x0f,
     6089        PrintConv => {
     6090            0 => 'None',
     6091            1 => 'Choose Image Area (FX/DX/5:4)',
     6092            2 => 'Shutter Speed & Aperture Lock',
     6093            3 => 'One Step Speed / Aperture',
     6094            4 => 'Choose Non-CPU Lens Number',
     6095            5 => 'Active D-Lighting',
     6096            8 => 'Exposure Delay Mode',
     6097        },
     6098    },
     6099    43.1 => { # CSf5-b
     6100        Name => 'PreviewButtonPlusDials',
     6101        Mask => 0x0f,
     6102        PrintConv => {
     6103            0 => 'None',
     6104            1 => 'Choose Image Area (FX/DX/5:4)',
     6105            2 => 'Shutter Speed & Aperture Lock',
     6106            3 => 'One Step Speed / Aperture',
     6107            4 => 'Choose Non-CPU Lens Number',
     6108            5 => 'Active D-Lighting',
     6109            8 => 'Exposure Delay Mode',
     6110        },
     6111    },
     6112    44.1 => { # CSf6-b
     6113        Name => 'AELockButtonPlusDials',
     6114        Mask => 0x0f,
     6115        PrintConv => {
     6116            0 => 'None',
     6117            1 => 'Choose Image Area (FX/DX/5:4)',
     6118            2 => 'Shutter Speed & Aperture Lock',
     6119            4 => 'Choose Non-CPU Lens Number',
     6120            8 => 'Exposure Delay Mode',
     6121        },
     6122    },
     6123    45.1 => { # CSf13
     6124        Name => 'AssignMovieRecordButton',
     6125        Mask => 0x0f,
     6126        PrintConv => {
     6127            0 => 'None',
     6128            1 => 'Choose Image Area (FX/DX/5:4)',
     6129            2 => 'Shutter Speed & Aperture Lock',
     6130            9 => 'White Balance',
     6131            10 => 'ISO Sensitivity',
     6132        },
     6133    },
     6134    46.1 => { # CSb7-d
     6135        Name => 'FineTuneOptHighlightWeighted',
     6136        Mask => 0x0f,
     6137        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     6138        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     6139        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     6140        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     6141    },
     6142    47.1 => { # CSa5-b
     6143        Name => 'DynamicAreaAFDisplay',
     6144        Mask => 0x80,
     6145        PrintConv => \%offOn,
     6146    },
     6147    47.2 => { # CSa5-a              # moved with D810
     6148        Name => 'AFPointIllumination',
     6149        Mask => 0x40,
     6150        PrintConv => {
     6151            0 => 'Off',
     6152            1 => 'On During Manual Focusing',
     6153        },
     6154    },
     6155    47.3 => { # CSa9
     6156        Name => 'StoreByOrientation',
     6157        Mask => 0x18,
     6158        PrintConv => {
     6159            0 => 'Off',
     6160            1 => 'Focus Point',
     6161            2 => 'Focus Point and AF-area mode',
     6162        },
     6163    },
     6164    47.4 => { # CSa5-c
     6165        Name => 'GroupAreaAFIllumination',
     6166        Mask => 0x04,
     6167        PrintConv => {
     6168            0 => 'Squares',      # moved with D810
     6169            1 => 'Dots',
     6170        },
     6171    },
     6172    48.1 => { # CSb5
     6173        Name => 'MatrixMetering',
     6174        Mask => 0x80,
     6175        PrintConv => {
     6176            0 => 'Face Detection On',
     6177            1 => 'Face Detection Off',
     6178        },
     6179    },
     6180    48.2 => { # CSf14
     6181        Name => 'LiveViewButtonOptions',
     6182        Mask => 0x30,
     6183        PrintConv => {
     6184            0 => 'Enable',
     6185            2 => 'Disable',
     6186        },
     6187    },
     6188    48.3 => { # CSa12
     6189        Name => 'AFModeRestrictions',
     6190        Mask => 0x03,
     6191        PrintConv => {
     6192            0 => 'No Restrictions',
     6193            1 => 'AF-C',
     6194            2 => 'AF-S',
     6195        },
     6196    },
     6197    49.1 => { # CSa11
     6198        Name => 'LimitAFAreaModeSelection',
     6199        Mask => 0x7e,
     6200        PrintConv => {
     6201            0 => 'No Restrictions',
     6202            BITMASK => {
     6203                0 => 'Auto-area',
     6204                1 => 'Group-area',
     6205                2 => '3D-tracking',
     6206                3 => 'Dynamic area (51 points)',
     6207                4 => 'Dynamic area (21 points)',
     6208                5 => 'Dynamic area (9 points)',
     6209            },
     6210        },
     6211    },
     6212    50.1 => { # CSf15
     6213        Name => 'AF-OnForMB-D12',
     6214        Mask => 0x07,
     6215        PrintConv => {
     6216            0 => 'AE/AF Lock',
     6217            1 => 'AE Lock Only',
     6218            2 => 'AF Lock Only',
     6219            3 => 'AE Lock (hold)',
     6220            4 => 'AE Lock (reset)',
     6221            5 => 'AF-On',
     6222            6 => 'FV Lock',
     6223            7 => 'Same As Fn Button',
     6224        },
     6225    },
     6226    51.1 => { # CSf16
     6227        Name => 'AssignRemoteFnButton',
     6228        Mask => 0x1f,
     6229        PrintConv => {
     6230            0 => 'None',
     6231            1 => 'Preview',
     6232            2 => 'FV Lock',
     6233            3 => 'AE/AF Lock',
     6234            4 => 'AE Lock Only',
     6235            5 => 'AE Lock (reset on release)',
     6236            7 => 'AF Lock Only',
     6237            8 => 'AF-On',
     6238            16 => '+NEF(RAW)',
     6239            25 => 'Live View',
     6240            26 => 'Flash Disable/Enable',
     6241        },
     6242    },
     6243    52.1 => { # CSf17
     6244        Name => 'LensFocusFunctionButtons',
     6245        Mask => 0x3f,
     6246        PrintConv => {
     6247            3 => 'AE/AF Lock',
     6248            4 => 'AE Lock Only',
     6249            7 => 'AF Lock Only',
     6250            21 => 'Disable Synchronized Release',
     6251            22 => 'Remote Release Only',
     6252            24 => 'Preset focus Point',
     6253            26 => 'Flash Disable/Enable',
     6254            32 => 'AF-Area Mode:  Single-point AF',
     6255            33 => 'AF-Area Mode: Dynamic-area AF (9 points)',
     6256            34 => 'AF-Area Mode: Dynamic-area AF (21 points)',
     6257            35 => 'AF-Area Mode: Dynamic-area AF (51 points)',
     6258            36 => 'AF-Area Mode: Group-area AF',
     6259            37 => 'AF-Area Mode: Auto area AF',
     6260        },
     6261    },
     6262);
     6263
     6264# D850 custom settings (ref 1)
     6265%Image::ExifTool::NikonCustom::SettingsD850 = (
     6266    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     6267    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     6268    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     6269    WRITABLE => 1,
     6270    FIRST_ENTRY => 0,
     6271    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     6272    NOTES => 'Custom settings for the D850.',
     6273    0.2 => {
     6274        Name => 'CustomSettingsBank',
     6275        Mask => 0x03,
     6276        PrintConv => {
     6277            0 => 'A',
     6278            1 => 'B',
     6279            2 => 'C',
     6280            3 => 'D',
     6281        },
     6282    },
     6283    1.1 => { #CSa1
     6284        Name => 'AF-CPrioritySelection',
     6285        Mask => 0xc0,
     6286        PrintConv => {
     6287            0 => 'Release',
     6288            1 => 'Release + Focus',
     6289            2 => 'Focus',
     6290            3 => 'Focus + Release',
     6291        },
     6292    },
     6293    1.2 => { # CSa2
     6294        Name => 'AF-SPrioritySelection',
     6295        Mask => 0x20,
     6296        PrintConv => {
     6297            0 => 'Focus',
     6298            1 => 'Release',
     6299        },
     6300    },
     6301    1.3 => { # CSa6
     6302        Name => 'AFPointSelection',
     6303        Mask => 0x10,
     6304        PrintConv => {
     6305            0 => '55 Points',
     6306            1 => '15 Points',
     6307        },
     6308    },
     6309    1.4 => { # CSa4
     6310        Name => 'Three-DTrackingFaceDetection',
     6311        Mask => 0x08,
     6312        PrintConv => \%offOn,
     6313    },
     6314    1.5 => { # CSa3-a
     6315        Name => 'BlockShotAFResponse',
     6316        Mask => 0x07,
     6317        PrintConv => {
     6318            1 => '1 (Quick)',
     6319            2 => '2',
     6320            3 => '3 (Normal)',
     6321            4 => '4',
     6322            5 => '5 (Delay)',
     6323        },
     6324    },
     6325    2.1 => { # CSa11
     6326        Name => 'FocusPointWrap',
     6327        Mask => 0x08,
     6328        PrintConv => {
     6329            0 => 'No Wrap',
     6330            1 => 'Wrap',
     6331        },
     6332    },
     6333    2.2 => { # CSa12-a
     6334        Name => 'AFPointBrightness',
     6335        Mask => 0x06,
     6336        PrintConv => {
     6337            0 => 'Auto',
     6338            1 => 'On',
     6339            2 => 'Off',
     6340        },
     6341    },
     6342    4.1 => { # CSd3
     6343        Name => 'ISODisplay',
     6344        Mask => 0x08,
     6345        PrintConv => {
     6346            0 => 'Show ISO Sensitivity',
     6347            1 => 'Show Frame Count',
     6348        },
     6349    },
     6350    4.2 => { # CSd9
     6351        Name => 'GridDisplay',
     6352        Mask => 0x02,
     6353        PrintConv => \%onOff,
     6354    },
     6355    5.1 => { # CSd10
     6356        Name => 'LCDIllumination',
     6357        Mask => 0x20,
     6358        PrintConv => \%offOn,
     6359    },
     6360    5.2 => { # CSd6
     6361        Name => 'ElectronicFront-CurtainShutter',
     6362        Mask => 0x08,
     6363        PrintConv => \%offOn,
     6364    },
     6365    6.1 => { # CSf7
     6366        Name => 'ReverseIndicators',
     6367        Mask => 0x80,
     6368        PrintConv => {
     6369            0 => '+ 0 -',
     6370            1 => '- 0 +',
     6371        },
     6372    },
     6373    6.2 => { # CSf4-a
     6374        Name => 'CommandDialsReverseRotation',
     6375        Mask => 0x18,
     6376        PrintConv => {
     6377            0 => 'No',
     6378            1 => 'Shutter Speed & Aperture',
     6379            2 => 'Exposure Compensation',
     6380            3 => 'Exposure Compensation, Shutter Speed & Aperture',
     6381        },
     6382    },
     6383    6.3 => { # CSb4
     6384        Name => 'EasyExposureCompensation',
     6385        Mask => 0x03,
     6386        PrintConv => {
     6387            0 => 'Off',
     6388            1 => 'On',
     6389            2 => 'On (Auto Reset)',
     6390        },
     6391    },
     6392    7.1 => { # CSb2
     6393        Name => 'ExposureControlStepSize',
     6394        Mask => 0xc0,
     6395        PrintConv => {
     6396            0 => '1/3 EV',
     6397            1 => '1/2 EV',
     6398            2 => '1 EV',
     6399        },
     6400    },
     6401    7.2 => { # CSb1
     6402        Name => 'ISOStepSize',
     6403        Mask => 0x30,
     6404        PrintConv => {
     6405            0 => '1/3 EV',
     6406            1 => '1/2 EV',
     6407            2 => '1 EV',
     6408        },
     6409    },
     6410    7.3 => { # CSb3
     6411        Name => 'ExposureCompStepSize',
     6412        Mask => 0x0c,
     6413        PrintConv => {
     6414            0 => '1/3 EV',
     6415            1 => '1/2 EV',
     6416            2 => '1 EV',
     6417        },
     6418    },
     6419    8.1 => { # CSb6
     6420        Name => 'CenterWeightedAreaSize',
     6421        Mask => 0xe0,
     6422        PrintConv => {
     6423            0 => '8 mm',
     6424            1 => '12 mm',
     6425            2 => '15 mm',
     6426            3 => '20 mm',
     6427            4 => 'Average',
     6428        },
     6429    },
     6430    8.2 => { # CSb7-a
     6431        Name => 'FineTuneOptMatrixMetering',
     6432        Mask => 0x0f,
     6433        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     6434        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     6435        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     6436        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     6437    },
     6438    9.1 => { # CSb7-b
     6439        Name => 'FineTuneOptCenterWeighted',
     6440        Mask => 0xf0,
     6441        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     6442        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     6443        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     6444        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     6445    },
     6446    9.2 => { # CSb7-c
     6447        Name => 'FineTuneOptSpotMetering',
     6448        Mask => 0x0f,
     6449        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     6450        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     6451        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     6452        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     6453    },
     6454    10.1 => { # CSf2-a
     6455        Name => 'MultiSelectorShootMode',
     6456        Mask => 0xe0,
     6457        PrintConv => {
     6458            0 => 'Select Center Focus Point (Reset)',
     6459            2 => 'Preset Focus Point (Pre)',
     6460            3 => 'Highlight Active Focus Point',
     6461            4 => 'Not Used (None)',
     6462        },
     6463    },
     6464    10.2 => { # CSf2-b
     6465        Name => 'MultiSelectorPlaybackMode',
     6466        Mask => 0x0c,
     6467        PrintConv => {
     6468            0 => 'Thumbnail On/Off',
     6469            1 => 'View Histograms',
     6470            2 => 'Zoom On/Off',
     6471            3 => 'Choose Folder',
     6472        },
     6473    },
     6474    10.3 => { # CSf5
     6475        Name => 'MultiSelector',
     6476        Mask => 0x01,
     6477        PrintConv => {
     6478            0 => 'Do Nothing',
     6479            1 => 'Reset Meter-off Delay',
     6480        },
     6481    },
     6482    11.1 => { # CSd5
     6483        Name => 'ExposureDelayMode',
     6484        Mask => 0xe0,
     6485        PrintConv => {
     6486            0 => 'Off',
     6487            1 => '0.2 s',          #new with the D850
     6488            2 => '0.5 s',          #new with the D850
     6489            3 => '1 s',
     6490            4 => '2 s',
     6491            5 => '3 s',
     6492        },
     6493    },
     6494    11.2 => { # CSd1
     6495        Name => 'CLModeShootingSpeed',
     6496        Mask => 0x0f,
     6497        PrintConv => '"$val fps"',
     6498        PrintConvInv => '$val=~s/\s*fps//i; $val',
     6499    },
     6500    12.1 => { # CSd2
     6501        Name => 'MaxContinuousRelease',
     6502        # values: 1-100
     6503    },
     6504    13.1 => { # CSe7
     6505        Name => 'AutoBracketOrder',
     6506        Mask => 0x10,
     6507        PrintConv => {
     6508            0 => '0,-,+',
     6509            1 => '-,0,+',
     6510        },
     6511    },
     6512    13.2 => { # CSe6
     6513        Name => 'AutoBracketModeM',
     6514        Mask => 0x0c,
     6515        PrintConv => {
     6516            0 => 'Flash/Speed',
     6517            1 => 'Flash/Speed/Aperture',
     6518            2 => 'Flash/Aperture',
     6519            3 => 'Flash Only',
     6520        },
     6521    },
     6522    14.1 => { # CSf1-c
     6523        Name => 'Func1Button',
     6524        Mask => 0x3f,
     6525        PrintConv => {
     6526            0 => 'None',
     6527            1 => 'Preview',
     6528            2 => 'FV Lock',
     6529            3 => 'AE/AF Lock',
     6530            4 => 'AE Lock Only',
     6531            5 => 'AE Lock (reset on release)',
     6532            6 => 'AE Lock (hold)',
     6533            7 => 'AF Lock Only',
     6534            8 => 'AF-On',
     6535            10 => 'Bracketing Burst',
     6536            11 => 'Matrix Metering',
     6537            12 => 'Center-weighted Metering',
     6538            13 => 'Spot Metering',
     6539            14 => 'Playback',
     6540            15 => 'My Menu Top Item',
     6541            16 => '+NEF(RAW)',
     6542            17 => 'Virtual Horizon',
     6543            19 => 'Grid Display',
     6544            20 => 'My Menu',
     6545            22 => 'Remote Release Only',
     6546            26 => 'Flash Disable/Enable',
     6547            27 => 'Highlight-weighted Metering',
     6548            36 => 'AF-Area Mode (Single)',
     6549            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     6550            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     6551            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     6552            40 => 'AF-Area Mode (Group Area AF)',
     6553            41 => 'AF-Area Mode (Auto Area AF)',
     6554            42 => 'AF-Area Mode + AF-On (Single)',
     6555            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     6556            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     6557            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     6558            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     6559            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     6560            49 => 'Sync Release (Master Only)',
     6561            50 => 'Sync Release (Remote Only)',
     6562            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     6563            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     6564        },
     6565    },
     6566    15.1 => { # CSf1-a
     6567        Name => 'PreviewButton',
     6568        Mask => 0x3f,
     6569        PrintConv => {
     6570            0 => 'None',
     6571            1 => 'Preview',
     6572            2 => 'FV Lock',
     6573            3 => 'AE/AF Lock',
     6574            4 => 'AE Lock Only',
     6575            5 => 'AE Lock (reset on release)',
     6576            6 => 'AE Lock (hold)',
     6577            7 => 'AF Lock Only',
     6578            8 => 'AF-On',
     6579            10 => 'Bracketing Burst',
     6580            11 => 'Matrix Metering',
     6581            12 => 'Center-weighted Metering',
     6582            13 => 'Spot Metering',
     6583            14 => 'Playback',
     6584            15 => 'My Menu Top Item',
     6585            16 => '+NEF(RAW)',
     6586            17 => 'Virtual Horizon',
     6587            19 => 'Grid Display',
     6588            20 => 'My Menu',
     6589            22 => 'Remote Release Only',
     6590            26 => 'Flash Disable/Enable',
     6591            27 => 'Highlight-weighted Metering',
     6592            36 => 'AF-Area Mode (Single)',
     6593            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     6594            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     6595            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     6596            40 => 'AF-Area Mode (Group Area AF)',
     6597            41 => 'AF-Area Mode (Auto Area AF)',
     6598            42 => 'AF-Area Mode + AF-On (Single)',
     6599            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     6600            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     6601            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     6602            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     6603            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     6604            49 => 'Sync Release (Master Only)',
     6605            50 => 'Sync Release (Remote Only)',
     6606            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     6607            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     6608        },
     6609    },
     6610    16.1 => { # CSf1-j
     6611        Name => 'AssignBktButton',
     6612        Mask => 0x07,
     6613        PrintConv => {
     6614            0 => 'Auto Bracketing',
     6615            1 => 'Multiple Exposure',
     6616            2 => 'HDR (high dynamic range)',
     6617            3 => 'None',
     6618        },
     6619    },
     6620    18.1 => { # CSf4-b
     6621        Name => 'CommandDialsChangeMainSub',
     6622        Mask => 0xe0,
     6623        PrintConv => {
     6624            0 => 'Autofocus Off, Exposure Off',
     6625            1 => 'Autofocus Off, Exposure On',
     6626            2 => 'Autofocus Off, Exposure On (Mode A)',
     6627            4 => 'Autofocus On, Exposure Off',
     6628            5 => 'Autofocus On, Exposure On',
     6629            6 => 'Autofocus On, Exposure On (Mode A)',
     6630        },
     6631    },
     6632    18.2 => { # CSf4-d
     6633        Name => 'CommandDialsMenuAndPlayback',
     6634        Mask => 0x18,
     6635        PrintConv => {
     6636            0 => 'On',
     6637            1 => 'Off',
     6638            2 => 'On (Image Review Excluded)',
     6639        },
     6640    },
     6641    18.3 => { # CSf4-c
     6642        Name => 'CommandDialsApertureSetting',
     6643        Mask => 0x04,
     6644        PrintConv => {
     6645            0 => 'Sub-command Dial',
     6646            1 => 'Aperture Ring',
     6647        },
     6648    },
     6649    18.4 => { # CSf6
     6650        Name => 'ReleaseButtonToUseDial',
     6651        Mask => 0x01,
     6652        PrintConv => \%noYes,
     6653    },
     6654    19.1 => { # CSc2
     6655        Name => 'StandbyTimer',
     6656        Mask => 0xf0,
     6657        PrintConv => {
     6658            0 => '4 s',
     6659            1 => '6 s',
     6660            3 => '10 s',
     6661            5 => '30 s',
     6662            6 => '1 min',
     6663            7 => '5 min',
     6664            8 => '10 min',
     6665            9 => '30 min',
     6666            10 => 'No Limit',
     6667        },
     6668    },
     6669    20.1 => { # CSc3-a
     6670        Name => 'SelfTimerTime',
     6671        Mask => 0xc0,
     6672        PrintConv => {
     6673            0 => '2 s',
     6674            1 => '5 s',
     6675            2 => '10 s',
     6676            3 => '20 s',
     6677        },
     6678    },
     6679    20.2 => { # CSc3-c
     6680        Name => 'SelfTimerShotInterval',
     6681        Mask => 0x30,
     6682        PrintConv => {
     6683            0 => '0.5 s',
     6684            1 => '1 s',
     6685            2 => '2 s',
     6686            3 => '3 s',
     6687        },
     6688    },
     6689    20.3 => { # CSc3-b
     6690        Name => 'SelfTimerShotCount',
     6691        Mask => 0x0f,
     6692    },
     6693    21.1 => { # CSc4-d
     6694        Name => 'ImageReviewMonitorOffTime',
     6695        Mask => 0xe0,
     6696        PrintConv => {
     6697            0 => '2 s',
     6698            1 => '4 s',
     6699            3 => '10 s',
     6700            4 => '20 s',
     6701            5 => '1 min',
     6702            6 => '5 min',
     6703            7 => '10 min',
     6704        },
     6705    },
     6706    21.2 => { # CSc4-e
     6707        Name => 'LiveViewMonitorOffTime',
     6708        Mask => 0x1c,
     6709        PrintConv => {
     6710            1 => '5 min',
     6711            2 => '10 min',
     6712            3 => '15 min',
     6713            4 => '20 min',
     6714            5 => '30 min',
     6715            6 => 'No Limit',
     6716        },
     6717    },
     6718    22.1 => { # CSc4-b
     6719        Name => 'MenuMonitorOffTime',
     6720        Mask => 0xe0,
     6721        PrintConv => {
     6722            0 => '4 s',
     6723            2 => '10 s',
     6724            4 => '20 s',
     6725            5 => '1 min',
     6726            6 => '5 min',
     6727            7 => '10 min',
     6728        },
     6729    },
     6730    22.2 => { # CSc4-c
     6731        Name => 'ShootingInfoMonitorOffTime',
     6732        Mask => 0x1c,
     6733        PrintConv => {
     6734            0 => '4 s',
     6735            2 => '10 s',
     6736            4 => '20 s',
     6737            5 => '1 min',
     6738            6 => '5 min',
     6739            7 => '10 min',
     6740        },
     6741    },
     6742    23.1 => { # CSe1
     6743        Name => 'FlashSyncSpeed',
     6744        Mask => 0xf0,
     6745        PrintConv => {
     6746            2 => '1/250 s (auto FP)',
     6747            3 => '1/250 s',
     6748            5 => '1/200 s',
     6749            6 => '1/160 s',
     6750            7 => '1/125 s',
     6751            8 => '1/100 s',
     6752            9 => '1/80 s',
     6753            10 => '1/60 s',
     6754        },
     6755    },
     6756    23.2 => { # CSe2
     6757        Name => 'FlashShutterSpeed',
     6758        Mask => 0x0f,
     6759        PrintConvColumns => 2,
     6760        PrintConv => {
     6761            0 => '1/60 s',
     6762            1 => '1/30 s',
     6763            2 => '1/15 s',
     6764            3 => '1/8 s',
     6765            4 => '1/4 s',
     6766            5 => '1/2 s',
     6767            6 => '1 s',
     6768            7 => '2 s',
     6769            8 => '4 s',
     6770            9 => '8 s',
     6771            10 => '15 s',
     6772            11 => '30 s',
     6773        },
     6774    },
     6775    31.1 => { # CSe5
     6776        Name => 'ModelingFlash',
     6777        Mask => 0x20,
     6778        PrintConv => \%onOff,
     6779    },
     6780    36.1 => { # CSc4-a
     6781        Name => 'PlaybackMonitorOffTime',
     6782        Mask => 0xe0,
     6783        PrintConv => {
     6784            0 => '4 s',
     6785            1 => '10 s',
     6786            2 => '20 s',
     6787            3 => '1 min',
     6788            4 => '5 min',
     6789            5 => '10 min',
     6790        },
     6791    },
     6792    37.1 => { # CSf2-c
     6793        Name => 'MultiSelectorLiveView',
     6794        Mask => 0xc0,
     6795        PrintConv => {
     6796            0 => 'Reset',
     6797            1 => 'Zoom',
     6798            3 => 'Not Used',
     6799        },
     6800    },
     6801    38.1 => { # CSf3-a
     6802        Name => 'ShutterSpeedLock',
     6803        Mask => 0x80,
     6804        PrintConv => \%offOn,
     6805    },
     6806    38.2 => { # CSf3-b
     6807        Name => 'ApertureLock',
     6808        Mask => 0x40,
     6809        PrintConv => \%offOn,
     6810    },
     6811    38.3 => { # CSg1-h
     6812        Name => 'MovieShutterButton',
     6813        Mask => 0x10,
     6814        PrintConv => {
     6815            0 => 'Take Photo',
     6816            1 => 'Record Movies',
     6817        },
     6818    },
     6819    38.4 => { # CSe3
     6820        Name => 'FlashExposureCompArea',
     6821        Mask => 0x04,
     6822        PrintConv => {
     6823            0 => 'Entire Frame',
     6824            1 => 'Background Only',
     6825        },
     6826    },
     6827    38.5 => { # CSe4
     6828        Name => 'AutoFlashISOSensitivity',
     6829        Mask => 0x02,
     6830        PrintConv => {
     6831            0 => 'Subject and Background',
     6832            1 => 'Subject Only',
     6833        },
     6834    },
     6835    41.1 => { # CSg1-c
     6836        Name => 'MovieFunc1Button',
     6837        Mask => 0xf0,
     6838        PrintConv => {
     6839            0 => 'None',
     6840            2 => 'Power Aperture (close)',
     6841            3 => 'Index Marking',
     6842            4 => 'View Photo Shooting Info',
     6843            11 => 'Exposure Compensation -',
     6844        },
     6845    },
     6846    41.2 => { # CSg1-a
     6847        Name => 'MoviePreviewButton',
     6848        Mask => 0x0f,
     6849        PrintConv => {
     6850            0 => 'None',
     6851            1 => 'Power Aperture (open)',
     6852            3 => 'Index Marking',
     6853            4 => 'View Photo Shooting Info',
     6854            10 => 'Exposure Compensation +',
     6855        },
     6856    },
     6857    42.1 => { # CSf1-d
     6858        Name => 'Func1ButtonPlusDials',
     6859        Mask => 0x0f,
     6860        PrintConv => {
     6861            0 => 'None',
     6862            1 => 'Choose Image Area',
     6863            2 => 'Shutter Speed & Aperture Lock',
     6864            3 => 'One Step Speed / Aperture',
     6865            4 => 'Choose Non-CPU Lens Number',
     6866            5 => 'Active D-Lighting',
     6867            7 => 'Photo Shooting Menu Bank',
     6868            8 => 'Exposure Delay Mode',
     6869        },
     6870    },
     6871    43.1 => { # CSf1-b
     6872        Name => 'PreviewButtonPlusDials',
     6873        Mask => 0x0f,
     6874        PrintConv => {
     6875            0 => 'None',
     6876            1 => 'Choose Image Area',
     6877            2 => 'Shutter Speed & Aperture Lock',
     6878            3 => 'One Step Speed / Aperture',
     6879            4 => 'Choose Non-CPU Lens Number',
     6880            5 => 'Active D-Lighting',
     6881            7 => 'Photo Shooting Menu Bank',
     6882            8 => 'Exposure Delay Mode',
     6883        },
     6884    },
     6885    45.1 => { # CSf1-k
     6886        Name => 'AssignMovieRecordButtonPlusDials',
     6887        Mask => 0x0f,
     6888        PrintConv => {
     6889            0 => 'None',
     6890            1 => 'Choose Image Area',
     6891            2 => 'Shutter Speed & Aperture Lock',
     6892            7 => 'Photo Shooting Menu Bank',
     6893            11 => 'Exposure Mode',
     6894        },
     6895    },
     6896    46.1 => { # CSb7-d
     6897        Name => 'FineTuneOptHighlightWeighted',
     6898        Mask => 0x0f,
     6899        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     6900        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     6901        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     6902        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     6903    },
     6904    47.1 => { # CSa12-c
     6905        Name => 'DynamicAreaAFDisplay',
     6906        Mask => 0x80,
     6907        PrintConv => \%offOn,
     6908    },
     6909    47.2 => { # CSa12-b
     6910        Name => 'AFPointIllumination',
     6911        Mask => 0x40,
     6912        PrintConv => {
     6913            0 => 'Off',
     6914            1 => 'On During Manual Focusing',
     6915        },
     6916    },
     6917    47.3 => { # CSa7
     6918        Name => 'StoreByOrientation',
     6919        Mask => 0x18,
     6920        PrintConv => {
     6921            0 => 'Off',
     6922            1 => 'Focus Point',
     6923            2 => 'Focus Point and AF-area Mode',
     6924        },
     6925    },
     6926    48.1 => { # CSb5
     6927        Name => 'MatrixMetering',
     6928        Mask => 0x80,
     6929        PrintConv => {
     6930            0 => 'Face Detection On',
     6931            1 => 'Face Detection Off',
     6932        },
     6933    },
     6934    48.2 => { # CSf8
     6935        Name => 'LiveViewButtonOptions',
     6936        Mask => 0x30,
     6937        PrintConv => {
     6938            0 => 'Enable',
     6939            1 => 'Enable (Standby Timer Active)',
     6940            2 => 'Disable',
     6941        },
     6942    },
     6943    48.3 => { # CSa10
     6944        Name => 'AFModeRestrictions',
     6945        Mask => 0x03,
     6946        PrintConv => {
     6947            0 => 'No Restrictions',
     6948            1 => 'AF-C',
     6949            2 => 'AF-S',
     6950        },
     6951    },
     6952    49.1 => { # CSa9
     6953        Name => 'LimitAFAreaModeSelection',  #note that 'Dynamic area (9 points)' can be selected from the camera menu but the setting is not written to the EXIF data.
     6954        Mask => 0x7e,                        #...This AF Mode was added to the D5 firmware several months after the camera's initial release which may help explain the inconsistency.
     6955        PrintConv => {
     6956            0 => 'No Restrictions',
     6957            BITMASK => {
     6958                0 => 'Auto-area',
     6959                1 => 'Group-area',
     6960                2 => '3D-tracking',
     6961                3 => 'Dynamic area (153 points)',
     6962                4 => 'Dynamic area (72 points)',
     6963                5 => 'Dynamic area (25 points)',
     6964          },
     6965        },
     6966    },
     6967    52.1 => { # CSf1-l
     6968        Name => 'LensFocusFunctionButtons',
     6969        Mask => 0x3f,
     6970        PrintConv => {
     6971            3 => 'AE/AF Lock',
     6972            4 => 'AE Lock Only',
     6973            7 => 'AF Lock Only',
     6974            8 => 'AF-On',
     6975            24 => 'Preset Focus Point',
     6976            26 => 'Flash Disable/Enable',
     6977            36 => 'AF-Area Mode (Single)',
     6978            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     6979            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     6980            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     6981            40 => 'AF-Area Mode (Group Area AF)',
     6982            41 => 'AF-Area Mode (Auto Area AF)',
     6983            42 => 'AF-Area Mode + AF-On (Single)',
     6984            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     6985            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     6986            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     6987            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     6988            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     6989            49 => 'Sync Release (Master Only)',
     6990            50 => 'Sync Release (Remote Only)',
     6991            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     6992            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     6993        },
     6994    },
     6995    66.1 => { # CSf10-d
     6996        Name => 'VerticalMultiSelector',
     6997        Mask => 0xff,
     6998        PrintHex => 1,
     6999        PrintConv => {
     7000            0x00 => 'Same as Multi-Selector with Info(U/D) & Playback(R/L)',
     7001            0x08 => 'Same as Multi-Selector with Info(R/L) & Playback(U/D)',
     7002            0x80 => 'Focus Point Selection',
     7003        },
     7004    },
     7005    67.1 => { # CSf10-a
     7006        Name => 'AssignMB-D18FuncButton',
     7007        Mask => 0x3f,
     7008        PrintConv => {
     7009            0 => 'None',
     7010            1 => 'Preview',
     7011            2 => 'FV Lock',
     7012            3 => 'AE/AF Lock',
     7013            4 => 'AE Lock Only',
     7014            5 => 'AE Lock (reset on release)',
     7015            6 => 'AE Lock (hold)',
     7016            7 => 'AF Lock Only',
     7017            8 => 'AF-On',
     7018            10 => 'Bracketing Burst',
     7019            11 => 'Matrix Metering',
     7020            12 => 'Center-weighted Metering',
     7021            13 => 'Spot Metering',
     7022            14 => 'Playback',
     7023            15 => 'My Menu Top Item',
     7024            16 => '+NEF(RAW)',
     7025            17 => 'Virtual Horizon',
     7026            18 => 'Reset Focus Point',
     7027            19 => 'Grid Display',
     7028            20 => 'My Menu',
     7029            22 => 'Remote Release Only',
     7030            23 => 'Preset Focus Point',
     7031            26 => 'Flash Disable/Enable',
     7032            27 => 'Highlight-weighted Metering',
     7033            36 => 'AF-Area Mode (Single)',
     7034            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     7035            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     7036            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     7037            40 => 'AF-Area Mode (Group Area AF)',
     7038            41 => 'AF-Area Mode (Auto Area AF)',
     7039            42 => 'AF-Area Mode + AF-On (Single)',
     7040            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     7041            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     7042            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     7043            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     7044            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     7045            49 => 'Sync Release (Master Only)',
     7046            50 => 'Sync Release (Remote Only)',
     7047            54 => 'Highlight Active Focus Point',
     7048            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     7049            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     7050        },
     7051    },
     7052    68.1 => { # CSf10-b
     7053        Name => 'AssignMB-D18FuncButtonPlusDials',
     7054        Mask => 0x0f,
     7055        PrintConv => {
     7056            0 => 'None',
     7057            1 => 'Choose Image Area',
     7058            2 => 'Shutter Speed & Aperture Lock',
     7059            3 => 'One Step Speed / Aperture',
     7060            4 => 'Choose Non-CPU Lens Number',
     7061            5 => 'Active D-Lighting',
     7062            7 => 'Photo Shooting Menu Bank',
     7063            8 => 'Exposure Delay Mode',
     7064            10 => 'ISO Sensitivity',
     7065            11 => 'Exposure Mode',
     7066            12 => 'Exposure Compensation',
     7067            13 => 'Metering Mode',
     7068        },
     7069    },
     7070    70.1 => { # CSf1-f
     7071        Name => 'AF-OnButton',
     7072        Mask => 0x3f,
     7073        PrintConv => {
     7074            0 => 'None',
     7075            3 => 'AE/AF Lock',
     7076            4 => 'AE Lock Only',
     7077            5 => 'AE Lock (reset on release)',
     7078            6 => 'AE Lock (hold)',
     7079            7 => 'AF Lock Only',
     7080            8 => 'AF-On',
     7081            36 => 'AF-Area Mode (Single)',
     7082            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     7083            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     7084            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     7085            40 => 'AF-Area Mode (Group Area AF)',
     7086            41 => 'AF-Area Mode (Auto Area AF)',
     7087            42 => 'AF-Area Mode + AF-On (Single)',
     7088            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     7089            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     7090            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     7091            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     7092            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     7093            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     7094            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     7095        },
     7096    },
     7097    71.1 => { # CSf1-g
     7098        Name => 'SubSelector',
     7099        Mask => 0x80,
     7100        PrintConv => {
     7101            0 => 'Focus Point Selection',
     7102            1 => 'Same as MultiSelector',
     7103        },
     7104    },
     7105    72.1 => { # CSf1-h
     7106        Name => 'SubSelectorCenter',
     7107        Mask => 0x3f,
     7108        PrintConv => {
     7109            0 => 'None',
     7110            1 => 'Preview',
     7111            2 => 'FV Lock',
     7112            3 => 'AE/AF Lock',
     7113            4 => 'AE Lock Only',
     7114            5 => 'AE Lock (reset on release)',
     7115            6 => 'AE Lock (hold)',
     7116            7 => 'AF Lock Only',
     7117            8 => 'AF-On',
     7118            10 => 'Bracketing Burst',
     7119            11 => 'Matrix Metering',
     7120            12 => 'Center-weighted Metering',
     7121            13 => 'Spot Metering',
     7122            14 => 'Playback',
     7123            15 => 'My Menu Top Item',
     7124            16 => '+NEF(RAW)',
     7125            17 => 'Virtual Horizon',
     7126            18 => 'Reset Focus Point',
     7127            19 => 'Grid Display',
     7128            20 => 'My Menu',
     7129            22 => 'Remote Release Only',
     7130            23 => 'Preset Focus Point',
     7131            26 => 'Flash Disable/Enable',
     7132            27 => 'Highlight-weighted Metering',
     7133            36 => 'AF-Area Mode (Single)',
     7134            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     7135            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     7136            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     7137            40 => 'AF-Area Mode (Group Area AF)',
     7138            41 => 'AF-Area Mode (Auto Area AF)',
     7139            42 => 'AF-Area Mode + AF-On (Single)',
     7140            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     7141            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     7142            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     7143            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     7144            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     7145            49 => 'Sync Release (Master Only)',
     7146            50 => 'Sync Release (Remote Only)',
     7147            54 => 'Highlight Active Focus Point',
     7148            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     7149            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     7150        },
     7151    },
     7152    73.1 => { # CSf1-i
     7153        Name => 'SubSelectorPlusDials',
     7154        Mask => 0x0f,
     7155        PrintConv => {
     7156            0 => 'None',
     7157            1 => 'Choose Image Area',
     7158            2 => 'Shutter Speed & Aperture Lock',
     7159            4 => 'Choose Non-CPU Lens Number',
     7160            7 => 'Photo Shooting Menu Bank',
     7161        },
     7162    },
     7163    74.1 => { # CSg1-f
     7164        Name => 'AssignMovieSubselector',
     7165        Mask => 0xf0,
     7166        PrintConv => {
     7167            0 => 'None',
     7168            3 => 'Index Marking',
     7169            4 => 'View Photo Shooting Info',
     7170            5 => 'AE/AF Lock',
     7171            6 => 'AE Lock (Only)',
     7172            7 => 'AE Lock (Hold)',
     7173            8 => 'AF Lock (Only)',
     7174        },
     7175    },
     7176    75.1 => { # CSg1-d
     7177        Name => 'AssignMovieFunc1ButtonPlusDials',
     7178        Mask => 0x10,
     7179        PrintConv => {
     7180            0  => 'None',
     7181            1  => 'Choose Image Area',
     7182        },
     7183    },
     7184    75.2 => { # CSg1-b
     7185        Name => 'AssignMoviePreviewButtonPlusDials',
     7186        Mask => 0x01,
     7187        PrintConv => {
     7188            0 => 'None',
     7189            1 => 'Choose Image Area',
     7190        },
     7191    },
     7192    76.1 => { # CSg1-g
     7193        Name => 'AssignMovieSubselectorPlusDials',
     7194        Mask => 0x10,
     7195        PrintConv => {
     7196            0  => 'None',
     7197            1  => 'Choose Image Area',
     7198        },
     7199    },
     7200    77.1 => { # CSd4
     7201        Name => 'SyncReleaseMode',
     7202        Mask => 0x80,
     7203        PrintConv => {
     7204            0 => 'No Sync',
     7205            1 => 'Sync',
     7206        },
     7207    },
     7208    77.2 => { # CSd11 (new with D850)
     7209        Name => 'ContinuousModeLiveView',
     7210        Mask => 0x40,
     7211        PrintConv => \%offOn,
     7212    },
     7213    78.1 => { # CSa5
     7214        Name => 'Three-DTrackingWatchArea',
     7215        Mask => 0x80,
     7216        PrintConv => {
     7217            0 => 'Wide',
     7218            1 => 'Normal',
     7219        },
     7220    },
     7221    78.2 => { # CSa3-b
     7222        Name => 'SubjectMotion',
     7223        Mask => 0x60,
     7224        PrintConv => {
     7225            0 => 'Steady',
     7226            1 => 'Middle',
     7227            2 => 'Erratic',
     7228        },
     7229    },
     7230    78.3 => { # CSa8
     7231        Name => 'AFActivation',
     7232        Mask => 0x08,
     7233        PrintConv => {
     7234            0 => 'Shutter/AF-On',
     7235            1 => 'AF-On Only',
     7236        },
     7237    },
     7238    78.4 => { # CSc1
     7239        Name => 'ShutterReleaseButtonAE-L',
     7240        Mask => 0x03,
     7241        PrintConv => {
     7242            0 => 'Off',
     7243            1 => 'On (Half Press)',
     7244            2 => 'On (Burst Mode)'
     7245        },
     7246    },
     7247    79.1 => { # CSf10-c
     7248        Name => 'AssignMB-D18AF-OnButton',
     7249        Mask => 0x7f,
     7250        PrintConv => {
     7251            0 => 'None',
     7252            3 => 'AE/AF Lock',
     7253            4 => 'AE Lock Only',
     7254            5 => 'AE Lock (reset on release)',
     7255            6 => 'AE Lock (hold)',
     7256            7 => 'AF Lock Only',
     7257            8 => 'AF-On',
     7258            36 => 'AF-Area Mode (Single)',
     7259            37 => 'AF-Area Mode (Dynamic Area 25 Points)',
     7260            38 => 'AF-Area Mode (Dynamic Area 72 Points)',
     7261            39 => 'AF-Area Mode (Dynamic Area 153 Points)',
     7262            40 => 'AF-Area Mode (Group Area AF)',
     7263            41 => 'AF-Area Mode (Auto Area AF)',
     7264            42 => 'AF-Area Mode + AF-On (Single)',
     7265            43 => 'AF-Area Mode + AF-On (Dynamic Area 25 Points)',
     7266            44 => 'AF-Area Mode + AF-On (Dynamic Area 72 Points)',
     7267            45 => 'AF-Area Mode + AF-On (Dynamic Area 153 Points)',
     7268            46 => 'AF-Area Mode + AF-On (Group Area AF)',
     7269            47 => 'AF-Area Mode + AF-On (Auto Area AF)',
     7270            56 => 'AF-Area Mode (Dynamic Area 9 Points)',
     7271            57 => 'AF-Area Mode + AF-On (Dynamic Area 9 Points)',
     7272            100 => 'Same as Camera AF-On Button',
     7273        },
     7274    },
     7275    80.1 => { # CSf1-e
     7276        Name => 'Func2Button',
     7277        Mask => 0x3f,
     7278        PrintConv => {
     7279            0 => 'None',
     7280            15 => 'My Menu Top Item',
     7281            20 => 'My Menu',
     7282            55 => 'Rating',
     7283        },
     7284    },
     7285    82.1 => { # CSg1-e
     7286        Name => 'AssignMovieFunc2Button',
     7287        Mask => 0x70,
     7288        PrintConv => {
     7289            0 => 'None',
     7290            3 => 'Index Marking',
     7291            4 => 'View Photo Shooting Info',
     7292        },
    28277293    },
    28287294);
     
    28437309        Mask => 0x60,
    28447310        PrintConv => {
    2845             0x00 => 'Single Area',
    2846             0x20 => 'Dynamic Area',
    2847             0x40 => 'Auto-area',
    2848             0x60 => '3D-tracking (11 points)',
     7311            0 => 'Single Area',
     7312            1 => 'Dynamic Area',
     7313            2 => 'Auto-area',
     7314            3 => '3D-tracking (11 points)',
    28497315        },
    28507316    },
     
    28527318        Name => 'AFAssist',
    28537319        Mask => 0x01,
    2854         PrintConv => {
    2855             0 => 'On',
    2856             1 => 'Off',
    2857         },
     7320        PrintConv => \%onOff,
    28587321    },
    28597322    2.1 => { # CSd1
     
    28617324        Mask => 0xc0,
    28627325        PrintConv => {
    2863             0x00 => 'Off',
    2864             0x40 => 'Low',
    2865             0x80 => 'High',
     7326            0 => 'Off',
     7327            1 => 'Low',
     7328            2 => 'High',
    28667329        },
    28677330    },
     
    28697332        Name => 'GridDisplay',
    28707333        Mask => 0x02,
    2871         PrintConv => {
    2872             0x00 => 'On',
    2873             0x02 => 'Off',
    2874         },
     7334        PrintConv => \%onOff,
    28757335    },
    28767336    2.3 => { # CSd3
    28777337        Name => 'ISODisplay',
    28787338        Mask => 0x08,
    2879         PrintConv => {
    2880             0x08 => 'Off',
    2881             0x00 => 'On',
    2882         },
     7339        PrintConv => \%onOff,
    28837340    },
    28847341    2.4 => { # CSf4
     
    28867343        Mask => 0x20,
    28877344        PrintConv => {
    2888             0x00 => 'Release Locked',
    2889             0x20 => 'Enable Release',
     7345            0 => 'Release Locked',
     7346            1 => 'Enable Release',
    28907347        },
    28917348    },
     
    28937350        Name => 'FileNumberSequence',
    28947351        Mask => 0x08,
    2895         PrintConv => { 0x00 => 'On', 0x08 => 'Off' },
     7352        PrintConv => \%onOff,
    28967353    },
    28977354    4.1 => { # CSa4
    28987355        Name => 'RangeFinder',
    28997356        Mask => 0x10,
    2900         PrintConv => { 0x00 => 'Off', 0x10 => 'On' },
     7357        PrintConv => \%offOn,
    29017358    },
    29027359    4.2 => { # CSd6
    29037360        Name => 'DateImprint',
    29047361        Mask => 0x08,
    2905         PrintConv => {
    2906             0x00 => 'Off',
    2907             0x08 => 'On',
    2908         },
     7362        PrintConv => \%offOn,
    29097363    },
    29107364    4.3 => { # CSf5
     
    29127366        Mask => 0x80,
    29137367        PrintConv => {
    2914             0x00 => '+ 0 -',
    2915             0x80 => '- 0 +',
     7368            0 => '+ 0 -',
     7369            1 => '- 0 +',
    29167370        },
    29177371    },
     
    29207374        Mask => 0x40,
    29217375        PrintConv => {
    2922             0x00 => '1/3 EV',
    2923             0x40 => '1/2 EV',
     7376            0 => '1/3 EV',
     7377            1 => '1/2 EV',
    29247378        },
    29257379    },
     
    29277381        Name => 'ExposureDelayMode',
    29287382        Mask => 0x40,
    2929         PrintConv => {
    2930             0x00 => 'Off',
    2931             0x40 => 'On',
    2932         },
     7383        PrintConv => \%offOn,
    29337384    },
    29347385    11.1 => { # CSe2
     
    29367387        Mask => 0xc0,
    29377388        PrintConv => {
    2938             0x00 => 'Exposure',
    2939             0x40 => 'Active D-Lighting', #(NC)
    2940             0x80 => 'WB Bracketing',
     7389            0 => 'Exposure',
     7390            # (NOTE: the following are reversed in the D5100 -- is this correct?)
     7391            1 => 'Active D-Lighting', #(NC)
     7392            2 => 'WB Bracketing',
    29417393        },
    29427394    },
     
    29457397        Mask => 0x38,
    29467398        PrintConv => {
    2947             0x00 => 'Self-timer',
    2948             0x08 => 'Release Mode',
    2949             0x10 => 'Image Quality/Size', #(NC)
    2950             0x18 => 'ISO', #(NC)
    2951             0x20 => 'White Balance', #(NC)
    2952             0x28 => 'Active D-Lighting', #(NC)
    2953             0x30 => '+ NEF (RAW)',
    2954             0x38 => 'Auto Bracketing',
     7399            0 => 'Self-timer',
     7400            1 => 'Release Mode',
     7401            2 => 'Image Quality/Size', #(NC)
     7402            3 => 'ISO', #(NC)
     7403            4 => 'White Balance', #(NC)
     7404            5 => 'Active D-Lighting', #(NC)
     7405            6 => '+ NEF (RAW)',
     7406            7 => 'Auto Bracketing',
    29557407        },
    29567408    },
     
    29597411        Mask => 0x38,
    29607412        PrintConv => {
    2961             0x00 => 'AE/AF Lock',
    2962             0x08 => 'AE Lock Only', #(NC)
    2963             0x10 => 'AF Lock Only', #(NC)
    2964             0x18 => 'AE Lock (hold)',
    2965             0x20 => 'AF-ON',
     7413            0 => 'AE/AF Lock',
     7414            1 => 'AE Lock Only', #(NC)
     7415            2 => 'AF Lock Only', #(NC)
     7416            3 => 'AE Lock (hold)',
     7417            4 => 'AF-ON',
    29667418        },
    29677419    },
     
    29697421        Name => 'ShutterReleaseButtonAE-L',
    29707422        Mask => 0x02,
    2971         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     7423        PrintConv => \%offOn,
    29727424    },
    29737425    16.2 => { # CSf3
    29747426        Name => 'CommandDialsReverseRotation',
    29757427        Mask => 0x80,
    2976         PrintConv => { 0x00 => 'No', 0x80 => 'Yes' },
     7428        PrintConv => \%noYes,
    29777429    },
    29787430    17.1 => { # CSc2-c
     
    29807432        Mask => 0x70,
    29817433        PrintConv => {
    2982             0x00 => '4 s',
    2983             0x10 => '8 s',
    2984             0x20 => '20 s',
    2985             0x30 => '1 min',
    2986             0x40 => '30 min',
     7434            0 => '4 s',
     7435            1 => '8 s',
     7436            2 => '20 s',
     7437            3 => '1 min',
     7438            4 => '30 min',
    29877439        },
    29887440    },
     
    29917443        Mask => 0x03,
    29927444        PrintConv => {
    2993             0x00 => '1 min',
    2994             0x01 => '5 min',
    2995             0x02 => '10 min',
    2996             0x03 => '15 min',
     7445            0 => '1 min',
     7446            1 => '5 min',
     7447            2 => '10 min',
     7448            3 => '15 min',
    29977449        },
    29987450    },
     
    30017453        Mask => 0xc0,
    30027454        PrintConv => {
    3003             0x00 => '2 s',
    3004             0x40 => '5 s',
    3005             0x80 => '10 s',
    3006             0xc0 => '20 s',
     7455            0 => '2 s',
     7456            1 => '5 s',
     7457            2 => '10 s',
     7458            3 => '20 s',
    30077459        },
    30087460    },
     
    30107462        Name => 'SelfTimerShotCount',
    30117463        Mask => 0x1e,
    3012         ValueConv => '$val >> 1',
    3013         ValueConvInv => '$val << 1',
    30147464    },
    30157465    19.1 => { # CSc2-b
     
    30177467        Mask => 0xe0,
    30187468        PrintConv => {
    3019             0x00 => '4 s',
    3020             0x20 => '8 s',
    3021             0x40 => '20 s',
    3022             0x60 => '1 min',
    3023             0x80 => '10 min',
     7469            0 => '4 s',
     7470            1 => '8 s',
     7471            2 => '20 s',
     7472            3 => '1 min',
     7473            4 => '10 min',
    30247474        },
    30257475    },
     
    30287478        Mask => 0xe0,
    30297479        PrintConv => {
    3030             0x00 => '8 s',
    3031             0x20 => '12 s',
    3032             0x40 => '20 s',
    3033             0x60 => '1 min',
    3034             0x80 => '10 min',
     7480            0 => '8 s',
     7481            1 => '12 s',
     7482            2 => '20 s',
     7483            3 => '1 min',
     7484            4 => '10 min',
    30357485        },
    30367486    },
     
    30397489        Mask => 0xc0,
    30407490        PrintConv => {
    3041             0x00 => 'TTL',
    3042             0x40 => 'Manual',
     7491            0 => 'TTL',
     7492            1 => 'Manual',
    30437493        },
    30447494    },
     
    30587508        Mask => 0x60,
    30597509        PrintConv => {
    3060             0x00 => 'Face Priority',
    3061             0x20 => 'Wide Area',
    3062             0x40 => 'Normal Area',
    3063             0x60 => 'Subject Tracking',
    3064         },
     7510            0 => 'Face Priority',
     7511            1 => 'Wide Area',
     7512            2 => 'Normal Area',
     7513            3 => 'Subject Tracking',
     7514        },
     7515    },
     7516);
     7517
     7518# D5100 custom settings (ref PH)
     7519%Image::ExifTool::NikonCustom::SettingsD5100 = (
     7520    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     7521    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     7522    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     7523    WRITABLE => 1,
     7524    FIRST_ENTRY => 0,
     7525    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     7526    NOTES => 'Custom settings for the D5100.',
     7527    0.1 => { # CSa1
     7528        Name => 'AF-CPrioritySelection',
     7529        Mask => 0x80,
     7530        PrintConv => {
     7531            0 => 'Release',
     7532            1 => 'Focus',
     7533        },
     7534    },
     7535    1.1 => { # CSa2
     7536        Name => 'AFAssist',
     7537        Mask => 0x01,
     7538        PrintConv => \%onOff,
     7539    },
     7540    3.1 => { # CSd1
     7541        Name => 'Beep',
     7542        Mask => 0xc0,
     7543        PrintConv => {
     7544            0 => 'Off',
     7545            1 => 'Low',
     7546            2 => 'High',
     7547        },
     7548    },
     7549    3.2 => { # CSf4
     7550        Name => 'NoMemoryCard',
     7551        Mask => 0x20,
     7552        PrintConv => {
     7553            0 => 'Release Locked',
     7554            1 => 'Enable Release',
     7555        },
     7556    },
     7557    3.3 => { # CSd2
     7558        Name => 'ISODisplay',
     7559        Mask => 0x08,
     7560        PrintConv => \%onOff,
     7561    },
     7562    4.1 => { # CSd3
     7563        Name => 'FileNumberSequence',
     7564        Mask => 0x08,
     7565        PrintConv => \%onOff,
     7566    },
     7567    5.1 => { # CSa3
     7568        Name => 'RangeFinder',
     7569        Mask => 0x10,
     7570        PrintConv => \%offOn,
     7571    },
     7572    # (it looks like CSd5 DateImprint is not stored)
     7573    5.2 => { # CSf5
     7574        Name => 'ReverseIndicators',
     7575        Mask => 0x80,
     7576        PrintConv => {
     7577            0 => '+ 0 -',
     7578            1 => '- 0 +',
     7579        },
     7580    },
     7581    6.1 => { # CSb1
     7582        Name => 'EVStepSize',
     7583        Mask => 0x40,
     7584        PrintConv => {
     7585            0 => '1/3 EV',
     7586            1 => '1/2 EV',
     7587        },
     7588    },
     7589    10.1 => { # CSd4
     7590        Name => 'ExposureDelayMode',
     7591        Mask => 0x40,
     7592        PrintConv => \%offOn,
     7593    },
     7594    12.1 => { # CSe2
     7595        Name => 'AutoBracketSet',
     7596        Mask => 0xc0,
     7597        PrintConv => {
     7598            0 => 'Exposure',
     7599            # (NOTE: the following are reversed from the D5000 -- is D5000 correct?)
     7600            1 => 'WB Bracketing',
     7601            2 => 'Active D-Lighting',
     7602        },
     7603    },
     7604    13.1 => { # CSf1
     7605        Name => 'TimerFunctionButton',
     7606        Mask => 0x38,
     7607        PrintConv => {
     7608            0 => 'Self-timer',
     7609            1 => 'Release Mode',
     7610            2 => 'Image Quality/Size',
     7611            3 => 'ISO',
     7612            4 => 'White Balance',
     7613            5 => 'Active D-Lighting',
     7614            6 => '+ NEF (RAW)',
     7615            7 => 'Auto Bracketing',
     7616        },
     7617    },
     7618    16.1 => { # CSf2
     7619        Name => 'AELockButton',
     7620        Mask => 0x38,
     7621        PrintConv => {
     7622            0 => 'AE/AF Lock',
     7623            1 => 'AE Lock Only',
     7624            2 => 'AF Lock Only',
     7625            3 => 'AE Lock (hold)',
     7626            4 => 'AF-ON',
     7627        },
     7628    },
     7629    17.1 => { # CSc1
     7630        Name => 'ShutterReleaseButtonAE-L',
     7631        Mask => 0x02,
     7632        PrintConv => \%offOn,
     7633    },
     7634    17.2 => { # CSf3
     7635        Name => 'CommandDialsReverseRotation',
     7636        Mask => 0x80,
     7637        PrintConv => \%noYes,
     7638    },
     7639    18.1 => { # CSc2-d
     7640        Name => 'MeteringTime',
     7641        Mask => 0x70,
     7642        PrintConv => {
     7643            0 => '4 s',
     7644            1 => '8 s',
     7645            2 => '20 s', #(NC)
     7646            3 => '1 min',
     7647            4 => '30 min', #(NC)
     7648        },
     7649    },
     7650    18.2 => { # CSc4
     7651        Name => 'RemoteOnDuration',
     7652        Mask => 0x03,
     7653        PrintConv => {
     7654            0 => '1 min',
     7655            1 => '5 min',
     7656            2 => '10 min', #(NC)
     7657            3 => '20 min', # (but picture in manual shows 15 min)
     7658        },
     7659    },
     7660    19.1 => { # CSc3-a
     7661        Name => 'SelfTimerTime',
     7662        Mask => 0xc0,
     7663        PrintConv => {
     7664            0 => '2 s',
     7665            1 => '5 s',
     7666            2 => '10 s',
     7667            3 => '20 s',
     7668        },
     7669    },
     7670    19.2 => { # CSc3-b
     7671        Name => 'SelfTimerShotCount',
     7672        Mask => 0x0f,
     7673    },
     7674    20.1 => { # CSc2-b
     7675        Name => 'ImageReviewTime',
     7676        Mask => 0xe0,
     7677        PrintConv => {
     7678            0 => '4 s',
     7679            1 => '8 s', #(NC)
     7680            2 => '20 s',
     7681            3 => '1 min', #(NC)
     7682            4 => '10 min', #(NC)
     7683        },
     7684    },
     7685    20.2 => { # CSc2-c
     7686        Name => 'LiveViewMonitorOffTime',
     7687        Mask => 0x1c,
     7688        PrintConv => {
     7689            0 => '3 min',
     7690            1 => '5 min', #(NC)
     7691            2 => '10 min',
     7692            3 => '15 min', #(NC)
     7693            4 => '20 min', #(NC)
     7694            5 => '30 min', #(NC)
     7695        },
     7696    },
     7697    21.1 => { # CSc2-a
     7698        Name => 'PlaybackMenusTime',
     7699        Mask => 0xe0,
     7700        PrintConv => {
     7701            0 => '8 s', #(NC)
     7702            1 => '12 s',
     7703            2 => '20 s',
     7704            3 => '1 min',
     7705            4 => '10 min', #(NC)
     7706        },
     7707    },
     7708    23.1 => { # CSe1-a
     7709        Name => 'InternalFlash',
     7710        Mask => 0xc0,
     7711        PrintConv => {
     7712            0 => 'TTL',
     7713            1 => 'Manual',
     7714        },
     7715    },
     7716    23.1 => { # CSe1-b
     7717        Name => 'ManualFlashOutput',
     7718        Mask => 0x1f,
     7719        ValueConv => '2 ** (-$val/3)',
     7720        ValueConvInv => '$val > 0 ? -3*log($val)/log(2) : 0',
     7721        PrintConv => q{
     7722            return 'Full' if $val > 0.99;
     7723            Image::ExifTool::Exif::PrintExposureTime($val);
     7724        },
     7725        PrintConvInv => '$val=~/F/i ? 1 : Image::ExifTool::Exif::ConvertFraction($val)',
     7726    },
     7727);
     7728
     7729# D5200 custom settings (ref PH)
     7730%Image::ExifTool::NikonCustom::SettingsD5200 = (
     7731    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     7732    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     7733    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     7734    WRITABLE => 1,
     7735    FIRST_ENTRY => 0,
     7736    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     7737    NOTES => 'Custom settings for the D5200.',
     7738    0.1 => { # CSa1
     7739        Name => 'AF-CPrioritySelection',
     7740        Mask => 0x80,
     7741        PrintConv => {
     7742            0 => 'Release',
     7743            1 => 'Focus',
     7744        },
     7745    },
     7746    0.2 => { # CSa2
     7747        Name => 'NumberOfFocusPoints',
     7748        Mask => 0x10,
     7749        PrintConv => {
     7750            0 => '39 Points',
     7751            1 => '11 Points',
     7752        },
     7753    },
     7754    1.1 => { # CSa3
     7755        Name => 'AFAssist',
     7756        Mask => 0x01,
     7757        PrintConv => \%onOff,
     7758    },
     7759    3.1 => { # CSd1
     7760        Name => 'Beep',
     7761        Mask => 0xc0,
     7762        PrintConv => {
     7763            0 => 'Off',
     7764            1 => 'Low',
     7765            2 => 'High',
     7766        },
     7767    },
     7768    3.2 => { # CSf4
     7769        Name => 'NoMemoryCard',
     7770        Mask => 0x20,
     7771        PrintConv => {
     7772            0 => 'Release Locked',
     7773            1 => 'Enable Release',
     7774        },
     7775    },
     7776    3.3 => { # CSd3
     7777        Name => 'ISODisplay',
     7778        Mask => 0x08,
     7779        PrintConv => \%onOff,
     7780    },
     7781    4.1 => { # CSd3
     7782        Name => 'FileNumberSequence',
     7783        Mask => 0x08,
     7784        PrintConv => \%onOff,
     7785    },
     7786    5.1 => { # CSa4
     7787        Name => 'RangeFinder',
     7788        Mask => 0x04,
     7789        PrintConv => \%offOn,
     7790    },
     7791    5.2 => { # CSf3-a
     7792        Name => 'ReverseExposureCompDial',
     7793        Mask => 0x10,
     7794        PrintConv => \%noYes,
     7795    },
     7796    5.3 => { # CSf3-b
     7797        Name => 'ReverseShutterSpeedAperture',
     7798        Mask => 0x08,
     7799        PrintConv => \%noYes,
     7800    },
     7801    5.4 => { # CSf5
     7802        Name => 'ReverseIndicators',
     7803        Mask => 0x80,
     7804        PrintConv => {
     7805            0 => '+ 0 -',
     7806            1 => '- 0 +',
     7807        },
     7808    },
     7809    6.1 => { # CSb1
     7810        Name => 'EVStepSize',
     7811        Mask => 0x40, # (bit 0x04 also changes)
     7812        PrintConv => {
     7813            0 => '1/3 EV',
     7814            1 => '1/2 EV',
     7815        },
     7816    },
     7817    10.1 => { # CSd5
     7818        Name => 'ExposureDelayMode',
     7819        Mask => 0x40,
     7820        PrintConv => { 0 => 'Off', 1 => 'On' },
     7821    },
     7822    12.1 => { # CSe2
     7823        Name => 'AutoBracketSet',
     7824        Mask => 0xc0,
     7825        PrintConv => {
     7826            0 => 'Exposure',
     7827            # (NOTE: the following are reversed from the D5000 -- is D5000 correct?)
     7828            1 => 'WB Bracketing',
     7829            2 => 'Active D-Lighting',
     7830        },
     7831    },
     7832    13.1 => { # CSf1
     7833        Name => 'FunctionButton',
     7834        Mask => 0x1f,
     7835        PrintConv => {
     7836            3 => 'AE/AF Lock',
     7837            4 => 'AE Lock Only',
     7838            6 => 'AE Lock (hold)',
     7839            7 => 'AF Lock Only',
     7840            8 => 'AF-ON',
     7841            16 => '+ NEF (RAW)',
     7842            18 => 'Active D-Lighting',
     7843            25 => 'Live View',
     7844            26 => 'Image Quality',
     7845            27 => 'ISO',
     7846            28 => 'White Balance',
     7847            29 => 'HDR',
     7848            30 => 'Auto Bracketing',
     7849            31 => 'AF-area Mode',
     7850        },
     7851    },
     7852    16.1 => { # CSf2
     7853        Name => 'AELockButton',
     7854        Mask => 0x0f,
     7855        PrintConv => {
     7856            3 => 'AE/AF Lock',
     7857            4 => 'AE Lock Only',
     7858            6 => 'AE Lock (hold)',
     7859            7 => 'AF Lock Only',
     7860            8 => 'AF-ON',
     7861        },
     7862    },
     7863    17.1 => { # CSc1
     7864        Name => 'ShutterReleaseButtonAE-L',
     7865        Mask => 0x02,
     7866        PrintConv => \%offOn,
     7867    },
     7868    18.1 => { # CSc2-d
     7869        Name => 'StandbyTimer',
     7870        Mask => 0xe0,
     7871        PrintConv => {
     7872            0 => '4 s',
     7873            1 => '8 s',
     7874            2 => '20 s',
     7875            3 => '1 min',
     7876            4 => '30 min',
     7877        },
     7878    },
     7879    18.2 => { # CSc4
     7880        Name => 'RemoteOnDuration',
     7881        Mask => 0x03,
     7882        PrintConv => {
     7883            0 => '1 min',
     7884            1 => '5 min',
     7885            2 => '10 min',
     7886            3 => '15 min',
     7887        },
     7888    },
     7889    19.1 => { # CSc3-a
     7890        Name => 'SelfTimerTime',
     7891        Mask => 0xc0,
     7892        PrintConv => {
     7893            0 => '2 s',
     7894            1 => '5 s',
     7895            2 => '10 s',
     7896            3 => '20 s',
     7897        },
     7898    },
     7899    19.2 => { # CSc3-b
     7900        Name => 'SelfTimerShotCount',
     7901        Mask => 0x0f,
     7902    },
     7903    20.1 => { # CSc2-b
     7904        Name => 'ImageReviewTime',
     7905        Mask => 0xe0,
     7906        PrintConv => {
     7907            1 => '4 s',
     7908            2 => '8 s',
     7909            4 => '20 s',
     7910            5 => '1 min',
     7911            7 => '10 min',
     7912        },
     7913    },
     7914    20.2 => { # CSc2-c
     7915        Name => 'LiveViewMonitorOffTime',
     7916        Mask => 0x1c,
     7917        PrintConv => {
     7918            1 => '5 min',
     7919            2 => '10 min',
     7920            3 => '15 min',
     7921            4 => '20 min',
     7922            5 => '30 min',
     7923        },
     7924    },
     7925    21.1 => { # CSc2-a
     7926        Name => 'PlaybackMenusTime',
     7927        Mask => 0xe0,
     7928        PrintConv => {
     7929            1 => '8 s',
     7930            4 => '20 s',
     7931            5 => '1 min',
     7932            6 => '5 min',
     7933            7 => '10 min',
     7934        },
     7935    },
     7936    23.1 => { # CSe1-a
     7937        Name => 'InternalFlash',
     7938        Mask => 0xc0,
     7939        PrintConv => {
     7940            0 => 'TTL',
     7941            1 => 'Manual',
     7942        },
     7943    },
     7944    23.2 => { # CSe1-b
     7945        Name => 'ManualFlashOutput',
     7946        Mask => 0x1f,
     7947        ValueConv => '2 ** (-$val/3)',
     7948        ValueConvInv => '$val > 0 ? -3*log($val)/log(2) : 0',
     7949        PrintConv => q{
     7950            return 'Full' if $val > 0.99;
     7951            Image::ExifTool::Exif::PrintExposureTime($val);
     7952        },
     7953        PrintConvInv => '$val=~/F/i ? 1 : Image::ExifTool::Exif::ConvertFraction($val)',
    30657954    },
    30667955);
     
    30807969        Mask => 0x80,
    30817970        PrintConv => {
    3082             0x00 => 'Release',
    3083             0x80 => 'Focus',
     7971            0 => 'Release',
     7972            1 => 'Focus',
    30847973        },
    30857974    },
     
    30887977        Mask => 0x20,
    30897978        PrintConv => {
    3090             0x00 => 'Focus',
    3091             0x20 => 'Release',
     7979            0 => 'Focus',
     7980            1 => 'Release',
    30927981        },
    30937982    },
     
    30967985        Mask => 0x10,
    30977986        PrintConv => {
    3098             0x00 => '39 Points',
    3099             0x10 => '11 Points',
     7987            0 => '39 Points',
     7988            1 => '11 Points',
    31007989        },
    31017990    },
     
    31047993        Mask => 0x07,
    31057994        PrintConv => {
    3106             0x05 => '5 Long',
    3107             0x04 => '4',
    3108             0x03 => '3 Normal',
    3109             0x02 => '2',
    3110             0x01 => '1 Short',
    3111             0x00 => 'Off',
    3112         },
    3113     },
    3114     1.2 => { # CSa5
     7995            0 => 'Off',
     7996            1 => '1 Short',
     7997            2 => '2',
     7998            3 => '3 Normal',
     7999            4 => '4',
     8000            5 => '5 Long',
     8001        },
     8002    },
     8003    1.1 => { # CSa5
    31158004        Name => 'FocusPointWrap',
    31168005        Mask => 0x08,
    31178006        PrintConv => {
    3118             0x00 => 'No Wrap',
    3119             0x08 => 'Wrap',
    3120         },
    3121     },
    3122     1.3 => { # CSa4
     8007            0 => 'No Wrap',
     8008            1 => 'Wrap',
     8009        },
     8010    },
     8011    1.2 => { # CSa4
    31238012        Name => 'AFPointIllumination',
    31248013        Mask => 0x06,
    31258014        PrintConv => {
    3126             0x00 => 'Auto',
    3127             0x02 => 'On',
    3128             0x04 => 'Off',
    3129         },
    3130     },
    3131     1.4 => { # CSa7
     8015            0 => 'Auto',
     8016            1 => 'On',
     8017            2 => 'Off',
     8018        },
     8019    },
     8020    1.3 => { # CSa7
    31328021        Name => 'AFAssist',
    31338022        Mask => 0x01,
    3134         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     8023        PrintConv => \%onOff,
    31358024    },
    31368025    2.1 => { # CSd14
     
    31388027        Mask => 0x40,
    31398028        PrintConv => {
    3140             0x00 => 'MB-D11 First',
    3141             0x40 => 'Camera Battery First',
     8029            0 => 'MB-D11 First',
     8030            1 => 'Camera Battery First',
    31428031        },
    31438032    },
     
    31468035        Mask => 0x1c,
    31478036        PrintConv => {
    3148             0x00 => 'AE/AF Lock',
    3149             0x04 => 'AE Lock Only',
    3150             0x08 => 'AF Lock Only',
    3151             0x0c => 'AE Lock (hold)',
    3152             0x10 => 'AF-ON',
    3153             0x14 => 'FV Lock',
    3154             0x18 => 'Same as FUNC Button',
     8037            0 => 'AE/AF Lock',
     8038            1 => 'AE Lock Only',
     8039            2 => 'AF Lock Only',
     8040            3 => 'AE Lock (hold)',
     8041            4 => 'AF-ON',
     8042            5 => 'FV Lock',
     8043            6 => 'Same as FUNC Button',
    31558044        },
    31568045    },
     
    31598048        Mask => 0x03,
    31608049        PrintConv => {
    3161             0x00 => 'LR6 (AA alkaline)',
    3162             0x01 => 'Ni-MH (AA Ni-MH)',
    3163             0x02 => 'FR6 (AA lithium)',
     8050            0 => 'LR6 (AA alkaline)',
     8051            1 => 'Ni-MH (AA Ni-MH)',
     8052            2 => 'FR6 (AA lithium)',
    31648053        },
    31658054    },
     
    31688057        Mask => 0xc0,
    31698058        PrintConv => {
    3170             0x00 => 'Off',
    3171             0x40 => 'Low',
    3172             0x80 => 'High',
     8059            0 => 'Off',
     8060            1 => 'Low',
     8061            2 => 'High',
    31738062        },
    31748063    },
     
    31778066        Mask => 0x20,
    31788067        PrintConv => {
    3179             0x00 => 'Release Locked',
    3180             0x20 => 'Enable Release',
     8068            0 => 'Release Locked',
     8069            1 => 'Enable Release',
    31818070        },
    31828071    },
     
    31858074        Mask => 0x0c,
    31868075        PrintConv => {
    3187             0x00 => 'Show ISO/Easy ISO',
    3188             0x04 => 'Show ISO Sensitivity',
    3189             0x0c => 'Show Frame Count',
     8076            0 => 'Show ISO/Easy ISO',
     8077            1 => 'Show ISO Sensitivity',
     8078            3 => 'Show Frame Count',
    31908079        },
    31918080    },
     
    31938082        Name => 'GridDisplay',
    31948083        Mask => 0x02,
    3195         PrintConv => { 0x00 => 'On', 0x02 => 'Off' },
     8084        PrintConv => \%onOff,
    31968085    },
    31978086    3.5 => { # CSd4
    31988087        Name => 'ViewfinderWarning',
    31998088        Mask => 0x01,
    3200         PrintConv => { 0x00 => 'On', 0x01 => 'Off' },
     8089        PrintConv => \%onOff,
    32018090    },
    32028091    4.1 => { # CSd9
     
    32048093        Mask => 0xc0,
    32058094        PrintConv => {
    3206             0x00 => 'Auto',
    3207             0x80 => 'Manual (dark on light)',
    3208             0xc0 => 'Manual (light on dark)',
     8095            0 => 'Auto',
     8096            2 => 'Manual (dark on light)',
     8097            3 => 'Manual (light on dark)',
    32098098        },
    32108099    },
     
    32128101        Name => 'LCDIllumination',
    32138102        Mask => 0x20,
    3214         PrintConv => { 0x00 => 'Off', 0x20 => 'On' },
     8103        PrintConv => \%offOn,
    32158104    },
    32168105    4.3 => { # CSd8
    32178106        Name => 'FileNumberSequence',
    32188107        Mask => 0x08,
    3219         PrintConv => { 0x00 => 'On', 0x08 => 'Off' },
     8108        PrintConv => \%onOff,
    32208109    },
    32218110    4.4 => { # CSd5
    32228111        Name => 'ScreenTips',
    32238112        Mask => 0x04,
    3224         PrintConv => { 0x00 => 'Off', 0x04 => 'On' },
     8113        PrintConv => \%offOn,
    32258114    },
    32268115    4.5 => { # CSd1-a
     
    32288117        Mask => 0x03,
    32298118        PrintConv => {
    3230             0x00 => 'Off',
    3231             0x01 => '1',
    3232             0x02 => '2',
    3233             0x03 => '3',
     8119            0 => 'Off',
     8120            1 => '1',
     8121            2 => '2',
     8122            3 => '3',
    32348123        },
    32358124    },
     
    32388127        Mask => 0x80,
    32398128        PrintConv => {
    3240             0x00 => '+ 0 -',
    3241             0x80 => '- 0 +',
     8129            0 => '+ 0 -',
     8130            1 => '- 0 +',
    32428131        },
    32438132    },
     
    32468135        Mask => 0x03,
    32478136        PrintConv => {
    3248             0x00 => 'Off',
    3249             0x01 => 'On',
    3250             0x02 => 'On Auto Reset',
     8137            0 => 'Off',
     8138            1 => 'On',
     8139            2 => 'On Auto Reset',
    32518140        },
    32528141    },
     
    32558144        Mask => 0x40,
    32568145        PrintConv => {
    3257             0x00 => '1/3 EV',
    3258             0x40 => '1/2 EV',
     8146            0 => '1/3 EV',
     8147            1 => '1/2 EV',
    32598148        },
    32608149    },
     
    32638152        Mask => 0x10,
    32648153        PrintConv => {
    3265             0x00 => '1/3 EV',
    3266             0x10 => '1/2 EV',
     8154            0 => '1/3 EV',
     8155            1 => '1/2 EV',
    32678156        },
    32688157    },
     
    32718160        Mask => 0xe0,
    32728161        PrintConv => {
    3273             0x00 => '6 mm',
    3274             0x20 => '8 mm',
    3275             0x40 => '10 mm',
    3276             0x60 => '13 mm',
    3277             0x80 => 'Average',
     8162            0 => '6 mm',
     8163            1 => '8 mm',
     8164            2 => '10 mm',
     8165            3 => '13 mm',
     8166            4 => 'Average',
    32788167        },
    32798168    },
     
    32818170        Name => 'ExposureDelayMode',
    32828171        Mask => 0x40,
    3283         PrintConv => {
    3284             0x00 => 'Off',
    3285             0x40 => 'On',
    3286         },
     8172        PrintConv => \%offOn,
    32878173    },
    32888174    10.2 => { # CSd6
     
    33008186        Mask => 0xe0, #(NC)
    33018187        PrintConv => {
    3302             0x00 => 'AE & Flash', # default
    3303             0x20 => 'AE Only',
    3304             0x40 => 'Flash Only', #(NC)
    3305             0x60 => 'WB Bracketing', #(NC)
    3306             0x80 => 'Active D-Lighting', #(NC)
     8188            0 => 'AE & Flash', # default
     8189            1 => 'AE Only',
     8190            2 => 'Flash Only', #(NC)
     8191            3 => 'WB Bracketing', #(NC)
     8192            4 => 'Active D-Lighting', #(NC)
    33078193        },
    33088194    },
     
    33118197        Mask => 0x10,
    33128198        PrintConv => {
    3313             0x00 => '0,-,+',
    3314             0x10 => '-,0,+',
     8199            0 => '0,-,+',
     8200            1 => '-,0,+',
    33158201        },
    33168202    },
     
    33198205        Mask => 0xf8,
    33208206        PrintConv => {
    3321             0x00 => 'Grid Display',
    3322             0x08 => 'FV Lock',
    3323             0x10 => 'Flash Off',
    3324             0x18 => 'Matrix Metering',
    3325             0x20 => 'Center-weighted Metering',
    3326             0x28 => 'Spot Metering',
    3327             0x30 => 'My Menu Top',
    3328             0x38 => '+ NEF (RAW)',
    3329             0x40 => 'Active D-Lighting',
    3330             0x48 => 'Preview',
    3331             0x50 => 'AE/AF Lock',
    3332             0x58 => 'AE Lock Only',
    3333             0x60 => 'AF Lock Only',
    3334             0x68 => 'AE Lock (hold)',
    3335             0x70 => 'Bracketing Burst',
    3336             0x78 => 'Playback',
    3337             0x80 => '1EV Step Speed/Aperture',
    3338             0x88 => 'Choose Non-CPU Lens',
    3339             0x90 => 'Virtual Horizon',
    3340             0x98 => 'Start Movie Recording',
     8207            0 => 'Grid Display',
     8208            1 => 'FV Lock',
     8209            2 => 'Flash Off',
     8210            3 => 'Matrix Metering',
     8211            4 => 'Center-weighted Metering',
     8212            5 => 'Spot Metering',
     8213            6 => 'My Menu Top',
     8214            7 => '+ NEF (RAW)',
     8215            8 => 'Active D-Lighting',
     8216            9 => 'Preview',
     8217            10 => 'AE/AF Lock',
     8218            11 => 'AE Lock Only',
     8219            12 => 'AF Lock Only',
     8220            13 => 'AE Lock (hold)',
     8221            14 => 'Bracketing Burst',
     8222            15 => 'Playback',
     8223            16 => '1EV Step Speed/Aperture',
     8224            17 => 'Choose Non-CPU Lens',
     8225            18 => 'Virtual Horizon',
     8226            19 => 'Start Movie Recording',
    33418227        },
    33428228    },
     
    33458231        Mask => 0xf8,
    33468232        PrintConv => {
    3347             0x00 => 'Grid Display',
    3348             0x08 => 'FV Lock',
    3349             0x10 => 'Flash Off',
    3350             0x18 => 'Matrix Metering',
    3351             0x20 => 'Center-weighted Metering',
    3352             0x28 => 'Spot Metering',
    3353             0x30 => 'My Menu Top',
    3354             0x38 => '+ NEF (RAW)',
    3355             0x40 => 'Active D-Lighting',
    3356             0x48 => 'Preview',
    3357             0x50 => 'AE/AF Lock',
    3358             0x58 => 'AE Lock Only',
    3359             0x60 => 'AF Lock Only',
    3360             0x68 => 'AE Lock (hold)',
    3361             0x70 => 'Bracketing Burst',
    3362             0x78 => 'Playback',
    3363             0x80 => '1EV Step Speed/Aperture',
    3364             0x88 => 'Choose Non-CPU Lens',
    3365             0x90 => 'Virtual Horizon',
    3366             0x98 => 'Start Movie Recording',
     8233            0 => 'Grid Display',
     8234            1 => 'FV Lock',
     8235            2 => 'Flash Off',
     8236            3 => 'Matrix Metering',
     8237            4 => 'Center-weighted Metering',
     8238            5 => 'Spot Metering',
     8239            6 => 'My Menu Top',
     8240            7 => '+ NEF (RAW)',
     8241            8 => 'Active D-Lighting',
     8242            9 => 'Preview',
     8243            10 => 'AE/AF Lock',
     8244            11 => 'AE Lock Only',
     8245            12 => 'AF Lock Only',
     8246            13 => 'AE Lock (hold)',
     8247            14 => 'Bracketing Burst',
     8248            15 => 'Playback',
     8249            16 => '1EV Step Speed/Aperture',
     8250            17 => 'Choose Non-CPU Lens',
     8251            18 => 'Virtual Horizon',
     8252            19 => 'Start Movie Recording',
    33678253        },
    33688254    },
     
    33718257        Mask => 0x38,
    33728258        PrintConv => {
    3373             0x00 => 'AE/AF Lock',
    3374             0x08 => 'AE Lock Only',
    3375             0x10 => 'AF Lock Only',
    3376             0x18 => 'AE Lock (hold)',
    3377             0x20 => 'AF-ON',
    3378             0x28 => 'FV Lock',
     8259            0 => 'AE/AF Lock',
     8260            1 => 'AE Lock Only',
     8261            2 => 'AF Lock Only',
     8262            3 => 'AE Lock (hold)',
     8263            4 => 'AF-ON',
     8264            5 => 'FV Lock',
    33798265        },
    33808266    },
     
    33838269        Mask => 0x18,
    33848270        PrintConv => {
    3385             0x08 => 'Select Center Focus Point',
    3386             0x10 => 'Highlight Active Focus Point',
    3387             0x18 => 'Not Used', #(NC)
    3388             0x00 => 'Off', #(NC)
     8271            1 => 'Select Center Focus Point',
     8272            2 => 'Highlight Active Focus Point',
     8273            3 => 'Not Used', #(NC)
     8274            0 => 'Off', #(NC)
    33898275        },
    33908276    },
     
    33928278        Name => 'CommandDialsReverseRotation',
    33938279        Mask => 0x80,
    3394         PrintConv => { 0x00 => 'No', 0x80 => 'Yes' },
     8280        PrintConv => \%noYes,
    33958281    },
    33968282    17.2 => { # CSf6-b
     
    33988284        Mask => 0x60,
    33998285        PrintConv => {
    3400             0x00 => 'Off',
    3401             0x20 => 'On',
    3402             0x40 => 'On (A mode only)',
     8286            0 => 'Off',
     8287            1 => 'On',
     8288            2 => 'On (A mode only)',
    34038289        },
    34048290    },
     
    34078293        Mask => 0x04,
    34088294        PrintConv => {
    3409             0x00 => 'Sub-command Dial',
    3410             0x04 => 'Aperture Ring',
     8295            0 => 'Sub-command Dial',
     8296            1 => 'Aperture Ring',
    34118297        },
    34128298    },
     
    34158301        Mask => 0x18,
    34168302        PrintConv => {
    3417             0x00 => 'On',
    3418             0x10 => 'On (Image Review Exclude)',
    3419             0x08 => 'Off',
     8303            0 => 'On',
     8304            2 => 'On (Image Review Exclude)',
     8305            1 => 'Off',
    34208306        },
    34218307    },
     
    34238309        Name => 'ShutterReleaseButtonAE-L',
    34248310        Mask => 0x02,
    3425         PrintConv => { 0x00 => 'Off', 0x02 => 'On' },
     8311        PrintConv => \%offOn,
    34268312    },
    34278313    17.6 => { # CSf7
    34288314        Name => 'ReleaseButtonToUseDial',
    34298315        Mask => 0x01,
    3430         PrintConv => { 0x00 => 'No', 0x01 => 'Yes' },
     8316        PrintConv => \%noYes,
    34318317    },
    34328318    18.1 => { # CSc2
     
    34358321        PrintConvColumns => 2,
    34368322        PrintConv => {
    3437             0x00 => '4 s',
    3438             0x10 => '6 s', # default
    3439             0x20 => '8 s',
    3440             0x30 => '16 s',
    3441             0x40 => '30 s',
    3442             0x50 => '1 min',
    3443             0x60 => '5 min',
    3444             0x70 => '10 min',
    3445             0x80 => '30 min',
    3446             0x90 => 'No Limit',
     8323            0 => '4 s',
     8324            1 => '6 s', # default
     8325            2 => '8 s',
     8326            3 => '16 s',
     8327            4 => '30 s',
     8328            5 => '1 min',
     8329            6 => '5 min',
     8330            7 => '10 min',
     8331            8 => '30 min',
     8332            9 => 'No Limit',
    34478333        },
    34488334    },
     
    34518337        Mask => 0x03,
    34528338        PrintConv => {
    3453             0x00 => '1 min',
    3454             0x01 => '5 min',
    3455             0x02 => '10 min',
    3456             0x03 => '15 min',
     8339            0 => '1 min',
     8340            1 => '5 min',
     8341            2 => '10 min',
     8342            3 => '15 min',
    34578343        },
    34588344    },
     
    34618347        Mask => 0xc0,
    34628348        PrintConv => {
    3463             0x00 => '2 s',
    3464             0x40 => '5 s',
    3465             0x80 => '10 s', # default
    3466             0xc0 => '20 s',
     8349            0 => '2 s',
     8350            1 => '5 s',
     8351            2 => '10 s', # default
     8352            3 => '20 s',
    34678353        },
    34688354    },
     
    34718357        Mask => 0x30,
    34728358        PrintConv => {
    3473             0x00 => '0.5 s',
    3474             0x10 => '1 s',
    3475             0x20 => '2 s', # default
    3476             0x30 => '3 s',
     8359            0 => '0.5 s',
     8360            1 => '1 s',
     8361            2 => '2 s', # default
     8362            3 => '3 s',
    34778363        },
    34788364    },
     
    34848370        Name => 'ImageReviewTime',
    34858371        Mask => 0xe0,
    3486         PrintConv => { # (NC)
    3487             0x00 => '4 s',
    3488             0x20 => '10 s', # default
    3489             0x40 => '20 s',
    3490             0x60 => '1 min',
    3491             0x80 => '5 min',
    3492             0xa0 => '10 min',
     8372        PrintConv => { #(NC)
     8373            0 => '4 s',
     8374            1 => '10 s', # default
     8375            2 => '20 s',
     8376            3 => '1 min',
     8377            4 => '5 min',
     8378            5 => '10 min',
    34938379        },
    34948380    },
     
    34968382        Name => 'LiveViewMonitorOffTime',
    34978383        Mask => 0x1c,
    3498         PrintConv => { # (NC)
    3499             0x00 => '4 s',
    3500             0x04 => '10 s', # default
    3501             0x08 => '20 s',
    3502             0x0c => '1 min',
    3503             0x10 => '5 min',
    3504             0x14 => '10 min',
     8384        PrintConv => { #(NC)
     8385            0 => '4 s',
     8386            1 => '10 s', # default
     8387            2 => '20 s',
     8388            3 => '1 min',
     8389            4 => '5 min',
     8390            5 => '10 min',
    35058391        },
    35068392    },
     
    35098395        Mask => 0xe0,
    35108396        PrintConv => {
    3511             0x00 => '4 s',
    3512             0x20 => '10 s', # default
    3513             0x40 => '20 s',
    3514             0x60 => '1 min',
    3515             0x80 => '5 min',
    3516             0xa0 => '10 min',
     8397            0 => '4 s',
     8398            1 => '10 s', # default
     8399            2 => '20 s',
     8400            3 => '1 min',
     8401            4 => '5 min',
     8402            5 => '10 min',
    35178403        },
    35188404    },
     
    35208406        Name => 'ShootingInfoMonitorOffTime',
    35218407        Mask => 0x1c,
    3522         PrintConv => { # (NC)
    3523             0x00 => '4 s',
    3524             0x04 => '10 s', # default
    3525             0x08 => '20 s',
    3526             0x0c => '1 min',
    3527             0x10 => '5 min',
    3528             0x14 => '10 min',
     8408        PrintConv => { #(NC)
     8409            0 => '4 s',
     8410            1 => '10 s', # default
     8411            2 => '20 s',
     8412            3 => '1 min',
     8413            4 => '5 min',
     8414            5 => '10 min',
    35298415        },
    35308416    },
     
    35338419        Mask => 0xf0,
    35348420        PrintConv => {
    3535             0x00 => '1/320 s (auto FP)',
    3536             0x10 => '1/250 s (auto FP)',
    3537             0x20 => '1/250 s',
    3538             0x30 => '1/200 s',
    3539             0x40 => '1/160 s',
    3540             0x50 => '1/125 s',
    3541             0x60 => '1/100 s',
    3542             0x70 => '1/80 s',
    3543             0x80 => '1/60 s',
     8421            0 => '1/320 s (auto FP)',
     8422            1 => '1/250 s (auto FP)',
     8423            2 => '1/250 s',
     8424            3 => '1/200 s',
     8425            4 => '1/160 s',
     8426            5 => '1/125 s',
     8427            6 => '1/100 s',
     8428            7 => '1/80 s',
     8429            8 => '1/60 s',
    35448430       },
    35458431    },
     
    35498435        PrintConvColumns => 2,
    35508436        PrintConv => {
    3551             0x00 => '1/60 s',
    3552             0x01 => '1/30 s',
    3553             0x02 => '1/15 s',
    3554             0x03 => '1/8 s',
    3555             0x04 => '1/4 s',
    3556             0x05 => '1/2 s',
    3557             0x06 => '1 s',
    3558             0x07 => '2 s',
    3559             0x08 => '4 s',
    3560             0x09 => '8 s',
    3561             0x0a => '15 s',
    3562             0x0b => '30 s',
     8437            0 => '1/60 s',
     8438            1 => '1/30 s',
     8439            2 => '1/15 s',
     8440            3 => '1/8 s',
     8441            4 => '1/4 s',
     8442            5 => '1/2 s',
     8443            6 => '1 s',
     8444            7 => '2 s',
     8445            8 => '4 s',
     8446            9 => '8 s',
     8447            10 => '15 s',
     8448            11 => '30 s',
    35638449        },
    35648450    },
     
    35668452        Name => 'FlashControlBuilt-in',
    35678453        Mask => 0xc0,
    3568         RawConv => '$$self{FlashControlBuiltin} = $val & 0xc0',
    3569         PrintConv => {
    3570             0x00 => 'TTL',
    3571             0x40 => 'Manual',
    3572             0x80 => 'Repeating Flash',
    3573             0xc0 => 'Commander Mode',
     8454        RawConv => '$$self{FlashControlBuiltin} = $val',
     8455        PrintConv => {
     8456            0 => 'TTL',
     8457            1 => 'Manual',
     8458            2 => 'Repeating Flash',
     8459            3 => 'Commander Mode',
    35748460        },
    35758461    },
    35768462    23.2 => { # CSe3-b
    35778463        Name => 'ManualFlashOutput',
    3578         Condition => '$$self{FlashControlBuiltin} == 0x40',
     8464        Condition => '$$self{FlashControlBuiltin} == 1',
    35798465        Mask => 0x1f,
    35808466        ValueConv => '2 ** (-$val/3)',
     
    35888474    24.1 => { # CSe3-ca
    35898475        Name => 'RepeatingFlashOutput',
    3590         Condition => '$$self{FlashControlBuiltin} == 0x80',
     8476        Condition => '$$self{FlashControlBuiltin} == 2',
    35918477        Mask => 0x70,
    3592         ValueConv => '2 ** (-($val>>4)-2)',
    3593         ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5)<<4 : 0',
     8478        ValueConv => '2 ** (-$val-2)',
     8479        ValueConvInv => '$val > 0 ? int(-log($val)/log(2)-2+0.5) : 0',
    35948480        PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
    35958481        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     
    35978483    24.2 => { # CSe3-cb
    35988484        Name => 'RepeatingFlashCount',
    3599         Condition => '$$self{FlashControlBuiltin} == 0x80',
     8485        Condition => '$$self{FlashControlBuiltin} == 2',
    36008486        Mask => 0x0f,
    36018487        ValueConv => '$val < 10 ? $val + 1 : 5 * ($val - 7)',
     
    36048490    25.1 => { # CSe3-cc (NC)
    36058491        Name => 'RepeatingFlashRate',
    3606         Condition => '$$self{FlashControlBuiltin} == 0x80',
     8492        Condition => '$$self{FlashControlBuiltin} == 2',
    36078493        Mask => 0xf0,
    3608         ValueConv => 'my $v=($val>>4); $v < 10 ? $v + 1 : 10 * ($v - 8)',
    3609         ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5) << 4',
     8494        ValueConv => '$val < 10 ? $val + 1 : 10 * ($val - 8)',
     8495        ValueConvInv => 'int(($val <= 10 ? $val - 1 : $val / 10 + 8) + 0.5)',
    36108496        PrintConv => '"$val Hz"',
    36118497        PrintConvInv => '$val=~/(\d+)/; $1 || 0',
     
    36138499    26.1 => { # CSe3-da
    36148500        Name => 'CommanderInternalTTLCompBuiltin',
    3615         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     8501        Condition => '$$self{FlashControlBuiltin} == 3',
    36168502        Mask => 0x1f,
    36178503        ValueConv => '($val - 9) / 3',
     
    36228508    27.1 => { # CSe3-db
    36238509        Name => 'CommanderInternalTTLCompGroupA',
    3624         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     8510        Condition => '$$self{FlashControlBuiltin} == 3',
    36258511        Mask => 0x1f,
    36268512        ValueConv => '($val - 9) / 3',
     
    36318517    28.1 => { # CSe3-dc
    36328518        Name => 'CommanderInternalTTLCompGroupB',
    3633         Condition => '$$self{FlashControlBuiltin} == 0xc0',
     8519        Condition => '$$self{FlashControlBuiltin} == 3',
    36348520        Mask => 0x1f,
    36358521        ValueConv => '($val - 9) / 3',
     
    36418527        Name => 'FlashWarning',
    36428528        Mask => 0x80,
    3643         PrintConv => {
    3644             0x00 => 'On',
    3645             0x80 => 'Off',
    3646         },
     8529        PrintConv => \%onOff,
    36478530    },
    36488531    30.2 => { # CSe4
    36498532        Name => 'ModelingFlash',
    36508533        Mask => 0x20,
    3651         PrintConv => { 0x00 => 'On', 0x20 => 'Off' },
     8534        PrintConv => \%onOff,
    36528535    },
    36538536    34.1 => { # CSa8-b
     
    36558538        Mask => 0x60,
    36568539        PrintConv => {
    3657             0x00 => 'Face-Priority',
    3658             0x20 => 'NormalArea',
    3659             0x40 => 'WideArea',
    3660             0x60 => 'SubjectTracking',
     8540            0 => 'Face-Priority',
     8541            1 => 'NormalArea',
     8542            2 => 'WideArea',
     8543            3 => 'SubjectTracking',
    36618544        },
    36628545    },
     
    36658548        Mask => 0x02,
    36668549        PrintConv => {
    3667             0x00 => 'AF-C',
    3668             0x02 => 'AF-F',
     8550            0 => 'AF-C',
     8551            1 => 'AF-F',
    36698552        },
    36708553    },
     
    36738556        Mask => 0xe0,
    36748557        PrintConv => {
    3675             0x00 => '4 s',
    3676             0x20 => '10 s', # default
    3677             0x40 => '20 s',
    3678             0x60 => '1 min',
    3679             0x80 => '5 min',
    3680             0xa0 => '10 min',
     8558            0 => '4 s',
     8559            1 => '10 s', # default
     8560            2 => '20 s',
     8561            3 => '1 min',
     8562            4 => '5 min',
     8563            5 => '10 min',
    36818564        },
    36828565    },
    36838566);
    36848567
     8568# D4/D4S custom settings (ref 1, decoded from D4S)
     8569%Image::ExifTool::NikonCustom::SettingsD4 = (
     8570    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
     8571    WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
     8572    CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
     8573    WRITABLE => 1,
     8574    FIRST_ENTRY => 0,
     8575    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
     8576    NOTES => 'Custom settings for the D4 and D4S.',
     8577    0.1 => {
     8578        Name => 'CustomSettingsBank',
     8579        Mask => 0x03,
     8580        PrintConv => {
     8581            0 => 'A',
     8582            1 => 'B',
     8583            2 => 'C',
     8584            3 => 'D',
     8585        },
     8586    },
     8587    1.1 => { #CSa1
     8588        Name => 'AF-CPrioritySelection',
     8589        Mask => 0xc0,
     8590        PrintConv => {
     8591            0 => 'Release',
     8592            1 => 'Release + Focus',
     8593            2 => 'Focus',
     8594            3 => 'Focus + Release',
     8595        },
     8596    },
     8597    1.2 => { # CSa2
     8598        Name => 'AF-SPrioritySelection',
     8599        Mask => 0x20,
     8600        PrintConv => {
     8601            0 => 'Focus',
     8602            1 => 'Release',
     8603        },
     8604    },
     8605    1.3 => { # CSa7
     8606        Name => 'AFPointSelection',
     8607        Mask => 0x10,
     8608        PrintConv => {
     8609            0 => '51 Points',
     8610            1 => '11 Points',
     8611        },
     8612    },
     8613    1.4 => { # CSa3
     8614        Name => 'FocusTrackingLockOn',
     8615        Mask => 0x07,
     8616        PrintConv => {
     8617            0 => 'Off',
     8618            1 => '1 (Short)',
     8619            2 => '2',
     8620            3 => '3 (Normal)',
     8621            4 => '4',
     8622            5 => '5 (Long)',
     8623        },
     8624    },
     8625    2.1 => { # CSa4
     8626        Name => 'AFActivation',
     8627        Mask => 0x80,
     8628        PrintConv => {
     8629            0 => 'Shutter/AF-On',
     8630            1 => 'AF-On Only',
     8631        },
     8632    },
     8633    2.2 => { # CSa6
     8634        Name => 'FocusPointWrap',
     8635        Mask => 0x08,
     8636        PrintConv => {
     8637            0 => 'No Wrap',
     8638            1 => 'Wrap',
     8639        },
     8640    },
     8641    4.1 => { # CSd1-b
     8642        Name => 'Pitch',
     8643        Mask => 0x40,
     8644        PrintConv => { 0 => 'High', 1 => 'Low' },
     8645    },
     8646    4.2 => { # CSf12
     8647        Name => 'NoMemoryCard',
     8648        Mask => 0x20,
     8649        PrintConv => {
     8650            0 => 'Release Locked',
     8651            1 => 'Enable Release',
     8652        },
     8653    },
     8654    4.3 => { # CSd6
     8655        Name => 'GridDisplay',
     8656        Mask => 0x02,
     8657        PrintConv => \%onOff,
     8658    },
     8659    5.1 => { # CSd9
     8660        Name => 'ShootingInfoDisplay',
     8661        Mask => 0xc0,
     8662        PrintConv => {
     8663            # 0 - seen for D4 (PH)
     8664            1 => 'Auto',
     8665            2 => 'Manual (dark on light)',
     8666            3 => 'Manual (light on dark)',
     8667        },
     8668    },
     8669    5.2 => { # CSd10
     8670        Name => 'LCDIllumination',
     8671        Mask => 0x20,
     8672        PrintConv => \%offOn,
     8673    },
     8674    5.3 => { # CSd8
     8675        Name => 'ScreenTips',
     8676        Mask => 0x04,
     8677        PrintConv => \%offOn,
     8678    },
     8679    5.4 => { # CSd1-a
     8680        Name => 'Beep',
     8681        Mask => 0x03,
     8682        PrintConv => {
     8683            0 => 'Off',
     8684            1 => 'Low',
     8685            2 => 'Medium',
     8686            3 => 'High',
     8687        },
     8688    },
     8689    6.1 => { # CSf13
     8690        Name => 'ReverseIndicators',
     8691        Mask => 0x80,
     8692        PrintConv => {
     8693            0 => '+ 0 -',
     8694            1 => '- 0 +',
     8695        },
     8696    },
     8697    6.2 => { # CSd7-a
     8698        Name => 'RearDisplay',
     8699        Mask => 0x40,
     8700        PrintConv => {
     8701            0 => 'ISO',
     8702            1 => 'Exposures Remaining',
     8703        },
     8704    },
     8705    6.3 => { # CSd7-b
     8706        Name => 'ViewfinderDisplay',
     8707        Mask => 0x20,
     8708        PrintConv => {
     8709            0 => 'Frame Count',
     8710            1 => 'Exposures Remaining',
     8711        },
     8712    },
     8713    6.4 => { # CSd10-a
     8714        Name => 'CommandDialsReverseRotation',
     8715        Mask => 0x18,
     8716        PrintConv => {
     8717            0 => 'No',
     8718            1 => 'Shutter Speed & Aperture',
     8719            2 => 'Exposure Compensation',
     8720            3 => 'Exposure Compensation, Shutter Speed & Aperture',
     8721        },
     8722    },
     8723    6.5 => { # CSb4
     8724        Name => 'EasyExposureCompensation',
     8725        Mask => 0x03,
     8726        PrintConv => {
     8727            0 => 'Off',
     8728            1 => 'On',
     8729            2 => 'On (auto reset)',
     8730        },
     8731    },
     8732    7.1 => { # CSb2
     8733        Name => 'ExposureControlStepSize',
     8734        Mask => 0xc0,
     8735        PrintConv => {
     8736            0 => '1/3 EV',
     8737            1 => '1/2 EV',
     8738            2 => '1 EV',
     8739        },
     8740    },
     8741    7.2 => { # CSb1
     8742        Name => 'ISOStepSize',
     8743        Mask => 0x30,
     8744        PrintConv => {
     8745            0 => '1/3 EV',
     8746            1 => '1/2 EV',
     8747            2 => '1 EV',
     8748        },
     8749    },
     8750    7.3 => { # CSb3
     8751        Name => 'ExposureCompStepSize',
     8752        Mask => 0x0c,
     8753        PrintConv => {
     8754            0 => '1/3 EV',
     8755            1 => '1/2 EV',
     8756            2 => '1 EV',
     8757        },
     8758    },
     8759    8.1 => { # CSb6 (CSb5 for D4)
     8760        Name => 'CenterWeightedAreaSize',
     8761        Mask => 0xe0,
     8762        PrintConv => {
     8763            0 => '8 mm',
     8764            1 => '12 mm',
     8765            2 => '15 mm',
     8766            3 => '20 mm',
     8767            4 => 'Average',
     8768        },
     8769    },
     8770    8.2 => { # CSb7-a
     8771        Name => 'FineTuneOptMatrixMetering',
     8772        Mask => 0x0f,
     8773        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     8774        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     8775        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     8776        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     8777    },
     8778    9.1 => { # CSb7-b
     8779        Name => 'FineTuneOptCenterWeighted',
     8780        Mask => 0xf0,
     8781        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     8782        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     8783        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     8784        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     8785    },
     8786    9.2 => { # CSb7-c
     8787        Name => 'FineTuneOptSpotMetering',
     8788        Mask => 0x0f,
     8789        ValueConv => '($val > 0x7 ? $val - 0x10 : $val) / 6',
     8790        ValueConvInv => 'int($val*6+($val>0?0.5:-0.5))',
     8791        PrintConv => '$val ? sprintf("%+.2f", $val) : 0',
     8792        PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
     8793    },
     8794    10.1 => { # CSf1-a
     8795        Name => 'MultiSelectorShootMode',
     8796        Mask => 0xc0,
     8797        PrintConv => {
     8798            0 => 'Select Center Focus Point (Reset)',
     8799            2 => 'Preset Focus Point (Pre)',
     8800            3 => 'Not Used (None)',
     8801        },
     8802    },
     8803    10.2 => { # CSf1-b
     8804        Name => 'MultiSelectorPlaybackMode',
     8805        Mask => 0x30,
     8806        PrintConv => {
     8807            0 => 'Thumbnail On/Off',
     8808            1 => 'View Histograms',
     8809            2 => 'Zoom On/Off',
     8810            3 => 'Choose Folder',
     8811        },
     8812    },
     8813    10.3 => { # CSf2
     8814        Name => 'MultiSelector',
     8815        Mask => 0x01,
     8816        PrintConv => {
     8817            0 => 'Do Nothing',
     8818            1 => 'Reset Meter-off Delay',
     8819        },
     8820    },
     8821    11.1 => { # CSd4
     8822        Name => 'ExposureDelayMode',
     8823        Mask => 0xc0,
     8824        PrintConv => {
     8825            0 => 'Off',
     8826            1 => '1 s',
     8827            2 => '2 s',
     8828            3 => '3 s',
     8829        },
     8830    },
     8831    11.2 => { # CSd2-a
     8832        Name => 'CHModeShootingSpeed',
     8833        Mask => 0x10,
     8834        PrintConv => {
     8835            0 => '10 fps',
     8836            1 => '11 fps',
     8837        },
     8838    },
     8839    11.3 => { # CSd2-b
     8840        Name => 'CLModeShootingSpeed',
     8841        Mask => 0x0f,
     8842        PrintConv => '"$val fps"',
     8843        PrintConvInv => '$val=~s/\s*fps//i; $val',
     8844    },
     8845    12 => { # CSd3
     8846        Name => 'MaxContinuousRelease',
     8847        # values: 1-200
     8848    },
     8849    13.1 => { # CSe6
     8850        Name => 'AutoBracketSet',
     8851        Mask => 0xe0,
     8852        PrintConv => {
     8853            0 => 'AE & Flash',
     8854            1 => 'AE Only',
     8855            2 => 'Flash Only',
     8856            3 => 'WB Bracketing',
     8857            4 => 'Active D-Lighting',
     8858        },
     8859    },
     8860    13.2 => { # CSe8
     8861        Name => 'AutoBracketOrder',
     8862        Mask => 0x10,
     8863        PrintConv => {
     8864            0 => '0,-,+',
     8865            1 => '-,0,+',
     8866        },
     8867    },
     8868    13.3 => { # CSe7
     8869        Name => 'AutoBracketModeM',
     8870        Mask => 0x0c,
     8871        PrintConv => {
     8872            0 => 'Flash/Speed',
     8873            1 => 'Flash/Speed/Aperture',
     8874            2 => 'Flash/Aperture',
     8875            3 => 'Flash Only',
     8876        },
     8877    },
     8878    14.1 => { # CSf3-a
     8879        Name => 'FuncButton',
     8880        Mask => 0xf8,
     8881        PrintConv => {
     8882            0 => 'None',
     8883            1 => 'Preview',
     8884            2 => 'FV Lock',
     8885            3 => 'AE/AF Lock',
     8886            4 => 'AE Lock Only',
     8887            5 => 'AE Lock (reset on release)',
     8888            6 => 'AE Lock (hold)',
     8889            7 => 'AF Lock Only',
     8890            8 => 'AF-On',
     8891            10 => 'Bracketing Burst',
     8892            11 => 'Matrix Metering',
     8893            12 => 'Center-weighted Metering',
     8894            13 => 'Spot Metering',
     8895            14 => 'Playback',
     8896            15 => 'My Menu Top Item',
     8897            16 => '+NEF(RAW)',
     8898            17 => 'Virtual Horizon',
     8899            18 => 'My Menu',
     8900            20 => 'Grid Display',
     8901            21 => 'Disable Synchronized Release',
     8902            22 => 'Remote Release Only',
     8903            26 => 'Flash Disable/Enable',
     8904        },
     8905    },
     8906    14.2 => { # CSf3-b
     8907        Name => 'FuncButtonPlusDials',
     8908        Mask => 0x07,
     8909        PrintConv => {
     8910            0 => 'None',
     8911            1 => 'Choose Image Area (FX/DX/5:4)',
     8912            2 => 'Shutter Speed & Aperture Lock',
     8913            3 => 'One Step Speed / Aperture',
     8914            4 => 'Choose Non-CPU Lens Number',
     8915            5 => 'Active D-Lighting',
     8916            6 => 'Shooting Bank Menu',
     8917        },
     8918    },
     8919    15.1 => { # CSf4-a
     8920        Name => 'PreviewButton',
     8921        Mask => 0xf8,
     8922        PrintConv => {
     8923            0 => 'None',
     8924            1 => 'Preview',
     8925            2 => 'FV Lock',
     8926            3 => 'AE/AF Lock',
     8927            4 => 'AE Lock Only',
     8928            5 => 'AE Lock (reset on release)',
     8929            6 => 'AE Lock (hold)',
     8930            7 => 'AF Lock Only',
     8931            8 => 'AF-On',
     8932            10 => 'Bracketing Burst',
     8933            11 => 'Matrix Metering',
     8934            12 => 'Center-weighted Metering',
     8935            13 => 'Spot Metering',
     8936            14 => 'Playback',
     8937            15 => 'My Menu Top Item',
     8938            16 => '+NEF(RAW)',
     8939            17 => 'Virtual Horizon',
     8940            18 => 'My Menu',
     8941            20 => 'Grid Display',
     8942            21 => 'Disable Synchronized Release',
     8943            22 => 'Remote Release Only',
     8944            26 => 'Flash Disable/Enable',
     8945        },
     8946    },
     8947    15.2 => { # CSf4-b
     8948        Name => 'PreviewButtonPlusDials',
     8949        Mask => 0x07,
     8950        PrintConv => {
     8951            0 => 'None',
     8952            1 => 'Choose Image Area (FX/DX/5:4)',
     8953            2 => 'Shutter Speed & Aperture Lock',
     8954            3 => 'One Step Speed / Aperture',
     8955            4 => 'Choose Non-CPU Lens Number',
     8956            5 => 'Active D-Lighting',
     8957            6 => 'Shooting Bank Menu',
     8958        },
     8959    },
     8960    16.1 => { # CSf9
     8961        Name => 'AssignBktButton',
     8962        Mask => 0x07,
     8963        PrintConv => {
     8964            0 => 'Auto Bracketing',
     8965            1 => 'Multiple Exposure',
     8966            2 => 'HDR (high dynamic range)',
     8967            3 => 'None',
     8968        },
     8969    },
     8970    18.1 => { # CSf10-b
     8971        Name => 'CommandDialsChangeMainSub',
     8972        Mask => 0xe0,
     8973        PrintConv => {
     8974            0 => 'Autofocus Off, Exposure Off',
     8975            1 => 'Autofocus Off, Exposure On',
     8976            2 => 'Autofocus Off, Exposure On (Mode A)',
     8977            4 => 'Autofocus On, Exposure Off',
     8978            5 => 'Autofocus On, Exposure On',
     8979            6 => 'Autofocus On, Exposure On (Mode A)',
     8980        },
     8981    },
     8982    18.2 => { # CSf10-d
     8983        Name => 'CommandDialsMenuAndPlayback',
     8984        Mask => 0x18,
     8985        PrintConv => {
     8986            0 => 'On',
     8987            1 => 'Off',
     8988            2 => 'On (Image Review Excluded)',
     8989        },
     8990    },
     8991    18.3 => { # CSf10-c
     8992        Name => 'CommandDialsApertureSetting',
     8993        Mask => 0x04,
     8994        PrintConv => {
     8995            0 => 'Sub-command Dial',
     8996            1 => 'Aperture Ring',
     8997        },
     8998    },
     8999    18.4 => { # CSc1
     9000        Name => 'ShutterReleaseButtonAE-L',
     9001        Mask => 0x02,
     9002        PrintConv => \%offOn,
     9003    },
     9004    18.5 => { # CSf11
     9005        Name => 'ReleaseButtonToUseDial',
     9006        Mask => 0x01,
     9007        PrintConv => \%noYes,
     9008    },
     9009    19.1 => { # CSc2
     9010        Name => 'StandbyTimer',
     9011        Mask => 0xf0,
     9012        PrintConv => {
     9013            0 => '4 s',
     9014            1 => '6 s',
     9015            3 => '10 s',
     9016            5 => '30 s',
     9017            6 => '1 min',
     9018            7 => '5 min',
     9019            8 => '10 min',
     9020            9 => '30 min',
     9021        },
     9022    },
     9023    20.1 => { # CSc3-a
     9024        Name => 'SelfTimerTime',
     9025        Mask => 0xc0,
     9026        PrintConv => {
     9027            0 => '2 s',
     9028            1 => '5 s',
     9029            2 => '10 s',
     9030            3 => '20 s',
     9031        },
     9032    },
     9033    20.2 => { # CSc3-b
     9034        Name => 'SelfTimerShotCount',
     9035        Mask => 0x0f,
     9036    },
     9037    20.3 => { # CSc3-c
     9038        Name => 'SelfTimerShotInterval',
     9039        Mask => 0x30,
     9040        PrintConv => {
     9041            0 => '0.5 s',
     9042            1 => '1 s',
     9043            2 => '2 s',
     9044            3 => '3 s',
     9045        },
     9046    },
     9047    21.1 => { # CSc4-d
     9048        Name => 'ImageReviewMonitorOffTime',
     9049        Mask => 0xe0,
     9050        PrintConv => {
     9051            0 => '2 s',
     9052            1 => '4 s',
     9053            2 => '10 s',
     9054            3 => '20 s',
     9055            4 => '1 min',
     9056            5 => '5 min',
     9057            6 => '10 min',
     9058
     9059        },
     9060    },
     9061    21.2 => { # CSc4-e
     9062        Name => 'LiveViewMonitorOffTime',
     9063        Mask => 0x1c,
     9064        PrintConv => {
     9065            0 => '5 min',
     9066            1 => '10 min',
     9067            2 => '15 min',
     9068            3 => '20 min',
     9069            4 => '30 min',
     9070            5 => 'No Limit',
     9071        },
     9072    },
     9073    22.1 => { # CSc4-b
     9074        Name => 'MenuMonitorOffTime',
     9075        Mask => 0xe0,
     9076        PrintConv => {
     9077            0 => '4 s',
     9078            1 => '10 s',
     9079            2 => '20 s',
     9080            3 => '1 min',
     9081            4 => '5 min',
     9082            5 => '10 min',
     9083        },
     9084    },
     9085    22.2 => { # CSc4-c
     9086        Name => 'ShootingInfoMonitorOffTime',
     9087        Mask => 0x1c,
     9088        PrintConv => {
     9089            0 => '4 s',
     9090            1 => '10 s',
     9091            2 => '20 s',
     9092            3 => '1 min',
     9093            4 => '5 min',
     9094            5 => '10 min',
     9095        },
     9096    },
     9097    23.1 => { # CSe1
     9098        Name => 'FlashSyncSpeed',
     9099        Mask => 0xf0,
     9100        PrintConv => {
     9101            # 0x00 - seen for D4 (PH)
     9102            1 => '1/250 s (auto FP)',
     9103            2 => '1/250 s',
     9104            3 => '1/200 s',
     9105            4 => '1/160 s',
     9106            5 => '1/125 s',
     9107            6 => '1/100 s',
     9108            7 => '1/80 s',
     9109            8 => '1/60 s',
     9110        },
     9111    },
     9112    23.2 => { # CSe2
     9113        Name => 'FlashShutterSpeed',
     9114        Mask => 0x0f,
     9115        PrintConvColumns => 2,
     9116        PrintConv => {
     9117            0 => '1/60 s',
     9118            1 => '1/30 s',
     9119            2 => '1/15 s',
     9120            3 => '1/8 s',
     9121            4 => '1/4 s',
     9122            5 => '1/2 s',
     9123            6 => '1 s',
     9124            7 => '2 s',
     9125            8 => '4 s',
     9126            9 => '8 s',
     9127            10 => '15 s',
     9128            11 => '30 s',
     9129        },
     9130    },
     9131    31.1 => { # CSe5
     9132        Name => 'ModelingFlash',
     9133        Mask => 0x20,
     9134        PrintConv => \%onOff,
     9135    },
     9136    36.1 => { # CSc4-a
     9137        Name => 'PlaybackMonitorOffTime',
     9138        Mask => 0xe0,
     9139        PrintConv => {
     9140            0 => '4 s',
     9141            1 => '10 s',
     9142            2 => '20 s',
     9143            3 => '1 min',
     9144            4 => '5 min',
     9145            5 => '10 min',
     9146        },
     9147    },
     9148    37.1 => { # CSf15
     9149        Name => 'PlaybackZoom',
     9150        Mask => 0x01,
     9151        PrintConv => {
     9152            0 => 'Use Separate Zoom Buttons',
     9153            1 => 'Use Either Zoom Button with Command Dial',
     9154        },
     9155    },
     9156    38.1 => { # CSf8-a
     9157        Name => 'ShutterSpeedLock',
     9158        Mask => 0x80,
     9159        PrintConv => \%offOn,
     9160    },
     9161    38.2 => { # CSf8-b
     9162        Name => 'ApertureLock',
     9163        Mask => 0x40,
     9164        PrintConv => \%offOn,
     9165    },
     9166    38.3 => { # CSg4
     9167        Name => 'MovieShutterButton',
     9168        Mask => 0x30,
     9169        PrintConv => {
     9170            0 => 'Take Photo',
     9171            1 => 'Record Movies',
     9172            2 => 'Live Frame Grab',
     9173        },
     9174    },
     9175    38.4 => { # CSe4
     9176        Name => 'FlashExposureCompArea',
     9177        Mask => 0x04,
     9178        PrintConv => {
     9179            0 => 'Entire frame',
     9180            1 => 'Background only',
     9181        },
     9182    },
     9183    41.1 => { # CSg1-a
     9184        Name => 'MovieFunctionButton',
     9185        Mask => 0x70,
     9186        PrintConv => {
     9187            0 => 'None',
     9188            1 => 'Power Aperture (open)', # bit '02' is also toggled on for this setting
     9189            3 => 'Index Marking',
     9190            4 => 'View Photo Shooting Info',
     9191        },
     9192    },
     9193    41.2 => { # CSg2-a
     9194        Name => 'MoviePreviewButton',
     9195        Mask => 0x07,
     9196        PrintConv => {
     9197            0 => 'None',
     9198            2 => 'Power Aperture (open)', # bit '10' is also toggled on for this setting
     9199            3 => 'Index Marking',
     9200            4 => 'View Photo Shooting Info',
     9201        },
     9202    },
     9203    42.1 => { # CSf14
     9204        Name => 'VerticalMultiSelector',
     9205        Mask => 0x60,
     9206        PrintConv => {
     9207            0 => 'Same as Multi-Selector with Info(U/D) & Playback(R/L)',
     9208            1 => 'Same as Multi-Selector with Info(R/L) & Playback(U/D)',
     9209            2 => 'Focus Point Selection',
     9210        },
     9211    },
     9212    42.2 => { # CSf7-a
     9213        Name => 'VerticalFuncButton',
     9214        Mask => 0x1f,
     9215        PrintConv => {
     9216            0 => 'None',
     9217            1 => 'Preview',
     9218            2 => 'FV Lock',
     9219            3 => 'AE/AF Lock',
     9220            4 => 'AE Lock Only',
     9221            5 => 'AE Lock (reset on release)',
     9222            6 => 'AE Lock (hold)',
     9223            7 => 'AF Lock Only',
     9224            10 => 'Bracketing Burst',
     9225            11 => 'Matrix Metering',
     9226            12 => 'Center-weighted Metering',
     9227            13 => 'Spot Metering',
     9228            14 => 'Playback',
     9229            15 => 'My Menu Top Item',
     9230            16 => '+NEF(RAW)',
     9231            17 => 'Virtual Horizon',
     9232            18 => 'My Menu',
     9233            20 => 'Grid Display',
     9234            26 => 'Flash Disable/Enable',
     9235        },
     9236    },
     9237    43.1 => { # CSf7-b
     9238        Name => 'VerticalFuncButtonPlusDials',
     9239        Mask => 0xf0,
     9240        PrintConv => {
     9241            0 => 'None',
     9242            1 => 'Choose Image Area (FX/DX/5:4)',
     9243            2 => 'Shutter Speed & Aperture Lock',
     9244            3 => 'One Step Speed / Aperture',
     9245            4 => 'Choose Non-CPU Lens Number',
     9246            5 => 'Active D-Lighting',
     9247            6 => 'Shooting Bank Menu',
     9248            7 => 'ISO Sensitivity',
     9249            8 => 'Exposure Mode',
     9250            9 => 'Exposure Compensation',
     9251            10 => 'Metering',
     9252        },
     9253    },
     9254    43.2 => { # CSf16
     9255        Name => 'AssignMovieRecordButton',
     9256        Mask => 0x07,
     9257        PrintConv => {
     9258            0 => 'None',
     9259            1 => 'Choose Image Area (FX/DX/5:4)',
     9260            2 => 'Shutter Speed & Aperture Lock',
     9261            3 => 'ISO Sensitivity',
     9262            4 => 'Shooting Bank Menu',
     9263        },
     9264    },
     9265    46.1 => { # CSa5-c
     9266        Name => 'DynamicAreaAFDisplay',
     9267        Mask => 0x80,
     9268        PrintConv => \%offOn,
     9269    },
     9270    46.2 => { # CSa5-a
     9271        Name => 'AFPointIllumination',
     9272        Mask => 0x60,
     9273        PrintConv => {
     9274            0 => 'Off',
     9275            1 => 'On in Continuous Shooting Modes',
     9276            2 => 'On During Manual Focusing',
     9277            3 => 'On in Continuous Shooting and Manual Focusing',
     9278        },
     9279    },
     9280    46.3 => { # CSa10 (D4 is slightly different -- needs checking)
     9281        Name => 'StoreByOrientation',
     9282        Mask => 0x18,
     9283        PrintConv => {
     9284            0 => 'Off',
     9285            1 => 'Focus Point',
     9286            2 => 'Focus Point and AF-area mode',
     9287        },
     9288    },
     9289    46.4 => { # CSa5-d
     9290        Name => 'GroupAreaAFIllumination',
     9291        Mask => 0x04,
     9292        PrintConv => {
     9293            0 => 'Squares',
     9294            1 => 'Dots',
     9295        },
     9296    },
     9297    46.5 => { # CSa5-b
     9298        Name => 'AFPointBrightness',
     9299        Mask => 0x03,
     9300        PrintConv => {
     9301            0 => 'Low',
     9302            1 => 'Normal',
     9303            2 => 'High',
     9304            3 => 'Extra High',
     9305        },
     9306    },
     9307    47.1 => { # CSa8
     9308        Name => 'AFOnButton',
     9309        Mask => 0x70,
     9310        PrintConv => {
     9311            0 => 'AF On',
     9312            1 => 'AE/AF Lock',
     9313            2 => 'AE Lock Only',
     9314            3 => 'AE Lock (reset on release)',
     9315            4 => 'AE Lock (hold)',
     9316            5 => 'AF Lock Only',
     9317            6 => 'None',
     9318        },
     9319    },
     9320    47.2 => { # CSa9
     9321        Name => 'VerticalAFOnButton',
     9322        Mask => 0x07,
     9323        PrintConv => {
     9324            0 => 'Same as AF On',
     9325            1 => 'AF On',
     9326            2 => 'AE/AF Lock',
     9327            3 => 'AE Lock Only',
     9328            4 => 'AE Lock (reset on release)',
     9329            5 => 'AE Lock (hold)',
     9330            6 => 'AF Lock Only',
     9331            7 => 'None',
     9332        },
     9333    },
     9334    48.1 => { # CSf5
     9335        Name => 'SubSelectorAssignment',
     9336        Mask => 0x80,
     9337        PrintConv => {
     9338            0 => 'Focus Point Selection',
     9339            1 => 'Same As Multi-selector',
     9340        },
     9341    },
     9342    48.2 => { # CSg3-a
     9343        Name => 'MovieSubSelectorAssignment',
     9344        Mask => 0x07,
     9345        PrintConv => {
     9346            0 => 'None',
     9347            1 => 'Index Marking',
     9348            2 => 'AE/AF Lock',
     9349            3 => 'AE Lock Only',
     9350            4 => 'AE Lock (hold)',
     9351            5 => 'AF Lock Only',
     9352            6 => 'View Photo Shooting Info',
     9353        },
     9354    },
     9355    49.1 => { # CSf6-a
     9356        Name => 'SubSelector',
     9357        Mask => 0xf8,
     9358        PrintConv => {
     9359            0 => 'None',
     9360            1 => 'Preview',
     9361            2 => 'FV Lock',
     9362            3 => 'AE/AF Lock',
     9363            4 => 'AE Lock Only',
     9364            5 => 'AE Lock (reset on release)',
     9365            6 => 'AE Lock (hold)',
     9366            7 => 'AF Lock Only',
     9367            8 => 'AF-On',
     9368            # 9 - seen for D4 (PH)
     9369            10 => 'Bracketing Burst',
     9370            11 => 'Matrix Metering',
     9371            12 => 'Center-weighted Metering',
     9372            13 => 'Spot Metering',
     9373            14 => 'Playback',
     9374            15 => 'My Menu Top Item',
     9375            16 => '+NEF(RAW)',
     9376            17 => 'Virtual Horizon',
     9377            18 => 'My Menu',
     9378            19 => 'Reset',    # value appears to be specific to this control at this time
     9379            20 => 'Grid Display',
     9380            21 => 'Disable Synchronized Release',
     9381            22 => 'Remote Release Only',
     9382            23 => 'Preview',  # value appears to be specific to this control at this time
     9383            26 => 'Flash Disable/Enable',
     9384        },
     9385    },
     9386    49.2 => { # CSf6-b
     9387        Name => 'SubSelectorPlusDials',
     9388        Mask => 0x07,
     9389        PrintConv => {
     9390            # (not all values from CSf3-b/CSf4-b are available for CSf6-b)
     9391            0 => 'None',
     9392            1 => 'Choose Image Area (FX/DX/5:4)',
     9393            2 => 'Shutter Speed & Aperture Lock',
     9394            # 3 => 'One Step Speed / Aperture', # (not available)
     9395            4 => 'Choose Non-CPU Lens Number',
     9396            # 5 => 'Active D-Lighting',         # (not available)
     9397            6 => 'Shooting Bank Menu',
     9398        },
     9399    },
     9400    50.1 => { # CSb5
     9401        Name => 'MatrixMetering',
     9402        Condition => '$$self{Model} =~ /\bD4S/',
     9403        Notes => 'D4S only',
     9404        Mask => 0x80,
     9405        PrintConv => {
     9406            0 => 'Face Detection On',
     9407            1 => 'Face Detection Off',
     9408        },
     9409    },
     9410    50.2 => { # CSf17
     9411        Name => 'LiveViewButtonOptions',
     9412        Condition => '$$self{Model} =~ /\bD4S/',
     9413        Notes => 'D4S only',
     9414        Mask => 0x30,
     9415        PrintConv => {
     9416            0 => 'Enable',
     9417            1 => 'Enable (standby time active)',
     9418            2 => 'Disable',
     9419        },
     9420    },
     9421    50.3 => { # CSa12
     9422        Name => 'AFModeRestrictions',
     9423        Condition => '$$self{Model} =~ /\bD4S/',
     9424        Notes => 'D4S only',
     9425        Mask => 0x03,
     9426        PrintConv => {
     9427            0 => 'Off',
     9428            1 => 'AF-C',
     9429            2 => 'AF-S',
     9430        },
     9431    },
     9432    51.1 => { # CSa11
     9433        Name => 'LimitAFAreaModeSelection',
     9434        Condition => '$$self{Model} =~ /\bD4S/',
     9435        Notes => 'D4S only',
     9436        Mask => 0x7e,
     9437        PrintConv => {
     9438            0 => 'No Restrictions',
     9439            BITMASK => {
     9440                0 => 'Auto-area',
     9441                1 => 'Group-area',
     9442                2 => '3D-tracking',
     9443                3 => 'Dynamic area (51 points)',
     9444                4 => 'Dynamic area (21 points)',
     9445                5 => 'Dynamic area (9 points)',
     9446            },
     9447        },
     9448    },
     9449    52.1 => { # CSg1-b
     9450        Name => 'MovieFunctionButtonPlusDials',
     9451        Mask => 0x10,
     9452        PrintConv => {
     9453            0 => 'None',
     9454            1 => 'Choose Image Area',
     9455        },
     9456    },
     9457    52.2 => { # CSg2-b
     9458        Name => 'MoviePreviewButtonPlusDials',
     9459        Mask => 0x01,
     9460        PrintConv => {
     9461            0 => 'None',
     9462            1 => 'Choose Image Area',
     9463        },
     9464    },
     9465    53.1 => { # CSg3-b
     9466        Name => 'MovieSubSelectorAssignmentPlusDials',
     9467        Mask => 0x10,
     9468        PrintConv => {
     9469            0 => 'None',
     9470            1 => 'Choose Image Area',
     9471        },
     9472    },
     9473    54.1 => { # CSf18
     9474        Name => 'AssignRemoteFnButton',
     9475        Condition => '$$self{Model} =~ /\bD4S/',
     9476        Notes => 'D4S only',
     9477        Mask => 0x1f,
     9478        PrintConv => {
     9479            0 => 'None',
     9480            1 => 'Preview',
     9481            2 => 'FV Lock',
     9482            3 => 'AE/AF Lock',
     9483            4 => 'AE Lock Only',
     9484            5 => 'AE Lock (reset on release)',
     9485            7 => 'AF Lock Only',
     9486            8 => 'AF-On',
     9487            16 => '+NEF(RAW)',
     9488            25 => 'Live View',
     9489            26 => 'Flash Disable/Enable',
     9490        },
     9491    },
     9492    55.1 => { # CSf19
     9493        Name => 'LensFocusFunctionButtons',
     9494        Condition => '$$self{Model} =~ /\bD4S/',
     9495        Notes => 'D4S only',
     9496        Mask => 0x3f,
     9497        PrintConv => {
     9498            3 => 'AE/AF Lock',
     9499            4 => 'AE Lock Only',
     9500            7 => 'AF Lock Only',
     9501            21 => 'Disable Synchronized Release',
     9502            22 => 'Remote Release Only',
     9503            24 => 'Preset focus Point',
     9504            26 => 'Flash Disable/Enable',
     9505            32 => 'AF-Area Mode:  Single-point AF',
     9506            33 => 'AF-Area Mode: Dynamic-area AF (9 points)',
     9507            34 => 'AF-Area Mode: Dynamic-area AF (21 points)',
     9508            35 => 'AF-Area Mode: Dynamic-area AF (51 points)',
     9509            36 => 'AF-Area Mode: Group-area AF',
     9510            37 => 'AF-Area Mode: Auto area AF',
     9511        },
     9512    },
     9513);
    36859514
    368695151;  # end
     
    37009529The Nikon custom functions are very specific to the camera model (and
    37019530sometimes even change with firmware version).  The information is stored as
    3702 unformatted binary data in the ShotInfo record of the Nikon MakerNotes. 
     9531unformatted binary data in the ShotInfo record of the Nikon MakerNotes.
    37039532This module contains the definitions necessary for Image::ExifTool to decode
    37049533this information.
     
    37069535=head1 AUTHOR
    37079536
    3708 Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca)
     9537Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
    37099538
    37109539This library is free software; you can redistribute it and/or modify it
     
    37159544Thanks to Jens Duttke and Warren Hatch for their help decoding the D300 and
    37169545D3 custom settings.  And thanks to the customer service personnel at Best
    3717 Buy for not bugging me while I play with their cameras.
     9546Buy for not bugging me while I spent lots of time playing with their
     9547cameras.
    37189548
    37199549=head1 SEE ALSO
Note: See TracChangeset for help on using the changeset viewer.