"Fossies" - the Fresh Open Source Software Archive

Member "Image-ExifTool-11.93/lib/Image/ExifTool/Sony.pm" (19 Mar 2020, 428409 Bytes) of package /linux/misc/Image-ExifTool-11.93.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Sony.pm" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 11.89_vs_11.90.

    1 #------------------------------------------------------------------------------
    2 # File:         Sony.pm
    3 #
    4 # Description:  Sony EXIF Maker Notes tags
    5 #
    6 # Revisions:    04/06/2004  - P. Harvey Created
    7 #
    8 # References:   1) http://www.cybercom.net/~dcoffin/dcraw/
    9 #               2) http://homepage3.nifty.com/kamisaka/makernote/makernote_sony.htm (2006/08/06)
   10 #               3) Thomas Bodenmann private communication
   11 #               4) Philippe Devaux private communication (A700)
   12 #               5) Marcus Holland-Moritz private communication (A700)
   13 #               6) Andrey Tverdokhleb private communication
   14 #               7) Rudiger Lange private communication (A700)
   15 #               8) Igal Milchtaich private communication
   16 #               9) Michael Reitinger private communication (DSC-TX7,RX100)
   17 #               10) http://www.klingebiel.com/tempest/hd/pmp.html
   18 #               11) Mike Battilana private communication
   19 #               13) http://www.mi-fo.de/forum/index.php?showtopic=33239
   20 #                   http://www.dyxum.com/dforum/the-alpha-shutter-count-tool_topic97489_page4.html
   21 #               14) Albert Shan private communication (A7M3)
   22 #               IB) Iliah Borg private communication (LibRaw)
   23 #               JD) Jens Duttke private communication
   24 #               JR) Jos Roost private communication
   25 #
   26 #               NC = Not Confirmed
   27 #------------------------------------------------------------------------------
   28 
   29 package Image::ExifTool::Sony;
   30 
   31 use strict;
   32 use vars qw($VERSION %sonyLensTypes %sonyLensTypes2);
   33 use Image::ExifTool qw(:DataAccess :Utils);
   34 use Image::ExifTool::Exif;
   35 use Image::ExifTool::Minolta;
   36 
   37 $VERSION = '3.22';
   38 
   39 sub ProcessSRF($$$);
   40 sub ProcessSR2($$$);
   41 sub ProcessSonyPIC($$$);
   42 sub ProcessMoreInfo($$$);
   43 sub Process_rtmd($$$);
   44 sub Decipher($;$);
   45 sub ProcessEnciphered($$$);
   46 sub WriteEnciphered($$$);
   47 sub WriteSR2($$$);
   48 sub ConvLensSpec($);
   49 sub ConvInvLensSpec($);
   50 sub PrintLensSpec($);
   51 sub PrintInvLensSpec($;$$);
   52 
   53 # (%sonyLensTypes is filled in based on Minolta LensType's)
   54 
   55 # Sony E-mount lenses
   56 # (NOTE: these should be kept in sync with the 65535 entries in %minoltaLensTypes)
   57 %sonyLensTypes2 = (
   58     Notes => 'Lens type numbers for Sony E-mount lenses used by NEX/ILCE models.',
   59     0 => 'Unknown E-mount lens or other lens',
   60     0.1   => 'Sigma 19mm F2.8 [EX] DN',
   61     0.2   => 'Sigma 30mm F2.8 [EX] DN',
   62     0.3   => 'Sigma 60mm F2.8 DN',
   63     0.4   => 'Sony E 18-200mm F3.5-6.3 OSS LE',     # (firmware Ver.01)
   64     0.5   => 'Tamron 18-200mm F3.5-6.3 Di III VC',  # (Model B011)
   65     0.6   => 'Tokina FiRIN 20mm F2 FE AF',          # (firmware Ver.00) samples from Tokina, May 2018
   66     0.7   => 'Tokina FiRIN 20mm F2 FE MF',          # samples from Tokina, 16-12-2016, DC-watch 01-02-2017
   67     0.8   => 'Zeiss Touit 12mm F2.8',               # (firmware Ver.00)
   68     0.9   => 'Zeiss Touit 32mm F1.8',               # (firmware Ver.00)
   69    '0.10' => 'Zeiss Touit 50mm F2.8 Macro',         # (firmware Ver.00)
   70    '0.11' => 'Zeiss Loxia 50mm F2',                 # (firmware Ver.01)
   71    '0.12' => 'Zeiss Loxia 35mm F2',                 # (firmware Ver.01)
   72     1 => 'Sony LA-EA1 or Sigma MC-11 Adapter', # MC-11 with not-supported lenses
   73     2 => 'Sony LA-EA2 Adapter',
   74     3 => 'Sony LA-EA3 Adapter', #(NC) ILCE-7 image with A-mount lens, but also has 0x940e 2nd byte=2
   75     6 => 'Sony LA-EA4 Adapter', #(NC) ILCE-7R image with A-mount lens and having phase-detect info blocks in 0x940e AFInfo
   76     # 27 => Venus Optics Laowa 12mm f2.8 Zero-D or 105mm f2 (T3.2) Smooth Trans Focus (ref IB)
   77     44 => 'Metabones Canon EF Smart Adapter', #JR
   78     78 => 'Metabones Canon EF Smart Adapter Mark III or Other Adapter', #PH/JR (also Mark IV, Fotodiox and Viltrox)
   79     184 => 'Metabones Canon EF Speed Booster Ultra', #JR ('Green' mode, LensMount reported as A-mount)
   80     234 => 'Metabones Canon EF Smart Adapter Mark IV', #JR (LensMount reported as A-mount)
   81     239 => 'Metabones Canon EF Speed Booster', #JR
   82                                                 # Sony VX product code: (http://www.mi-fo.de/forum/index.php?s=7df1c8d3b1cd675f2abf4f4442e19cf2&showtopic=35035&view=findpost&p=303746)
   83     32784 => 'Sony E 16mm F2.8',                # VX9100
   84     32785 => 'Sony E 18-55mm F3.5-5.6 OSS',     # VX9101
   85     32786 => 'Sony E 55-210mm F4.5-6.3 OSS',    # VX9102
   86     32787 => 'Sony E 18-200mm F3.5-6.3 OSS',    # VX9103
   87     32788 => 'Sony E 30mm F3.5 Macro',          # VX9104
   88     32789 => 'Sony E 24mm F1.8 ZA or Samyang AF 50mm F1.4', # VX9105
   89     32789.1 => 'Samyang AF 50mm F1.4',
   90     32790 => 'Sony E 50mm F1.8 OSS or Samyang AF 14mm F2.8', # VX9106
   91     32790.1 => 'Samyang AF 14mm F2.8',
   92     32791 => 'Sony E 16-70mm F4 ZA OSS',        # VX9107
   93     32792 => 'Sony E 10-18mm F4 OSS',           # VX9108
   94     32793 => 'Sony E PZ 16-50mm F3.5-5.6 OSS',  # VX9109
   95     32794 => 'Sony FE 35mm F2.8 ZA or Samyang Lens', # VX9110
   96     32794.1 => 'Samyang AF 24mm F2.8', #JR
   97     32794.2 => 'Samyang AF 35mm F2.8', #IB (also 51505)
   98     32795 => 'Sony FE 24-70mm F4 ZA OSS',       # VX9111
   99     32796 => 'Sony FE 85mm F1.8 or Viltrox PFU RBMH 85mm F1.8', #JR
  100     32796.1 => 'Viltrox PFU RBMH 85mm F1.8', #JR (MF)
  101     32797 => 'Sony E 18-200mm F3.5-6.3 OSS LE', # VX9113 (firmware Ver.02)
  102     32798 => 'Sony E 20mm F2.8',                # VX9114
  103     32799 => 'Sony E 35mm F1.8 OSS',            # VX9115
  104     32800 => 'Sony E PZ 18-105mm F4 G OSS', #JR # VX9116
  105     32801 => 'Sony FE 12-24mm F4 G', #JR
  106     32802 => 'Sony FE 90mm F2.8 Macro G OSS',   # VX?
  107     32803 => 'Sony E 18-50mm F4-5.6',
  108     32804 => 'Sony FE 24mm F1.4 GM', #IB
  109     32805 => 'Sony FE 24-105mm F4 G OSS', #IB   # VX9121
  110 
  111     32807 => 'Sony E PZ 18-200mm F3.5-6.3 OSS', # VX9123
  112     32808 => 'Sony FE 55mm F1.8 ZA',            # VX9124
  113 
  114     32810 => 'Sony FE 70-200mm F4 G OSS', #JR   # VX9126
  115     32811 => 'Sony FE 16-35mm F4 ZA OSS', #JR   # VX9127
  116     32812 => 'Sony FE 50mm F2.8 Macro', #JR
  117     32813 => 'Sony FE 28-70mm F3.5-5.6 OSS',    # VX9129
  118     32814 => 'Sony FE 35mm F1.4 ZA',            # VX?
  119     32815 => 'Sony FE 24-240mm F3.5-6.3 OSS',   # VX?
  120     32816 => 'Sony FE 28mm F2', #JR             # VX?
  121     32817 => 'Sony FE PZ 28-135mm F4 G OSS',#JR # VX?
  122 
  123     32819 => 'Sony FE 100mm F2.8 STF GM OSS',   #JR (appears to use 33076 when switched to macro mode)
  124     32820 => 'Sony E PZ 18-110mm F4 G OSS', #JR
  125     32821 => 'Sony FE 24-70mm F2.8 GM', #JR/IB
  126     32822 => 'Sony FE 50mm F1.4 ZA', #JR
  127     32823 => 'Sony FE 85mm F1.4 GM or Samyang AF 85mm F1.4', #JR/IB
  128     32823.1 => 'Samyang AF 85mm F1.4', #IB
  129     32824 => 'Sony FE 50mm F1.8', #JR (Sony code 'SEL50F18F' with trailing "F" as compared to 'SEL50F18' for 32790)
  130 
  131     32826 => 'Sony FE 21mm F2.8 (SEL28F20 + SEL075UWC)', #JR          # (+ Ultra-wide converter)
  132     32827 => 'Sony FE 16mm F3.5 Fisheye (SEL28F20 + SEL057FEC)', #JR  # (+ Fisheye converter)
  133     32828 => 'Sony FE 70-300mm F4.5-5.6 G OSS', #JR
  134     32829 => 'Sony FE 100-400mm F4.5-5.6 GM OSS', #JR
  135     32830 => 'Sony FE 70-200mm F2.8 GM OSS', #JR
  136     32831 => 'Sony FE 16-35mm F2.8 GM', #JR
  137     32848 => 'Sony FE 400mm F2.8 GM OSS', #IB
  138     32849 => 'Sony E 18-135mm F3.5-5.6 OSS', #JR
  139     32850 => 'Sony FE 135mm F1.8 GM', #IB
  140     32851 => 'Sony FE 200-600mm F5.6-6.3 G OSS', #IB
  141     32852 => 'Sony FE 600mm F4 GM OSS', #IB
  142     32853 => 'Sony E 16-55mm F2.8 G', #IB/JR
  143     32854 => 'Sony E 70-350mm F4.5-6.3 G OSS', #IB/JR
  144     32858 => 'Sony FE 35mm F1.8', #JR/IB
  145     32859 => 'Sony FE 20mm F1.8 G', #IB/JR
  146 
  147   # (comment this out so LensID will report the LensModel, which is more useful)
  148   # 32952 => 'Metabones Canon EF Speed Booster Ultra', #JR (corresponds to 184, but 'Advanced' mode, LensMount reported as E-mount)
  149   # 33002 => 'Metabones Canon EF Smart Adapter with Ver.5x', #PH/JR (corresponds to 234, but LensMount reported as E-mount)
  150 
  151     33072 => 'Sony FE 70-200mm F2.8 GM OSS + 1.4X Teleconverter', #JR
  152     33073 => 'Sony FE 70-200mm F2.8 GM OSS + 2X Teleconverter', #JR
  153     33076 => 'Sony FE 100mm F2.8 STF GM OSS (macro mode)', #JR (with macro switching ring set to "0.57m - 1.0m")
  154     33077 => 'Sony FE 100-400mm F4.5-5.6 GM OSS + 1.4X Teleconverter', #JR
  155     33078 => 'Sony FE 100-400mm F4.5-5.6 GM OSS + 2X Teleconverter', #JR
  156     33079 => 'Sony FE 400mm F2.8 GM OSS + 1.4X Teleconverter', #IB
  157     33080 => 'Sony FE 400mm F2.8 GM OSS + 2X Teleconverter', #JR
  158     33081 => 'Sony FE 200-600mm F5.6-6.3 G OSS + 1.4X Teleconverter', #JR
  159     33082 => 'Sony FE 200-600mm F5.6-6.3 G OSS + 2X Teleconverter', #JR
  160     33083 => 'Sony FE 600mm F4 GM OSS + 1.4X Teleconverter', #JR (NC)
  161     33084 => 'Sony FE 600mm F4 GM OSS + 2X Teleconverter', #JR
  162 
  163     49201 => 'Zeiss Touit 12mm F2.8', #JR (lens firmware Ver.02)
  164     49202 => 'Zeiss Touit 32mm F1.8', #JR (lens firmware Ver.02)
  165     49203 => 'Zeiss Touit 50mm F2.8 Macro', #JR (lens firmware Ver.02)
  166     49216 => 'Zeiss Batis 25mm F2', #JR
  167     49217 => 'Zeiss Batis 85mm F1.8', #JR
  168     49218 => 'Zeiss Batis 18mm F2.8', #IB
  169     49219 => 'Zeiss Batis 135mm F2.8', #IB
  170     49220 => 'Zeiss Batis 40mm F2 CF', #IB
  171     49232 => 'Zeiss Loxia 50mm F2', #JR (lens firmware Ver.02)
  172     49233 => 'Zeiss Loxia 35mm F2', #JR (lens firmware Ver.02)
  173     49234 => 'Zeiss Loxia 21mm F2.8', #PH
  174     49235 => 'Zeiss Loxia 85mm F2.4', #JR
  175     49236 => 'Zeiss Loxia 25mm F2.4', #JR
  176 
  177     49457 => 'Tamron 28-75mm F2.8 Di III RXD', #JR (Model A036)
  178     49458 => 'Tamron 17-28mm F2.8 Di III RXD', #JR (Model A046)
  179     49459 => 'Tamron 35mm F2.8 Di III OSD M1:2', #IB (Model F053)
  180     49460 => 'Tamron 24mm F2.8 Di III OSD M1:2', #JR (Model F051)
  181     49461 => 'Tamron 20mm F2.8 Di III OSD M1:2', #JR (Model F050)
  182 
  183     49712 => 'Tokina FiRIN 20mm F2 FE AF',       # (firmware Ver.01)
  184     49713 => 'Tokina FiRIN 100mm F2.8 FE MACRO', # (firmware Ver.01)
  185 
  186     50480 => 'Sigma 30mm F1.4 DC DN | C', #IB/JR (016)
  187     50481 => 'Sigma 50mm F1.4 DG HSM | A', #JR (014 + MC-11 or 018)
  188     50482 => 'Sigma 18-300mm F3.5-6.3 DC MACRO OS HSM | C + MC-11', #JR (014)
  189     50483 => 'Sigma 18-35mm F1.8 DC HSM | A + MC-11', #JR (013)
  190     50484 => 'Sigma 24-35mm F2 DG HSM | A + MC-11', #JR (015)
  191     50485 => 'Sigma 24mm F1.4 DG HSM | A + MC-11', #JR (015)
  192     50486 => 'Sigma 150-600mm F5-6.3 DG OS HSM | C + MC-11', #JR (015)
  193     50487 => 'Sigma 20mm F1.4 DG HSM | A + MC-11', #JR (015)
  194     50488 => 'Sigma 35mm F1.4 DG HSM | A', #JR (012 + MC-11 or 018)
  195     50489 => 'Sigma 150-600mm F5-6.3 DG OS HSM | S + MC-11', #JR (014)
  196     50490 => 'Sigma 120-300mm F2.8 DG OS HSM | S + MC-11', #JR (013)
  197     50492 => 'Sigma 24-105mm F4 DG OS HSM | A + MC-11', #JR (013)
  198     50493 => 'Sigma 17-70mm F2.8-4 DC MACRO OS HSM | C + MC-11', #JR (013)
  199     50495 => 'Sigma 50-100mm F1.8 DC HSM | A + MC-11', #JR (016)
  200     50499 => 'Sigma 85mm F1.4 DG HSM | A', #JR (018)
  201     50501 => 'Sigma 100-400mm F5-6.3 DG OS HSM | C + MC-11', #JR (017)
  202     50503 => 'Sigma 16mm F1.4 DC DN | C', #JR (017)
  203     50507 => 'Sigma 105mm F1.4 DG HSM | A', #IB (018)
  204     50508 => 'Sigma 56mm F1.4 DC DN | C', #JR (018)
  205     50512 => 'Sigma 70-200mm F2.8 DG OS HSM | S + MC-11', #IB (018) (JR added "+ MC-11")
  206     50513 => 'Sigma 70mm F2.8 DG MACRO | A', #JR (018)
  207     50514 => 'Sigma 45mm F2.8 DG DN | C', #IB/JR (019)
  208     50515 => 'Sigma 35mm F1.2 DG DN | A', #IB/JR (019)
  209     50516 => 'Sigma 14-24mm F2.8 DG DN | A', #IB/JR (019)
  210     50517 => 'Sigma 24-70mm F2.8 DG DN | A', #JR (019)
  211 
  212     50992 => 'Voigtlander SUPER WIDE-HELIAR 15mm F4.5 III', #JR
  213     50993 => 'Voigtlander HELIAR-HYPER WIDE 10mm F5.6', #IB
  214     50994 => 'Voigtlander ULTRA WIDE-HELIAR 12mm F5.6 III', #IB
  215     50995 => 'Voigtlander MACRO APO-LANTHAR 65mm F2 Aspherical', #JR
  216     50996 => 'Voigtlander NOKTON 40mm F1.2 Aspherical', #JR
  217     50997 => 'Voigtlander NOKTON classic 35mm F1.4', #JR
  218     50998 => 'Voigtlander MACRO APO-LANTHAR 110mm F2.5', #JR
  219     50999 => 'Voigtlander COLOR-SKOPAR 21mm F3.5 Aspherical', #IB
  220     51000 => 'Voigtlander NOKTON 50mm F1.2 Aspherical', #JR
  221     51001 => 'Voigtlander NOKTON 21mm F1.4 Aspherical', #JR
  222     51002 => 'Voigtlander APO-LANTHAR 50mm F2 Aspherical', #JR
  223 
  224     # lenses listed in the Sigma MC-11 list, but not yet seen:
  225     # 504xx => 'Sigma 18-200mm F3.5-6.3 DC MACRO OS HSM | C + MC-11', # (014)
  226     # 504xx => 'Sigma 30mm F1.4 DC HSM | A + MC-11', # (013)
  227 
  228     51504 => 'Samyang AF 50mm F1.4', #IB
  229     51505 => 'Samyang AF 14mm F2.8 or Samyang AF 35mm F2.8', #forum3833
  230     51505.1 => 'Samyang AF 35mm F2.8', #PH (also 32794)
  231     51507 => 'Samyang AF 35mm F1.4', #IB
  232     51508 => 'Samyang AF 45mm F1.8',
  233     51510 => 'Samyang AF 18mm F2.8', #JR
  234 
  235 );
  236 
  237 # ExposureProgram values (ref PH, mainly decoded from A200)
  238 my %sonyExposureProgram = (
  239     0 => 'Auto', # (same as 'Program AE'?)
  240     1 => 'Manual',
  241     2 => 'Program AE',
  242     3 => 'Aperture-priority AE',
  243     4 => 'Shutter speed priority AE',
  244     8 => 'Program Shift A', #7
  245     9 => 'Program Shift S', #7
  246     16 => 'Portrait', # (A330)
  247     17 => 'Sports', # (A330)
  248     18 => 'Sunset', # (A330)
  249     19 => 'Night Portrait', # (A330)
  250     20 => 'Landscape', # (A330)
  251     21 => 'Macro', # (A330)
  252     35 => 'Auto No Flash', # (A330)
  253 );
  254 
  255 # ExposureProgram values in CameraSettings3 (ref JR)
  256 my %sonyExposureProgram2 = (            # A580 Mode Dial setting:
  257      1 => 'Program AE',                 # P
  258      2 => 'Aperture-priority AE',       # A
  259      3 => 'Shutter speed priority AE',  # S
  260      4 => 'Manual',                     # M
  261      5 => 'Cont. Priority AE',          # (A35)
  262     16 => 'Auto',                       # AUTO
  263     17 => 'Auto (no flash)',            # "flash strike-out" symbol
  264     18 => 'Auto+',                      #PH (A33)
  265     49 => 'Portrait',                   # SCN
  266     50 => 'Landscape',                  # SCN
  267     51 => 'Macro',                      # SCN
  268     52 => 'Sports',                     # SCN
  269     53 => 'Sunset',                     # SCN
  270     54 => 'Night view',                 # SCN
  271     55 => 'Night view/portrait',        # SCN
  272     56 => 'Handheld Night Shot',        # SCN (also called "Hand-held Twilight")
  273     57 => '3D Sweep Panorama',          # "Panorama" symbol
  274     64 => 'Auto 2',                     #PH (A33 AUTO)
  275     65 => 'Auto 2 (no flash)',          #JR (NC, A35)
  276     80 => 'Sweep Panorama',             # "Panorama" symbol
  277     96 => 'Anti Motion Blur',           #PH (NEX-5)
  278     # 128-138 are A35 picture effects (combined SCN/Picture effect mode dial position)
  279     128 => 'Toy Camera',
  280     129 => 'Pop Color',
  281     130 => 'Posterization',
  282     131 => 'Posterization B/W',
  283     132 => 'Retro Photo',
  284     133 => 'High-key',
  285     134 => 'Partial Color Red',
  286     135 => 'Partial Color Green',
  287     136 => 'Partial Color Blue',
  288     137 => 'Partial Color Yellow',
  289     138 => 'High Contrast Monochrome',
  290 );
  291 
  292 # ExposureProgram values in Tags 2010 and 94xx (ref JR)
  293 my %sonyExposureProgram3 = (
  294      0 => 'Program AE',
  295      1 => 'Aperture-priority AE',
  296      2 => 'Shutter speed priority AE',
  297      3 => 'Manual',
  298      4 => 'Auto',
  299      5 => 'iAuto',
  300      6 => 'Superior Auto',
  301      7 => 'iAuto+',
  302      8 => 'Portrait',
  303      9 => 'Landscape',
  304     10 => 'Twilight',
  305     11 => 'Twilight Portrait',
  306     12 => 'Sunset',
  307     14 => 'Action (High speed)', #PH (RX100)
  308     16 => 'Sports',
  309     17 => 'Handheld Night Shot',
  310     18 => 'Anti Motion Blur',
  311     19 => 'High Sensitivity',
  312     21 => 'Beach',
  313     22 => 'Snow',
  314     23 => 'Fireworks',
  315     26 => 'Underwater',
  316     27 => 'Gourmet',
  317     28 => 'Pet',
  318     29 => 'Macro',
  319     30 => 'Backlight Correction HDR',
  320     # 32 => 'Night ... ???', # seen for HDR-CX360E
  321     33 => 'Sweep Panorama',
  322     36 => 'Background Defocus',
  323     37 => 'Soft Skin',
  324     42 => '3D Image',
  325     43 => 'Cont. Priority AE',
  326     45 => 'Document',
  327     46 => 'Party',
  328 );
  329 
  330 # WhiteBalanceSetting values (ref JR)
  331 my %whiteBalanceSetting = (
  332     0x10 => 'Auto (-3)', #(NC)
  333     0x11 => 'Auto (-2)', #(NC)
  334     0x12 => 'Auto (-1)', #(NC)
  335     0x13 => 'Auto (0)',
  336     0x14 => 'Auto (+1)', #(NC)
  337     0x15 => 'Auto (+2)', #(NC)
  338     0x16 => 'Auto (+3)', #(NC)
  339     0x20 => 'Daylight (-3)',
  340     0x21 => 'Daylight (-2)', #(NC)
  341     0x22 => 'Daylight (-1)', #(NC)
  342     0x23 => 'Daylight (0)',
  343     0x24 => 'Daylight (+1)',
  344     0x25 => 'Daylight (+2)',
  345     0x26 => 'Daylight (+3)',
  346     0x30 => 'Shade (-3)', #(NC)
  347     0x31 => 'Shade (-2)', #(NC)
  348     0x32 => 'Shade (-1)', #(NC)
  349     0x33 => 'Shade (0)',
  350     0x34 => 'Shade (+1)', #(NC)
  351     0x35 => 'Shade (+2)', #(NC)
  352     0x36 => 'Shade (+3)',
  353     0x40 => 'Cloudy (-3)', #(NC)
  354     0x41 => 'Cloudy (-2)', #(NC)
  355     0x42 => 'Cloudy (-1)', #(NC)
  356     0x43 => 'Cloudy (0)',
  357     0x44 => 'Cloudy (+1)', #(NC)
  358     0x45 => 'Cloudy (+2)', #(NC)
  359     0x46 => 'Cloudy (+3)', #(NC)
  360     0x50 => 'Tungsten (-3)', #(NC)
  361     0x51 => 'Tungsten (-2)', #(NC)
  362     0x52 => 'Tungsten (-1)', #(NC)
  363     0x53 => 'Tungsten (0)',
  364     0x54 => 'Tungsten (+1)', #(NC)
  365     0x55 => 'Tungsten (+2)', #(NC)
  366     0x56 => 'Tungsten (+3)', #(NC)
  367     0x60 => 'Fluorescent (-3)', #(NC)
  368     0x61 => 'Fluorescent (-2)', #(NC)
  369     0x62 => 'Fluorescent (-1)', #(NC)
  370     0x63 => 'Fluorescent (0)',
  371     0x64 => 'Fluorescent (+1)', #(NC)
  372     0x65 => 'Fluorescent (+2)', #(NC)
  373     0x66 => 'Fluorescent (+3)', #(NC)
  374     0x70 => 'Flash (-3)', #(NC)
  375     0x71 => 'Flash (-2)', #(NC)
  376     0x72 => 'Flash (-1)', #(NC)
  377     0x73 => 'Flash (0)',
  378     0x74 => 'Flash (+1)', #(NC)
  379     0x75 => 'Flash (+2)', #(NC)
  380     0x76 => 'Flash (+3)', #(NC)
  381     0xa3 => 'Custom',
  382     0xf3 => 'Color Temperature/Color Filter',
  383 );
  384 
  385 # AF points for cameras with 15-point AF (ref JR)
  386 my %afPoint15 = (
  387     0 => 'Upper-left',
  388     1 => 'Left',
  389     2 => 'Lower-left',
  390     3 => 'Far Left',
  391     4 => 'Top (horizontal)',
  392     5 => 'Near Right',
  393     6 => 'Center (horizontal)',
  394     7 => 'Near Left',
  395     8 => 'Bottom (horizontal)',
  396     9 => 'Top (vertical)',
  397     10 => 'Center (vertical)',
  398     11 => 'Bottom (vertical)',
  399     12 => 'Far Right',
  400     13 => 'Upper-right',
  401     14 => 'Right',
  402     15 => 'Lower-right',
  403     16 => 'Upper-middle',
  404     17 => 'Lower-middle',
  405 );
  406 
  407 # AF points for cameras with 19-point AF (ref PH)
  408 # (verified for A77 firmware 1.07)
  409 my %afPoint19 = (
  410     0 => 'Upper Far Left',
  411     1 => 'Upper-left (horizontal)',
  412     2 => 'Far Left (horizontal)',
  413     3 => 'Left (horizontal)',
  414     4 => 'Lower Far Left',
  415     5 => 'Lower-left (horizontal)',
  416     6 => 'Upper-left (vertical)',
  417     7 => 'Left (vertical)',
  418     8 => 'Lower-left (vertical)',
  419     9 => 'Far Left (vertical)',
  420     10 => 'Top (horizontal)',
  421     11 => 'Near Right',
  422     12 => 'Center (horizontal)',
  423     13 => 'Near Left',
  424     14 => 'Bottom (horizontal)',
  425     15 => 'Top (vertical)',
  426     16 => 'Upper-middle',
  427     17 => 'Center (vertical)',
  428     18 => 'Lower-middle',
  429     19 => 'Bottom (vertical)',
  430     20 => 'Upper Far Right',
  431     21 => 'Upper-right (horizontal)',
  432     22 => 'Far Right (horizontal)',
  433     23 => 'Right (horizontal)',
  434     24 => 'Lower Far Right',
  435     25 => 'Lower-right (horizontal)',
  436     26 => 'Far Right (vertical)',
  437     27 => 'Upper-right (vertical)',
  438     28 => 'Right (vertical)',
  439     29 => 'Lower-right (vertical)',
  440 );
  441 
  442 # 79 AF point layout and indices for ILCA-68/77M2, numbered 0-78 for direct look-up from BITMASK in 0x2020,
  443 # E6 = Center (ref JR)
  444 my %afPoints79 = (
  445                                              0=>'A5',  1=>'A6',  2=>'A7',
  446                3=>'B2',  4=>'B3',  5=>'B4',  6=>'B5',  7=>'B6',  8=>'B7',  9=>'B8', 10=>'B9', 11=>'B10',
  447     12=>'C1', 13=>'C2', 14=>'C3', 15=>'C4', 16=>'C5', 17=>'C6', 18=>'C7', 19=>'C8', 20=>'C9', 21=>'C10', 22=>'C11',
  448     23=>'D1', 24=>'D2', 25=>'D3', 26=>'D4', 27=>'D5', 28=>'D6', 29=>'D7', 30=>'D8', 31=>'D9', 32=>'D10', 33=>'D11',
  449     34=>'E1', 35=>'E2', 36=>'E3', 37=>'E4', 38=>'E5', 39=>'E6', 40=>'E7', 41=>'E8', 42=>'E9', 43=>'E10', 44=>'E11',
  450     45=>'F1', 46=>'F2', 47=>'F3', 48=>'F4', 49=>'F5', 50=>'F6', 51=>'F7', 52=>'F8', 53=>'F9', 54=>'F10', 55=>'F11',
  451     56=>'G1', 57=>'G2', 58=>'G3', 59=>'G4', 60=>'G5', 61=>'G6', 62=>'G7', 63=>'G8', 64=>'G9', 65=>'G10', 66=>'G11',
  452               67=>'H2', 68=>'H3', 69=>'H4', 70=>'H5', 71=>'H6', 72=>'H7', 73=>'H8', 74=>'H9', 75=>'H10',
  453                                             76=>'I5', 77=>'I6', 78=>'I7',
  454 );
  455 
  456 # AFPoint and AFStatus tags in AFInfo(Tag940e) use numbers 0 to 94 for the 79 positions + 15 cross + 1 F2.8
  457 my %afPoints79_940e = (
  458                                             59=>'A5', 50=>'A6', 41=>'A7',
  459               14=>'B2',  7=>'B3',  0=>'B4', 60=>'B5', 51=>'B6', 42=>'B7', 87=>'B8', 80=>'B9', 73=>'B10',
  460     21=>'C1', 15=>'C2',  8=>'C3',  1=>'C4', 61=>'C5', 52=>'C6', 43=>'C7', 88=>'C8', 81=>'C9', 74=>'C10', 68=>'C11',
  461     22=>'D1', 16=>'D2',  9=>'D3',  2=>'D4', 62=>'D5', 53=>'D6', 44=>'D7', 89=>'D8', 82=>'D9', 75=>'D10', 69=>'D11',
  462     23=>'E1', 17=>'E2', 10=>'E3',  3=>'E4', 63=>'E5', 54=>'E6 Center', 45=>'E7', 90=>'E8', 83=>'E9', 76=>'E10', 70=>'E11',
  463     24=>'F1', 18=>'F2', 11=>'F3',  4=>'F4', 64=>'F5', 55=>'F6', 46=>'F7', 91=>'F8', 84=>'F9', 77=>'F10', 71=>'F11',
  464     25=>'G1', 19=>'G2', 12=>'G3',  5=>'G4', 65=>'G5', 56=>'G6', 47=>'G7', 92=>'G8', 85=>'G9', 78=>'G10', 72=>'G11',
  465               20=>'H2', 13=>'H3',  6=>'H4', 66=>'H5', 57=>'H6', 48=>'H7', 93=>'H8', 86=>'H9', 79=>'H10',
  466                                             67=>'I5', 58=>'I6', 49=>'I7',
  467 
  468                                    28=>'A5 Vertical', 27=>'A6 Vertical', 26=>'A7 Vertical',
  469                                    31=>'C5 Vertical', 30=>'C6 Vertical', 29=>'C7 Vertical',
  470                                    34=>'E5 Vertical', 33=>'E6 Center Vertical', 32=>'E7 Vertical',
  471                                    37=>'G5 Vertical', 36=>'G6 Vertical', 35=>'G7 Vertical',
  472                                    40=>'I5 Vertical', 39=>'I6 Vertical', 38=>'I7 Vertical',
  473 
  474                                                       94=>'E6 Center F2.8',
  475 );
  476 
  477 # ILCA-99M2 has dedicated 79 point Phase Detection AF sensor with similar layout as ILCA-68 and ILCA-77M2.
  478 # ILCA-99M2 has also 399 Focal Plane Phase-Detection AF Points in 19 rows of 21 points, same as ILCE-7RM2.
  479 # Of these 399 points, 323 points are selectable: 19 rows of 17 points (2 left-most and right-most columns not selectable).
  480 # The 79 Focal Plane points that overlap with the 79 points of the dedicated sensor provide for Hybrid Phase AF Points.
  481 # Tag 0x201e gives value 162 for the Center AF point, and 162 is exactly the center of 323 points...
  482 # The below table lists the selectable AF points that correspond to the 79 points of the dedicated sensor. (ref JR)
  483 my %afPoints99M2 = (
  484                                                                            93=>'A5 (93)',   94=>'A6 (94)',   95=>'A7 (95)',
  485                     106=>'B2 (106)', 107=>'B3 (107)', 108=>'B4 (108)',    110=>'B5 (110)', 111=>'B6 (111)', 112=>'B7 (112)',    114=>'B8 (114)', 115=>'B9 (115)', 116=>'B10 (116)',
  486    122=>'C1 (122)', 123=>'C2 (123)', 124=>'C3 (124)', 125=>'C4 (125)',    127=>'C5 (127)', 128=>'C6 (128)', 129=>'C7 (129)',    131=>'C8 (131)', 132=>'C9 (132)', 133=>'C10 (133)', 134=>'C11 (134)',
  487    139=>'D1 (139)', 140=>'D2 (140)', 141=>'D3 (141)', 142=>'D4 (142)',    144=>'D5 (144)', 145=>'D6 (145)', 146=>'D7 (146)',    148=>'D8 (148)', 149=>'D9 (149)', 150=>'D10 (150)', 151=>'D11 (151)',
  488    156=>'E1 (156)', 157=>'E2 (157)', 158=>'E3 (158)', 159=>'E4 (159)',    161=>'E5 (161)', 162=>'E6 (162)', 163=>'E7 (163)',    165=>'E8 (165)', 166=>'E9 (166)', 167=>'E10 (167)', 168=>'E11 (168)',
  489    173=>'F1 (173)', 174=>'F2 (174)', 175=>'F3 (175)', 176=>'F4 (176)',    178=>'F5 (178)', 179=>'F6 (179)', 180=>'F7 (180)',    182=>'F8 (182)', 183=>'F9 (183)', 184=>'F10 (184)', 185=>'F11 (185)',
  490    190=>'G1 (190)', 191=>'G2 (191)', 192=>'G3 (192)', 193=>'G4 (193)',    195=>'G5 (195)', 196=>'G6 (196)', 197=>'G7 (197)',    199=>'G8 (199)', 200=>'G9 (200)', 201=>'G10 (201)', 202=>'G11 (202)',
  491                     208=>'H2 (208)', 209=>'H3 (209)', 210=>'H4 (210)',    212=>'H5 (212)', 213=>'H6 (213)', 214=>'H7 (214)',    216=>'H8 (216)', 217=>'H9 (217)', 218=>'H10 (218)',
  492                                                                           229=>'I5 (229)', 230=>'I6 (230)', 231=>'I7 (231)',
  493 );
  494 
  495 my %binaryDataAttrs = (
  496     PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  497     WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  498     CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  499     WRITABLE => 1,
  500     FIRST_ENTRY => 0,
  501 );
  502 
  503 # tagInfo attributes for unknown cipher block tags
  504 my %unknownCipherData = (
  505     Unknown => 1,   # require Unknown option
  506     Hidden => 1,    # doesn't appear in Tag Name documentation
  507     RawConv => sub { Decipher(\$_[0]); return $_[0] },
  508     ValueConv => 'PrintHex($val)',                      # print as hex
  509     PrintConv => 'length($val) > 65 ? substr($val,0,60) . "[...]" : $val',  # limit length
  510 );
  511 
  512 my %meterInfo1 = (
  513     Format => 'int32u[27]',
  514     PrintConv => 'sprintf("%19d %4d %6d" . " %3d %4d %6d" x 8, split(" ",$val))',
  515     PrintConvInv => '$val',
  516 );
  517 my %meterInfo2 = (
  518     Format => 'int32u[33]',
  519     PrintConv => 'sprintf("%3d %4d %6d" . " %3d %4d %6d" x 10, split(" ",$val))',
  520     PrintConvInv => '$val',
  521 );
  522 my %meterInfo1b = (
  523     Format => 'undef[90]',
  524     ValueConv => \&ConvMeter1,
  525     PrintConv => 'sprintf("%19d %4d %6d" . " %3d %4d %6d" x 8, split(" ",$val))',
  526 );
  527 my %meterInfo2b = (
  528     Format => 'undef[110]',
  529     ValueConv => \&ConvMeter2,
  530     PrintConv => 'sprintf("%3d %4d %6d" . " %3d %4d %6d" x 10, split(" ",$val))',
  531 );
  532 
  533 my %hidUnk = ( Hidden => 1, Unknown => 1 );
  534 
  535 # Sony maker notes tags (some elements in common with %Image::ExifTool::Minolta::Main)
  536 %Image::ExifTool::Sony::Main = (
  537     WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  538     CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  539     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  540     NOTES => q{
  541         The following information has been decoded from the MakerNotes of Sony
  542         cameras.  Some of these tags have been inherited from the Minolta
  543         MakerNotes.
  544     },
  545     0x0010 => [ #PH
  546         # appears to contain mostly AF related information;
  547         # for SLT-A77V and newer, similar info is found in 0x940e AFInfo" (ref JR)
  548         {
  549             Name => 'CameraInfo',
  550             # count: A700=368, A850/A900=5478
  551             Condition => '$count == 368 or $count == 5478',
  552             SubDirectory => {
  553                 TagTable => 'Image::ExifTool::Sony::CameraInfo',
  554                 ByteOrder => 'BigEndian',
  555             },
  556         },{
  557             Name => 'CameraInfo2',
  558             # count: A200/A300/A350=5506, A230/A290/A330/A380/A390=6118
  559             Condition => '$count == 5506 or $count == 6118',
  560             SubDirectory => {
  561                 TagTable => 'Image::ExifTool::Sony::CameraInfo2',
  562                 ByteOrder => 'LittleEndian',
  563             },
  564         },{
  565             Name => 'CameraInfo3',
  566             # count: A33/A35/A55V/A450/A500/A550/A560/A580/NEX3/5/5C/C3/VG10E=15360
  567             Condition => '$count == 15360',
  568             SubDirectory => {
  569                 TagTable => 'Image::ExifTool::Sony::CameraInfo3',
  570                 ByteOrder => 'LittleEndian',
  571             },
  572         },{
  573             Name => 'CameraInfoUnknown',
  574             SubDirectory => { TagTable => 'Image::ExifTool::Sony::CameraInfoUnknown' },
  575         },
  576     ],
  577     # 0x0018 - starts with "GYRO" for sweep panorama images (ref JR)
  578     #        - contains ImageStabilization information for Minolta
  579     0x0020 => [
  580         # similar to WBInfoA100 in Minolta.pm.
  581         # appears to contain various types of information, as in MoreInfo. (ref JR)
  582         {
  583             Name => 'FocusInfo', #PH
  584             # count: A200/A230/A290/A300/A330/A350/A380/A390==19154, A700/A850/A900=19148
  585             Condition => '$count == 19154 or $count == 19148',
  586             SubDirectory => {
  587                 TagTable => 'Image::ExifTool::Sony::FocusInfo',
  588                 ByteOrder => 'LittleEndian',
  589             },
  590         },{
  591             Name => 'MoreInfo', #JR
  592             # count: A450/A500/A550/A560/A580/A33/A35/A55/NEX-3/5/C3/VG10E==20480
  593             SubDirectory => {
  594                 TagTable => 'Image::ExifTool::Sony::MoreInfo',
  595                 ByteOrder => 'LittleEndian',
  596             },
  597         },
  598     ],
  599     0x0102 => { #5/JD
  600         Name => 'Quality',
  601         Writable => 'int32u',
  602         PrintConv => {
  603             0 => 'RAW',
  604             1 => 'Super Fine',
  605             2 => 'Fine',
  606             3 => 'Standard',
  607             4 => 'Economy',
  608             5 => 'Extra Fine',
  609             6 => 'RAW + JPEG',
  610             7 => 'Compressed RAW',
  611             8 => 'Compressed RAW + JPEG',
  612             0xffffffff => 'n/a', #PH (SLT-A57 panorama)
  613         },
  614     },
  615     0x0104 => { #5/JD
  616         Name => 'FlashExposureComp',
  617         Description => 'Flash Exposure Compensation',
  618         Writable => 'rational64s',
  619     },
  620     0x0105 => { #5/JD (models since mid-2014, ILCA-77M2, ILCE-7M2/7RM2/7SM2, do not report this tag anymore, ref JR)
  621         Name => 'Teleconverter',
  622         Writable => 'int32u',
  623         PrintHex => 1,
  624         PrintConv => \%Image::ExifTool::Minolta::minoltaTeleconverters,
  625     },
  626     0x0112 => { #JD
  627         Name => 'WhiteBalanceFineTune',
  628         Format => 'int32s',
  629         Writable => 'int32u',
  630     },
  631     0x0114 => [ #PH
  632         {
  633             Name => 'CameraSettings',
  634             # count: A200/A300/A350/A700=280, A850/A900=364
  635             Condition => '$count == 280 or $count == 364',
  636             SubDirectory => {
  637                 TagTable => 'Image::ExifTool::Sony::CameraSettings',
  638                 ByteOrder => 'BigEndian',
  639             },
  640         },{
  641             Name => 'CameraSettings2',
  642             # count: A230/A290/A330/A380/A390=332
  643             Condition => '$count == 332',
  644             SubDirectory => {
  645                 TagTable => 'Image::ExifTool::Sony::CameraSettings2',
  646                 ByteOrder => 'BigEndian',
  647             },
  648         },{
  649             Name => 'CameraSettings3',
  650             # count: A560/A580/A33/A35/A55/NEX3/5/5C/C3/VG10E=1536, A450/A500/A550=2048
  651             Condition => '$count == 1536 || $count == 2048',
  652             SubDirectory => {
  653                 TagTable => 'Image::ExifTool::Sony::CameraSettings3',
  654                 ByteOrder => 'LittleEndian',
  655             },
  656         },{
  657             Name => 'CameraSettingsUnknown',
  658             SubDirectory => {
  659                 TagTable => 'Image::ExifTool::Sony::CameraSettingsUnknown',
  660                 ByteOrder => 'BigEndian',
  661             },
  662         },
  663     ],
  664     0x0115 => { #JD
  665         Name => 'WhiteBalance',
  666         Writable => 'int32u',
  667         Priority => 2, # (more reliable for the RX100)
  668         PrintHex => 1,
  669         PrintConv => {
  670             0x00 => 'Auto',
  671             0x01 => 'Color Temperature/Color Filter',
  672             0x10 => 'Daylight',
  673             0x20 => 'Cloudy',
  674             0x30 => 'Shade',
  675             0x40 => 'Tungsten',
  676             0x50 => 'Flash',
  677             0x60 => 'Fluorescent',
  678             0x70 => 'Custom',
  679             0x80 => 'Underwater',
  680         },
  681     },
  682     # Tag 0x0116: extra hardware info (ref JR)
  683     # (tag not present for A100, A200, A300, A350, A700, nor for A37, A57, A65, A77)
  684     0x0116 => [ #JR
  685         {
  686             Name => 'ExtraInfo',
  687             Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
  688             SubDirectory => {
  689                 TagTable => 'Image::ExifTool::Sony::ExtraInfo',
  690                 ByteOrder => 'BigEndian',
  691             },
  692         },{
  693             Name => 'ExtraInfo2',
  694             Condition => '$$self{Model} =~ /^DSLR-A(230|290|330|380|390)\b/',
  695             SubDirectory => { TagTable => 'Image::ExifTool::Sony::ExtraInfo2' },
  696         },{
  697             Name => 'ExtraInfo3',
  698             # for DSLR-A450/500/550/560/580, SLT-A33/35/55 and NEX-3/5/5C.
  699             SubDirectory => { TagTable => 'Image::ExifTool::Sony::ExtraInfo3' },
  700         }
  701     ],
  702     0x0e00 => {
  703         Name => 'PrintIM',
  704         Description => 'Print Image Matching',
  705         SubDirectory => { TagTable => 'Image::ExifTool::PrintIM::Main' },
  706     },
  707     # the next 3 tags have a different meaning for some models (with format int32u)
  708     0x1000 => { #9 (F88, multi burst mode only)
  709         Name => 'MultiBurstMode',
  710         Condition => '$format eq "undef"',
  711         Notes => 'MultiBurst tags valid only for models with this feature, like the F88',
  712         Writable => 'undef',
  713         Format => 'int8u',
  714         PrintConv => { 0 => 'Off', 1 => 'On' },
  715     },
  716     0x1001 => { #9 (F88, multi burst mode only)
  717         Name => 'MultiBurstImageWidth',
  718         Condition => '$format eq "int16u"',
  719         Writable => 'int16u',
  720     },
  721     0x1002 => { #9 (F88, multi burst mode only)
  722         Name => 'MultiBurstImageHeight',
  723         Condition => '$format eq "int16u"',
  724         Writable => 'int16u',
  725     },
  726     0x1003 => { #9 (64 bytes, contains Panorama info for various DSC, NEX, SLT and DSLR models)
  727         Name => 'Panorama',
  728         # panorama: first 4 bytes '1 1 0 0' (little-endian) or '0 0 1 1' (big-endian)
  729         # non-panorama: all bytes are '0' (ref JR)
  730         Condition => '$$self{Panorama} = ($$valPt =~ /^(\0\0)?\x01\x01/)', # (little- or big-endian int32u = 257)
  731         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Panorama' },
  732     },
  733     # 0x2000 - undef[1]
  734     0x2001 => { #PH (JPEG images from all DSLR's except the A100)
  735         Name => 'PreviewImage',
  736         Groups => { 2 => 'Preview' },
  737         Writable => 'undef',
  738         DataTag => 'PreviewImage',
  739         Notes => 'HD-size preview in JPEG images from almost all DSLR/SLT/ILCA/NEX/ILCE.',
  740         # Note: the preview data starts with a 32-byte proprietary Sony header
  741         #       first 8 bytes after 32-byte header:
  742         #          \x00\xd8\xff\xe1\x00\x27\xff\xff for JPEG files from A33/35/55V/450/500/550/560/580, NEX-3/5/5C/C3/VG10
  743         #          \x00\xd8\xff\xdb\x00\x84\x00\x01 for JPEG files from all other models
  744         #        ( \xff\xd8\xff\xdb\x00\x84\x00\x01 corresponding bytes for all ARW files )
  745         #
  746         # DSLR-A700/A850/A900 and DSLR-A200/A300/A350:
  747         # - no MPImage2
  748         # DSLR-A230/A290/A330/A380/A390:
  749         # - PreviewImage start-offset is at 110 bytes inside MPImage2
  750         # DSLR-A450/A500/A550/A560/A580, SLT-A33/A35/A55V, NEX-3/5/5C/C3/VG10/VG10E:
  751         # - PreviewImage start-offset is at 106 bytes inside MPImage2
  752         # - different first bytes after 32-byte header
  753         # SLT-A37/A57/A58/A65V/A77V/A99V, ILCA-77M2, NEX-3N/5N/5R/5T/6/7/F3, ILCE-3000/3500/5000/6000/7/7R/7S:
  754         # - PreviewImage start-offset is at 130 bytes inside MPImage2
  755         # NEX-VG20E/VG30E/VG900, ILCE-QX1: 0x2001 not present
  756         # ILCE-5100/ILCE-7M2/7RM2/7SM2   : 0x2001 present but Size 0 and Offset 0
  757         #
  758         WriteCheck => 'return $val=~/^(none|.{32}\xff\xd8\xff)/s ? undef : "Not a valid image"',
  759         RawConv => q{
  760             return \$val if $val =~ /^Binary/;
  761             $val = substr($val,0x20) if length($val) > 0x20;
  762 #            return \$val if $val =~ s/^.(\xd8\xff\xdb)/\xff$1/s;
  763             return \$val if $val =~ s/^.(\xd8\xff[\xdb\xe1])/\xff$1/s;
  764             $$self{PreviewError} = 1 unless $val eq 'none' or $val eq '';
  765             return undef;
  766         },
  767         # must construct 0x20-byte header which contains length, width and height
  768         ValueConvInv => q{
  769             return 'none' unless $val;
  770             my $e = new Image::ExifTool;
  771             my $info = $e->ImageInfo(\$val,'ImageWidth','ImageHeight');
  772             return undef unless $$info{ImageWidth} and $$info{ImageHeight};
  773             my $size = Set32u($$info{ImageWidth}) . Set32u($$info{ImageHeight});
  774             return Set32u(length $val) . $size . ("\0" x 8) . $size . ("\0" x 4) . $val;
  775         },
  776     },
  777     0x2002 => { #JR (written by Sony IDC)
  778         Name => 'Rating',
  779         Writable => 'int32u', # (0-5 stars) (4294967295 for an HX9V iSweep Panorama, ref JR)
  780     },
  781     # 0x2003 - string[256]: all 0 for DSLR, SLT, NEX; data for DSC-HX9V
  782     0x2004 => { #PH (NEX-5)
  783         Name => 'Contrast',
  784         Writable => 'int32s',
  785         PrintConv => '$val > 0 ? "+$val" : $val',
  786         PrintConvInv => '$val',
  787     },
  788     0x2005 => { #PH (NEX-5)
  789         Name => 'Saturation',
  790         Writable => 'int32s',
  791         PrintConv => '$val > 0 ? "+$val" : $val',
  792         PrintConvInv => '$val',
  793     },
  794     0x2006 => { #PH
  795         Name => 'Sharpness',
  796         Writable => 'int32s',
  797         PrintConv => '$val > 0 ? "+$val" : $val',
  798         PrintConvInv => '$val',
  799     },
  800     0x2007 => { #PH
  801         Name => 'Brightness',
  802         Writable => 'int32s',
  803         PrintConv => '$val > 0 ? "+$val" : $val',
  804         PrintConvInv => '$val',
  805     },
  806     0x2008 => { #PH
  807         Name => 'LongExposureNoiseReduction',
  808         Writable => 'int32u',
  809         PrintHex => 1,
  810         PrintConv => {
  811             0 => 'Off',
  812             1 => 'On (unused)',
  813             0x10001 => 'On (dark subtracted)', # (NEX-C3)
  814             0xffff0000 => 'Off (65535)',
  815             0xffff0001 => 'On (65535)',
  816             0xffffffff => 'n/a',
  817         },
  818     },
  819     0x2009 => { #PH
  820         Name => 'HighISONoiseReduction',
  821         Writable => 'int16u',
  822         PrintConv => {
  823             0 => 'Off',
  824             1 => 'Low',
  825             2 => 'Normal',
  826             3 => 'High',
  827             256 => 'Auto',
  828             # it seems that all DSC models except DSC-RX models give n/a here (ref JR)
  829             65535 => 'n/a',
  830         },
  831     },
  832     0x200a => { #PH (A550)
  833         Name => 'HDR',
  834         Writable => 'int32u',
  835         Format => 'int16u',
  836         Count => 2,
  837         Notes => 'stored as a 32-bit integer, but read as two 16-bit integers',
  838         PrintHex => 1,
  839         PrintConv => [{
  840             0x0 => 'Off',
  841             0x01 => 'Auto',
  842             0x10 => '1.0 EV',
  843             0x11 => '1.5 EV',
  844             0x12 => '2.0 EV',
  845             0x13 => '2.5 EV',
  846             0x14 => '3.0 EV',
  847             0x15 => '3.5 EV',
  848             0x16 => '4.0 EV',
  849             0x17 => '4.5 EV',
  850             0x18 => '5.0 EV',
  851             0x19 => '5.5 EV',
  852             0x1a => '6.0 EV',
  853         },{ #JR (A580)
  854             0 => 'Uncorrected image',  # A580 stores 2 images: uncorrected and HDR
  855             1 => 'HDR image (good)',
  856             2 => 'HDR image (fail 1)', # alignment problem?
  857             3 => 'HDR image (fail 2)', # contrast problem?
  858         }],
  859     },
  860     0x200b => { #PH
  861         Name => 'MultiFrameNoiseReduction',
  862         Writable => 'int32u',
  863         Notes => 'may not be valid for RS100', # (RS100 sample was 0 when this feature was turned on)
  864         PrintConv => {
  865             0 => 'Off',
  866             1 => 'On',
  867             255 => 'n/a',
  868         },
  869     },
  870     # 0x200c - int32u[3]: '0 0 0'; seen '2 1 0' for HX9V 3D-Image (in both JPG and MPO image)
  871     # 0x200d - rational64u: 10/10, seen 2.5 for DSC-TX300V, 8 for DSC-HX100V/RX10
  872     0x200e => { #PH (HX20V)
  873         Name => 'PictureEffect',
  874         Writable => 'int16u',
  875         PrintConv => {
  876             0 => 'Off',
  877             1 => 'Toy Camera', #JR (A35)
  878             2 => 'Pop Color', # (also A35/NEX-C3, ref JR)
  879             3 => 'Posterization', #JR (A35)
  880             4 => 'Posterization B/W', #JR (A35)
  881             5 => 'Retro Photo', #JR (A35, NEX-5)
  882             6 => 'Soft High Key', # (also A65V, A35/NEX-C3 call this "High-key", ref JR)
  883             7 => 'Partial Color (red)', #JR (A35)
  884             8 => 'Partial Color (green)', #JR (A35, NEX-5)
  885             9 => 'Partial Color (blue)', #JR (A35)
  886             10 => 'Partial Color (yellow)', #JR (A35, NEX-5)
  887             13 => 'High Contrast Monochrome', #JR (A35)
  888             16 => 'Toy Camera (normal)', # (also A65, ref JR)
  889             17 => 'Toy Camera (cool)', # (RX100)
  890             18 => 'Toy Camera (warm)', # (RX100)
  891             19 => 'Toy Camera (green)', # (RX100)
  892             20 => 'Toy Camera (magenta)', # (RX100)
  893             32 => 'Soft Focus (low)', #JR (RX100)
  894             33 => 'Soft Focus', #JR (A65V)
  895             34 => 'Soft Focus (high)', # (RX100)
  896             48 => 'Miniature (auto)', #JR (A65V/NEX-7, horizontal)
  897             49 => 'Miniature (top)', # (RX100)
  898             50 => 'Miniature (middle horizontal)', # (WX100/HX20V, horizontal)
  899             51 => 'Miniature (bottom)', # (WX100, rotate 90 CW)
  900             52 => 'Miniature (left)', # (RX100)
  901             53 => 'Miniature (middle vertical)', # (RX100)
  902             54 => 'Miniature (right)', # (RX100)
  903             64 => 'HDR Painting (low)', # (RX100)
  904             65 => 'HDR Painting', # (also A65V, ref JR)
  905             66 => 'HDR Painting (high)', # (RX100)
  906             80 => 'Rich-tone Monochrome', # (also A65V, ref JR)
  907             97 => 'Water Color', # (HX200V)
  908             98 => 'Water Color 2',
  909             112 => 'Illustration (low)', # (RX100)
  910             113 => 'Illustration', # (RX100)
  911             114 => 'Illustration (high)', # (RX100)
  912         },
  913     },
  914     0x200f => { #PH (RX100)
  915         Name => 'SoftSkinEffect',
  916         Writable => 'int32u',
  917         PrintConv => {
  918             0 => 'Off',
  919             1 => 'Low',
  920             2 => 'Mid',
  921             3 => 'High',
  922             # 0x10001 - seen (ref JR)
  923             # 0x10002 - seen for landscape and portrait flash (ref JR)
  924             # 0x10003 - seen (ref JR)
  925             0xffffffff => 'n/a', # (A35)
  926         },
  927     },
  928     0x2010 => [ #JR
  929         # different camera models have similar content but at different offsets, appears to correlate with:
  930         # 0x1206 - 0x1207 deciphered (0x1205 changes with firmware version):
  931         #   ad c3 - NEX-5N
  932         # 0x0192 - 0x0193 deciphered (0x0191 changes with firmware version):
  933         #   91 c3 - NEX-VG20E
  934         #   93 c3 - NEX-7, SLT-A65V/A77V
  935         #   94 c3 - Hasselblad Lunar
  936         # 0x0012 - 0x0013 deciphered (0x0011 changes with firmware version):
  937         #   94 c3 - SLT-A37/A57, NEX-F3
  938         #   95 d3 - DSC-WX50, WX70
  939         #   98 c3 - DSC-HX200V, HX20V, HX30V, TX200V, TX300V
  940         #   98 d3 - DSC-HX10V, TX66, WX100, WX150
  941         #   9a c3 - DSC-RX1, RX1R
  942         #   9b c3 - SLT-A99V, Hasselblad HV
  943         #   9c c3 - NEX-VG30E
  944         #   9d c3 - DSC-RX100, Hasselblad Stellar
  945         #   9e c3 - NEX-VG900, SLT-A58
  946         #   a1 d3 - DSC-TX30
  947         #   a2 d3 - DSC-WX60, WX80, WX200, WX300
  948         #   a3 c3 - NEX-6, DSC-HX300, HX50V
  949         #   a4 c3 - NEX-3N/5R/5T, ILCE-3000/3500
  950         # unknown offsets or values for DSC-TX20/TX55/WX30
  951         # unknown offsets or values for DSC-HX60V/HX350/HX400V/QX10/QX30/QX100/RX10/RX100M2/RX100M3/WX220/WX350,
  952         #                               ILCA-68/77M2, ILCE-5000/5100/6000/7/7M2/7R/7S/QX1, Stellar2, Lusso
  953         # unknown offsets or values for DSC-HX80/HX90V/RX0/RX1RM2/RX10M2/RX10M3/RX100M4/RX100M5/WX500, ILCE-6300/6500/7RM2/7SM2, ILCA-99M2
  954         # unknown offsets or values for ILCE-6100/6400/6600/7M3/7RM3/7RM4/9/9M2, DSC-RX0M2/RX10M4/RX100M6/RX100M5A/RX100M7/HX99
  955     {
  956         Name => 'Tag2010a', # ad
  957         Condition => '$$self{Model} =~ /^NEX-5N$/',
  958         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010a' },
  959     },{
  960         Name => 'Tag2010b', # 91, 93
  961         Condition => '$$self{Model} =~ /^(SLT-A(65|77)V?|NEX-(7|VG20E)|Lunar)$/',
  962         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010b' },
  963     },{
  964         Name => 'Tag2010c', # 94
  965         Condition => '$$self{Model} =~ /^(SLT-A(37|57)|NEX-F3)$/',
  966         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010c' },
  967     },{
  968         Name => 'Tag2010d', # 95, 98
  969         Condition => q{
  970             $$self{Model} =~ /^(DSC-(HX10V|HX20V|HX30V|HX200V|TX66|TX200V|TX300V|WX50|WX70|WX100|WX150))$/ and
  971             not $$self{Panorama}
  972         },
  973         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010d' },
  974     },{
  975         Name => 'Tag2010e', # 9a, 9b, 9c, 9d, 9e, a1, a2, a3, a4
  976         Condition => q{
  977             $$self{Model} =~ /^(SLT-A99V?|HV|SLT-A58|ILCE-(3000|3500)|NEX-(3N|5R|5T|6|VG900|VG30E)|DSC-(RX100|RX1|RX1R)|Stellar)$/ or
  978             ($$self{Model} =~ /^(DSC-(HX300|HX50|HX50V|TX30|WX60|WX80|WX200|WX300))$/ and not $$self{Panorama})
  979         },
  980         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010e' },
  981     },{
  982         Name => 'Tag2010f', # ?
  983         Condition => '$$self{Model} =~ /^(DSC-(RX100M2|QX10|QX100))$/',
  984         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010f' },
  985     },{
  986         Name => 'Tag2010g', # ?
  987         Condition => '$$self{Model} =~ /^(DSC-(QX30|RX10|RX100M3|HX60V|HX350|HX400V|WX220|WX350)|ILCE-(7(R|S|M2)?|[56]000|5100|QX1)|ILCA-(68|77M2))\b/',
  988         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010g' },
  989     },{
  990         Name => 'Tag2010h', # ?
  991         Condition => '$$self{Model} =~ /^(DSC-(RX0|RX1RM2|RX10M2|RX10M3|RX100M4|RX100M5|HX80|HX90V?|WX500)|ILCE-(6300|6500|7RM2|7SM2)|ILCA-99M2)\b/',
  992         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010h' },
  993     },{
  994         Name => 'Tag2010i', # ?
  995         Condition => '$$self{Model} =~ /^(ILCE-(6100|6400|6600|7M3|7RM3|7RM4|9|9M2)|DSC-(RX10M4|RX100M6|RX100M5A|RX100M7|HX99|RX0M2))\b/',
  996         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010i' },
  997     },{
  998         Name => 'Tag_0x2010',
  999         %unknownCipherData,
 1000     }],
 1001     0x2011 => { #PH (A77, NEX-5N)
 1002         Name => 'VignettingCorrection',
 1003         Writable => 'int32u',
 1004         PrintConv => {
 1005             0 => 'Off',
 1006             2 => 'Auto',
 1007             0xffffffff => 'n/a', # (RX100)
 1008         },
 1009     },
 1010     0x2012 => { #PH (A77, NEX-5N)
 1011         Name => 'LateralChromaticAberration',
 1012         Writable => 'int32u',
 1013         PrintConv => {
 1014             0 => 'Off',
 1015             2 => 'Auto',
 1016             0xffffffff => 'n/a', # (RX100)
 1017         },
 1018     },
 1019     0x2013 => { #PH (A77, NEX-5N) ("Setting"; application of such correction is indicated in Tag9405 - ref JR)
 1020         Name => 'DistortionCorrectionSetting',
 1021         Writable => 'int32u',
 1022         PrintConv => {
 1023             0 => 'Off',
 1024             2 => 'Auto',
 1025             0xffffffff => 'n/a', # (RX100)
 1026         },
 1027     },
 1028     0x2014 => { #JR/9
 1029         Name => 'WBShiftAB_GM',
 1030         Writable => 'int32s',
 1031         Count => 2,
 1032         Notes => q{
 1033             2 numbers: 1. positive is a shift toward amber, 2. positive is a shift
 1034             toward magenta
 1035         },
 1036     },
 1037     # 0x2015 - int16u: 65535, also for 'normal' HDR images; 0 for HDR-paint and Rich-tone Monochrome effect images
 1038     0x2016 => { #PH (RX100)
 1039         Name => 'AutoPortraitFramed',
 1040         Writable => 'int16u',
 1041         Notes => '"Yes" if this image was created by the Auto Portrait Framing feature',
 1042         PrintConv => { 0 => 'No', 1 => 'Yes' },
 1043     },
 1044     # 0x2017 - int32u: flash mode. 0=off, 1=fired, 2=red-eye (PH, NEX-6) (also in A99, RX1, NEX-5R)
 1045     0x2017 => { #JR
 1046         Name => 'FlashAction',
 1047         Writable => 'int32u',
 1048         PrintConv => {
 1049             0 => 'Did not fire',
 1050             1 => 'Flash Fired',
 1051             2 => 'External Flash Fired',
 1052             3 => 'Wireless Controlled Flash Fired', # (NC) seen for ILCE-9 and ILCE-7M3 images
 1053             # 5 => 'External Flash ???', # seen for ILCE-7RM4
 1054         },
 1055     },
 1056     # 0x2018 - something with external flash: seen 1 only when 0x2017 = 2
 1057     # 0x2019 - 0 or 1 (seen 1 for ILCA-77M2, ILCE-7M2/7RM2)
 1058     # 0x201a - 0 or 1
 1059     0x201a => { #JR
 1060         Name => 'ElectronicFrontCurtainShutter',
 1061         Writable => 'int32u',
 1062         PrintConv => {
 1063             0 => 'Off',
 1064             1 => 'On',
 1065         },
 1066     },
 1067     0x201b => { #PH
 1068         # FocusMode for SLT/HV/ILCA and NEX/ILCE; doesn't seem to apply to DSC models (always 0)
 1069         #    from 2018: at least DSC-RX10M4 and RX100M6 also use this tag
 1070         Name => 'FocusMode',
 1071         Condition => '($$self{Model} !~ /^DSC-/) or ($$self{Model} =~ /^DSC-(RX10M4|RX100M6|RX100M7|RX100M5A|HX99|RX0M2)/)',
 1072         Writable => 'int8u',
 1073         Priority => 0,
 1074         PrintConv => {
 1075             0 => 'Manual',
 1076             2 => 'AF-S',
 1077             3 => 'AF-C',
 1078             4 => 'AF-A',
 1079             6 => 'DMF', # "Direct Manual Focus"
 1080             7 => 'AF-D', # "Depth Map Assist Continuous AF"
 1081         },
 1082     },
 1083     0x201c => [ #JR
 1084         # AFAreaModeSetting for SLT/HV/ILCA and NEX/ILCE; doesn't seem to apply to DSC models (always 0)
 1085         #    from 2018: at least DSC-RX10M4 and RX100M6 also use this tag
 1086         # all DSLR/SLT/HV         Wide  Zone Spot   Local
 1087         # all NEX and ILCE-3000   Multi      Center FlexibleSpot
 1088         # all ILCE and ILCA       Wide  Zone Center FlexibleSpot  ExpandedFlexibleSpot
 1089         # (actual AFAreaMode used may be different as camera can override this under certain conditions)
 1090         {
 1091             Name => 'AFAreaModeSetting',
 1092             Condition => '$$self{Model} =~ /^(SLT-|HV)/',
 1093             Notes => 'SLT models',
 1094             Writable => 'int8u',
 1095             PrintConv => {
 1096                 0 => 'Wide',
 1097                 4 => 'Local',
 1098                 8 => 'Zone', #PH
 1099                 9 => 'Spot',
 1100             },
 1101         },{
 1102             Name => 'AFAreaModeSetting',
 1103             Condition => '$$self{Model} =~ /^(NEX-|ILCE-|DSC-(RX10M4|RX100M6|RX100M7|RX100M5A|HX99|RX0M2))/',
 1104             Notes => 'NEX, ILCE and some DSC models',
 1105             RawConv => '$$self{AFAreaILCE} = $val',
 1106             DataMember => 'AFAreaILCE',
 1107             Writable => 'int8u',
 1108             PrintConv => {
 1109                 0 => 'Wide', # all NEX and ILCE-3000/3500 use the name 'Multi'
 1110                 1 => 'Center',
 1111                 3 => 'Flexible Spot',
 1112                 4 => 'Flexible Spot (LA-EA4)', # seen for ILCE-7RM2 with LA-EA4
 1113                 9 => 'Center (LA-EA4)', # seen for ILCE-7RM2 with LA-EA4
 1114                 11 => 'Zone',
 1115                 12 => 'Expanded Flexible Spot',
 1116             },
 1117         },{
 1118             Name => 'AFAreaModeSetting',
 1119             Condition => '$$self{Model} =~ /^ILCA-/',
 1120             Notes => 'ILCA models',
 1121             RawConv => '$$self{AFAreaILCA} = $val',
 1122             DataMember => 'AFAreaILCA',
 1123             Writable => 'int8u',
 1124             PrintConv => {
 1125                 0 => 'Wide',
 1126                 4 => 'Flexible Spot',
 1127                 8 => 'Zone',
 1128                 9 => 'Center',
 1129                 12 => 'Expanded Flexible Spot',
 1130             },
 1131         },
 1132     ],
 1133     0x201d => { #JR
 1134         # Flexible Spot position for NEX/ILCE, non-zero only when AFAreaMode='Flexible Spot'
 1135         #    from 2018: at least DSC-RX10M4 and RX100M6 also use this tag
 1136         # observed values in range (0 0) to (640 480), with center (320 240) often seen
 1137         # for NEX-5R/6, positions appear to be in an 11x9 grid
 1138         Name => 'FlexibleSpotPosition',
 1139         Condition => '$$self{Model} =~ /^(NEX-|ILCE-|DSC-(RX10M4|RX100M6|RX100M7|RX100M5A|HX99|RX0M2))/',
 1140         Writable => 'int16u',
 1141         Count => 2,
 1142         Notes => q{
 1143             X and Y coordinates of the AF point, valid only when AFAreaMode is Flexible
 1144             Spot
 1145         },
 1146     },
 1147     0x201e => [{ #PH (A99)
 1148         # Selected AF Point for SLT/HV/ILCA or ILCE with LA-EA2/EA4
 1149         # Selected AF Zone for NEX/ILCE/ILCA when AFAreaMode = 'Zone',
 1150         #      but also with Expanded Flexible Spot for ILCE-7RM2/7SM2/9 ...
 1151         # doesn't seem to apply to DSC models (always 0)
 1152         Name => 'AFPointSelected',
 1153         Condition => q{
 1154             ($$self{Model} =~ /^(SLT-|HV)/) or ($$self{Model} =~ /^ILCE-/ and
 1155             defined $$self{AFAreaILCE} and  $$self{AFAreaILCE} == 4)
 1156         },
 1157         Notes => 'SLT models or ILCE with LA-EA2/EA4',
 1158         Writable => 'int8u',
 1159         PrintConvColumns => 2,
 1160         PrintConv => {
 1161             0 => 'Auto', #(NC)
 1162             1 => 'Center',
 1163             2 => 'Top',
 1164             3 => 'Upper-right',
 1165             4 => 'Right',
 1166             5 => 'Lower-right',
 1167             6 => 'Bottom',
 1168             7 => 'Lower-left',
 1169             8 => 'Left',
 1170             9 => 'Upper-left',
 1171             10 => 'Far Right',
 1172             11 => 'Far Left',
 1173             12 => 'Upper-middle',
 1174             13 => 'Near Right',
 1175             14 => 'Lower-middle',
 1176             15 => 'Near Left',
 1177             16 => 'Upper Far Right',
 1178             17 => 'Lower Far Right',
 1179             18 => 'Lower Far Left',
 1180             19 => 'Upper Far Left',
 1181         },
 1182     },{
 1183         Name => 'AFPointSelected',
 1184         Condition => '$$self{Model} =~ /^ILCA-(68|77M2)/ and defined $$self{AFAreaILCA} and $$self{AFAreaILCA} != 8',
 1185         Notes => 'ILCA-68 and ILCA-77M2',
 1186         Writable => 'int8u',
 1187         ValueConv => '$val - 1', # to get the same numbers as from the BITMASK in 0x2020
 1188         ValueConvInv => '$val + 1',
 1189         PrintConvColumns => 5,
 1190         PrintConv => {
 1191             -1 => 'Auto',
 1192             %afPoints79,
 1193             39 => 'E6 (Center)', # (add " (Center)" to central point)
 1194         },
 1195     },{
 1196         Name => 'AFPointSelected',
 1197         Condition => '($$self{Model} =~ /^ILCA-99M2/ and defined $$self{AFAreaILCA} and $$self{AFAreaILCA} != 8)',
 1198         Notes => 'ILCA-99M2 when AFAreaModeSetting is not Zone',
 1199         # (appears to indicate the number of the selectable Focal Plane AF Point)
 1200         Writable => 'int8u',
 1201         PrintConvColumns => 4,
 1202         PrintConv => {
 1203             0 => 'Auto',                # seen for AFAreaModeSetting = Center, Wide
 1204             %afPoints99M2,              # for selected AFPoints corresponding to the 79 dedicated AF points
 1205             162 => 'E6 (162, Center)',  # add " (Center)" to central point
 1206             OTHER => sub { shift },     # pass other values straight through
 1207         },
 1208     },{
 1209         Name => 'AFPointSelected',
 1210         Condition => '($$self{Model} =~ /^ILCA-/ and defined $$self{AFAreaILCA} and $$self{AFAreaILCA} == 8)',
 1211         Notes => 'ILCA models when AFAreaModeSetting is set to Zone',
 1212         # ILCA-68 and 77M2 have 9 Zones: numbers/locations verified for ILCA-77M2
 1213         # ILCA-99M2 has 15 Zones in Hybrid-AF and 9 Zones in dedicated Phase AF Area, so may not be valid for ILCA-99M2...
 1214         Writable => 'int8u',
 1215         PrintConv => {
 1216             0 => 'n/a',
 1217             1 => 'Top Left Zone',
 1218             2 => 'Top Zone',
 1219             3 => 'Top Right Zone',
 1220             4 => 'Left Zone',
 1221             5 => 'Center Zone',
 1222             6 => 'Right Zone',
 1223             7 => 'Bottom Left Zone',
 1224             8 => 'Bottom Zone',
 1225             9 => 'Bottom Right Zone',
 1226           #14 => ' ??? ', # seen for ILCA-99M2
 1227         },
 1228     },{
 1229         Name => 'AFPointSelected',
 1230         # non-zero only when AFAreaMode is 'Zone', and 'Expanded-Flexible-Spot' for ILCE-6300/7RM2/7SM2
 1231         # each Zone has 3x3 AF Areas --> 9 positions within 5x5 total Contrast AF Areas
 1232         Condition => '$$self{Model} =~ /^(NEX-|ILCE-)/',
 1233         Notes => 'NEX and ILCE models',
 1234         Writable => 'int8u',
 1235         PrintConv => {
 1236             0 => 'n/a',
 1237             1 => 'Center Zone',
 1238             2 => 'Top Zone',
 1239             3 => 'Right Zone',
 1240             4 => 'Left Zone',
 1241             5 => 'Bottom Zone',
 1242             6 => 'Bottom Right Zone',
 1243             7 => 'Bottom Left Zone',
 1244             8 => 'Top Left Zone',
 1245             9 => 'Top Right Zone',
 1246         },
 1247     }],
 1248     # 0x201f - 0 0 0 0 for SLT and DSC; 4 values for NEX/ILCE with 4th value always 0:
 1249     # possibly bits relating to the 25 AF-Contrast-areas ???
 1250     # 0x2020 - 10 values; for SLT/ILCA and NEX/ILCE with A-mount lens: relates to (phase-detect) AFPoints
 1251     #          but not used by ILCA-99M2 anymore ... ?
 1252     0x2020 => [{
 1253         Name => 'AFPointsUsed',
 1254         Condition => '$$self{Model} !~ /^(ILCA-|DSC-)/', # (doesn't seem to apply to DSC-models)
 1255         Notes => 'SLT models, or NEX/ILCE with A-mount lenses',
 1256         BitsPerWord => 8,
 1257         BitsTotal => 80,
 1258         PrintConvColumns => 2,
 1259         PrintConv => {
 1260             0 => '(none)',
 1261             BITMASK => {
 1262                 0 => 'Center',
 1263                 1 => 'Top',
 1264                 2 => 'Upper-right',
 1265                 3 => 'Right',
 1266                 4 => 'Lower-right',
 1267                 5 => 'Bottom',
 1268                 6 => 'Lower-left',
 1269                 7 => 'Left',
 1270                 8 => 'Upper-left',
 1271                 9 => 'Far Right',
 1272                 10 => 'Far Left',
 1273                 11 => 'Upper-middle',
 1274                 12 => 'Near Right',
 1275                 13 => 'Lower-middle',
 1276                 14 => 'Near Left',
 1277                 15 => 'Upper Far Right',
 1278                 16 => 'Lower Far Right',
 1279                 17 => 'Lower Far Left',
 1280                 18 => 'Upper Far Left',
 1281             },
 1282         },
 1283     },{
 1284         Name => 'AFPointsUsed',
 1285         Condition => '$$self{Model} =~ /^ILCA-(68|77M2)/',
 1286         Notes => 'ILCA models',
 1287         BitsPerWord => 8,
 1288         BitsTotal => 80,
 1289         PrintConvColumns => 4,
 1290         PrintConv => {
 1291             0 => '(none)',
 1292             BITMASK => { %afPoints79 },
 1293         },
 1294     }],
 1295     # 0x2021 - 0 for DSC; 0, 1 or 2 for SLT/ILCA and NEX/ILCE: 1=Face, 2=object-tracking ?
 1296     #    from 2018: at least DSC-RX10M4 and RX100M6 also use this tag
 1297     0x2021 => { #JR
 1298         Name => 'AFTracking',
 1299         Condition => '($$self{Model} !~ /^DSC-/) or ($$self{Model} =~ /^DSC-(RX10M4|RX100M6|RX100M7|RX100M5A|HX99|RX0M2)/)',
 1300         Writable => 'int8u',
 1301         PrintConv => {
 1302             0 => 'Off',
 1303             1 => 'Face tracking',
 1304             2 => 'Lock On AF',
 1305         },
 1306     },
 1307     # 0x2022 - 13 bytes (104 bits) for SLT-A58/A99V, NEX-3N/5R/5T/6/VG30E/VG900, ILCE-3000/3500/5000/7/7R
 1308     #          26 bytes (208 bits) for ILCA-77M2, ILCE-5100/6000/7M2/7S/QX1 (7M2 has 117, 5100/6000 have 179 PhaseAFPoints)
 1309     #          52 bytes (416 bits) for ILCE-7RM2 (which has 399 PhaseAFPoints) and ILCE-7SM2
 1310     #          Only seen non-zero values for ILCE-5100/6000/7M2/7RM2 in AF-C mode: maybe FocalPlaneAFPointsUsed ???
 1311     #          (Similar number of bytes for contemporary DSC models, but mostly all non-zero values.)
 1312     #          ILCE-6300 does not write this tag anymore, but writes 0x202a ...
 1313     0x2022 => [{
 1314         Name => 'FocalPlaneAFPointsUsed',
 1315         Condition => '$$self{Model} =~ /^(ILCE-(5100|6000|7M2))/',
 1316         Notes => 'On-sensor/focal-plane phase AF points for ILCE with hybrid AF',
 1317         BitsPerWord => 8,
 1318         BitsTotal => 208, # 26 words
 1319         PrintConv => {
 1320             0 => '(none)',
 1321             BITMASK => { },
 1322         },
 1323     },{
 1324         Name => 'FocalPlaneAFPointsUsed',
 1325         Condition => '$$self{Model} =~ /^ILCE-7RM2/',
 1326         # ILCE-7RM2 has 399 points in 19 rows of 21 points, numbered [0] to [398], [199] is Center
 1327         BitsPerWord => 8,
 1328         BitsTotal => 416, # 52 words
 1329         PrintConv => {
 1330             0 => '(none)',
 1331             BITMASK => { },
 1332         },
 1333     }],
 1334     0x2023 => { #JR
 1335         Name => 'MultiFrameNREffect',
 1336         Writable => 'int32u',
 1337         PrintConv => {
 1338             0 => 'Normal',
 1339             1 => 'High', # seen this only for ILCA-77M2 MFNR-12 images
 1340         },
 1341     },
 1342     # 0x2024 - 96 byte data block, very similar to 0x3000 ShotInfo, seen in Xperia Z5
 1343     # 0x2025 - n1 n2 0 0         DSC-RX100M3/RX100M4/RX10M2/HX90V/WX500, ILCA-77M2, ILCE-5100/7M2/7RM2/7S/QX1
 1344     #          seen n1=0,2,4,5,7 and n2=0,1,3, very often: 7 3 0 0
 1345 
 1346     # 0x2026 - 2 values: more precise WB Shift: AB in steps of 0.50, GM in steps of 0.25 (ILCE-7RM2 onwards)
 1347     0x2026 => { #JR
 1348         Name => 'WBShiftAB_GM_Precise',
 1349         Writable => 'int32s',
 1350         Count => 2,
 1351         Notes => q{
 1352             2 numbers: 1. positive is a shift toward amber, 2. positive is a shift
 1353             toward magenta
 1354         },
 1355         PrintConv => 'my @v=split(" ",$val); $_/=1000 foreach @v; sprintf("%.2f %.2f",$v[0],$v[1])',
 1356     },
 1357     # 0x2027 - W H W/2 H/2  or  W H val1 val2  (0 0 0 0 for Panorama images)
 1358     #          Probably location of focus for Playback Zoom.
 1359     #          Origin appears to be top-left, i.e. 1st coord to the right, 2nd coord. pointing down.
 1360     0x2027 => { #JR
 1361         Name => 'FocusLocation', #(NC)
 1362         Writable => 'int16u',
 1363         Count => 4,
 1364         NOTES => q{
 1365             Location in the image where the camera focused, used for Playback Zoom.
 1366             If the focus location information cannot be obtained, the centre of the
 1367             image will be used.
 1368         },
 1369     },
 1370     # 0x2028 - 0 0 for DSC-RX100M4/RX10M2, ILCE-7RM2/7SM2; seen non-zero values only for DSC-RX1RM2
 1371     0x2028 => { #JR
 1372         Name => 'VariableLowPassFilter',
 1373         Writable => 'int16u',
 1374         Count => 2,
 1375         PrintConv => {
 1376             '0 0' => 'n/a',
 1377             '1 0' => 'Off',
 1378             '1 1' => 'Standard',
 1379             '1 2' => 'High',
 1380         },
 1381     },
 1382     0x2029 => { # uncompressed 14-bit RAW file type setting introduced 2015
 1383         Name => 'RAWFileType',
 1384         Writable => 'int16u',
 1385         PrintConv => {
 1386             0 => 'Compressed RAW',
 1387             1 => 'Uncompressed RAW',
 1388         },
 1389     },
 1390     # 0x202a - first seen for ILCE-6300: 66 bytes
 1391     #          possibly a 'replacement' for Tag2022 FocalPlaneAFPointsUsed,
 1392     #          but now indicating locations in a 640x428 grid (3:2 part of LCD ?)
 1393     # first byte value 1 for ILCE-6300/6500/9, ILCA-99M2
 1394     #            values 110,137, ... for DSC-RX10M3, therefore limit to first byte = 1 for now
 1395     0x202a => {
 1396         Name => 'Tag202a',
 1397         Condition => '$$valPt =~ /^\x01/',
 1398         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag202a' },
 1399     },
 1400     0x202b => { #JR (ILCA-99M2, ILCE-6500/7M3/7RM3/9, DSC-RX10M4/RX100M5 and newer)
 1401         Name => 'PrioritySetInAWB',
 1402         Writable => 'int8u',
 1403         PrintConv => {
 1404             0 => 'Standard',
 1405             1 => 'Ambience',
 1406             2 => 'White',
 1407         },
 1408     },
 1409     0x202c => { #JR
 1410         Name => 'MeteringMode2',
 1411         Writable => 'int16u',
 1412         PrintHex => 1,
 1413         PrintConv => {
 1414             0x100 => 'Multi-segment',
 1415             0x200 => 'Center-weighted average',
 1416             0x301 => 'Spot (Standard)',
 1417             0x302 => 'Spot (Large)',
 1418             0x400 => 'Average',
 1419             0x500 => 'Highlight',
 1420         },
 1421     },
 1422     0x202d => { #JR first seen for ILCA-99M2, ILCE-6500, DSC-RX100M5
 1423         Name => 'ExposureStandardAdjustment', # (NC)
 1424         Writable => 'rational64s',
 1425         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 1426         PrintConvInv => '$val',
 1427     },
 1428     0x202e => { #JR (ILCE-7M3/7RM3 and newer)
 1429         Name => 'Quality',
 1430         Writable => 'int16u',
 1431         Count => 2,
 1432         PrintConv => {
 1433             '0 0' => 'n/a',
 1434             '0 1' => 'Standard JPEG',
 1435             '0 2' => 'Fine JPEG',
 1436             '0 3' => 'Extra Fine JPEG',
 1437             '1 0' => 'RAW',
 1438             '1 1' => 'RAW + Standard JPEG',
 1439             '1 2' => 'RAW + Fine JPEG',
 1440             '1 3' => 'RAW + Extra Fine JPEG',
 1441         },
 1442     },
 1443     0x202f => { #JR (ILCE-7RM3)
 1444         Name => 'PixelShiftInfo',
 1445         Writable => 'undef',
 1446         # 6 bytes, all 0 for non-PixelShift images
 1447         # first 4 bytes: GroupID, read as int32u
 1448         #    the ID displayed by Sony ImageDataConverter appears to be based on the lower 22 bits:
 1449         #    5 bits, 5 bits, 6 bits, 6 bits
 1450         # last 2 bytes: ShotNumber: (1 4) to (4 4) and (1 16) to (16 16) are the 4 or 16 source images,
 1451         #                           (0 4) is the combined image for 4-shot PixelShift mode
 1452         #                           (0 16) is the combined image for 16-shot PixelShift mode (ILCE-7RM4)
 1453         RawConv => q{
 1454             my ($a,$b,$c) = (Get32u(\$val,0), Get8u(\$val,4), Get8u(\$val,5));
 1455             sprintf("%.2d%.2d%.2d%.2d %d %d 0x%x",($a>>17)&0x1f,($a>>12)&0x1f,($a>>6)&0x3f,$a&0x3f,$b,$c,$a>>22);
 1456         },
 1457         RawConvInv => q{
 1458             my ($a,$b,$c,$d) = split ' ', $val;
 1459             my @a = $a =~ /../g;
 1460             return undef unless @a == 4;
 1461             return Set32u((hex($d)<<22) | ($a[0]<<17) | ($a[1]<<12) | ($a[2]<<6) | $a[3]) . chr($b) . chr($c);
 1462         },
 1463         PrintConv => {
 1464             '00000000 0 0 0x0' => 'n/a',
 1465             OTHER => sub {
 1466                 my ($val, $inv) = @_;
 1467                 if ($inv) {
 1468                     $val =~ s{Composed (\d+)-shot}{Shot 0/$1}i;
 1469                     $val =~ s{^(?:Group)?\s*(\d+)[, ]+(?:Shot\s*)?(\d+)[/ ](\d+)\s*\(?(\w+)\)?}{$1 $2 $3 $4}i or return undef;
 1470                 } else {
 1471                     $val =~ s{(\d+) (\d+) (\d+) (\w+)}{Group $1, Shot $2/$3 ($4)} or return undef;
 1472                     $val =~ s{Shot 0+/0*(\d+)\b}{Composed $1-shot}i;
 1473                 }
 1474                 return $val;
 1475             },
 1476         },
 1477     },
 1478     0x2031 => { #JR (only for ILCE-9 v2.00; ILCE-9 v2.10 and higher have "option" to write into EXIF tag 0xa431 )
 1479         Name => 'SerialNumber',
 1480         Writable => 'string',
 1481         ValueConv => '$val=~s/(\d{2})(\d{2})(\d{2})(\d{2})/$4$3$2$1/; $val=~s/^0//; $val',
 1482         ValueConvInv => '$val="0$val" if length($val)==7; $val=~s/(\d{2})(\d{2})(\d{2})(\d{2})/$4$3$2$1/; $val',
 1483         PrintConv => 'sprintf("%.8d",$val)',
 1484         PrintConvInv => '$val',
 1485     },
 1486     0x3000 => {
 1487         Name => 'ShotInfo',
 1488         SubDirectory => { TagTable => 'Image::ExifTool::Sony::ShotInfo' },
 1489     },
 1490     # 0x3000: data block that includes DateTimeOriginal string
 1491     # 0x5001 - 0
 1492     # 0x5002 - 128
 1493 #
 1494 # at least some data for tags 0x2010, 0x9050 and 0x94xx is encrypted - PH
 1495 # (This is certainly true for at least parts of 0x2010, 0x9050, 0x9400, 0x9402 and 0x9403,
 1496 # but hasn't been verified for other tags -- just to be thorough, decipher all of them)
 1497 # Note: "(e)" in a comment indicates an enciphered value, all other values are deciphered
 1498 #
 1499     # 0x900b - 1st byte 0xae: face detection info for A450/500/550/560/580, A33/35/55, NEX-3/5/5C/C3/VG10
 1500     #        - other 1st byte values for some DSC-models
 1501     #        - seen many 1,8,27,64... values: assume encrypted like other 9xxx tags
 1502     0x900b => {
 1503         Name => 'Tag900b',
 1504         Condition => '$$valPt =~ /^\xae/',
 1505         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag900b' },
 1506     },
 1507     0x9050 => [
 1508     # 944 bytes for A37, A57, A99, NEX-F3, NEX-5R, NEX-6, DSC-RX1, DSC-RX100
 1509     # 3072 bytes for A65, A77, NEX-5N, NEX-7, NEX-VG20 (ref JR)
 1510     # not valid for DSC/Stellar models
 1511     # from mid-2015: ILCE-7RM2/7SM2/6300 and newer models use different offsets
 1512     {
 1513         Name => 'Tag9050a',
 1514         Condition => '$$self{Model} !~ /^(DSC-|Stellar|ILCE-(6100|6300|6400|6500|6600|7M3|7RM2|7RM3|7RM4|7SM2|9|9M2)|ILCA-99M2)/',
 1515         SubDirectory => {
 1516             TagTable => 'Image::ExifTool::Sony::Tag9050a',
 1517             ByteOrder => 'LittleEndian',
 1518         },
 1519     },{
 1520         Name => 'Tag9050b',
 1521         Condition => '$$self{Model} =~ /^(ILCE-(6100|6300|6400|6500|6600|7M3|7RM2|7RM3|7RM4|7SM2|9|9M2)|ILCA-99M2)/',
 1522         SubDirectory => {
 1523             TagTable => 'Image::ExifTool::Sony::Tag9050b',
 1524             ByteOrder => 'LittleEndian',
 1525         },
 1526     },{
 1527         Name => 'Sony_0x9050',
 1528         %unknownCipherData,
 1529     }],
 1530     0x9400 => [
 1531     # first byte:
 1532     # 0x07 (e) for DSC-HX7V/HX9V/HX100V/TX10/TX100/TX100V/WX7/WX9/WX10, HDR-CX../PJ..
 1533     # 0x09 (e) for DSC-TX20/TX55/WX30
 1534     # 0x0a (e) for SLT-A37/A57/A65V/A77V/A99V, NEX-F3/5N/5R/5T/6/7/VG20E, DSC-RX100/RX1/RX1R/HX10V/HX20V/HX30V/HX200V/TX200V/TX300V/TX66/WX50/WX100/WX150, Lunar/Stellar/HV
 1535     # 0x0c (e) for ILCE-3000/3500, NEX-3N, SLT-A58, DSC-HX50V/HX300/RX100M2/TX30/WX60/WX80/WX200/WX300, DSC-QX10/QX100
 1536     # 0xd0 (e) H90, W650, W690: tag9400 decoding appears not valid/different
 1537     # 0x23 (e) for DSC-RX10/HX60V/HX350/HX400V/WX220/WX350, ILCE-7/7R/5000/6000, ILCA-68/77M2
 1538     # 0x24 (e) for ILCA-99M2,ILCE-5100/6300/6500/7M2/7RM2/7S/7SM2/QX1, DSC-HX80/HX90V/QX30/RX0/RX100M3/RX100M4/RX100M5/RX10M2/RX10M3/RX1RM2/WX500
 1539     # 0x26 (e) for ILCE-6100/6400/6600/7M3/7RM3/9, DSC-RX0M2/RX10M4/RX100M5A/RX100M6/HX99
 1540     # 0x28 (e) for ILCE-7RM4/9M2, DSC-RX100M7
 1541     # first byte decoded: 40, 204, 202, 27, 58, 62, 48, 215, 28 respectively
 1542     {
 1543         Name => 'Tag9400a',
 1544         Condition => q{
 1545             $$valPt =~ /^[\x07\x09\x0a]/ or
 1546            ($$valPt =~ /^[\x5e\xe7\x04]/ and $$self{DoubleCipher} = 1)
 1547         },
 1548         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9400a' },
 1549     },{
 1550         Name => 'Tag9400b',
 1551         Condition => '$$valPt =~ /^\x0c/',
 1552         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9400b' },
 1553     },{
 1554         Name => 'Tag9400c',
 1555         Condition => '$$valPt =~ /^[\x23\x24\x26\x28]/',
 1556         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9400c' },
 1557     },{
 1558         Name => 'Sony_0x9400',
 1559         %unknownCipherData,
 1560     }],
 1561     0x9401 => {
 1562         Name => 'Tag9401',
 1563         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9401' },
 1564         # notes for data in this block (ref PH/JR):
 1565         #   0x02-0x03 appear to have some relation to start-offset of data...
 1566         #   0x00 - 0x03    Metering
 1567         #                  Mode
 1568         #   f4 00 00 03      -        -   DSC-H90/W650/W690
 1569         #   cf 0b 9f 0f    0x09bc    (a)  DSC-WX9
 1570         #   1c 00 ac 0f    0x09c9    (b)  HDR-CX130E/CX160E/CX360E/CX560E/CX700E/PJ10E/PJ30E
 1571         #   b7 0f f7 0f    0x09dd    (c)  DSC-HX7V/TX10/WX7/WX10
 1572         #   b7 0f fa 0f    0x09e0    (d)  DSC-HX9V/HX100V/TX100/TX100V
 1573         #   27 00 fd 0f    0x09e7    (e)  DSC-TX20/TX55/WX30
 1574         #   69 1f ff 0f    0x09e9    (f)  NEX-5N
 1575         #   21 2b cf 0f    0x09e9    (f)  NEX-7/VG20E, SLT-A65V/A77V, Lunar
 1576         #   2d 00 d5 0d    0x09a2    (g)  DSC-HX10V/HX20V/HX30V/HX200V/TX66/TX200V/TX300V/WX50/WX70/WX100/WX150
 1577         #   2f 00 d6 0d    0x09a3    (h)  NEX-F3, SLT-A37/A57
 1578         #   30 00 d8 0d    0x09a5    (i)  HDR-AS15
 1579         #   32 00 e2 0d    0x09ac    (j)  DSC-RX100, Stellar
 1580         #   33 00 e2 0d    0x09ac    (j)  NEX-5R/5T/6, NEX-VG900/VG30E
 1581         #   33 50 e2 0d    0x09ac    (j)  SLT-A99V, HV
 1582         #   33 40 0d 0e    0x09d7    (k)  DSC-RX1 v0.01
 1583         #   33 41 0d 0e    0x09d7    (k)  DSC-RX1, DSC-RX1R
 1584         #   38 00 32 0e    0x09fc    (l)  SLT-A58, ILCE-3000/3500, NEX-3N, DSC-HX300/HX50V/WX200/WX300/WX60/WX80/TX30
 1585         #   3a 10 3a 0e    0x0a01    (m)  DSC-QX10/QX100
 1586         #   3a 20 47 0e    0x0a01    (m)  DSC-RX100M2
 1587         #   43 00 66 0e    0x0a1b    (n)  ILCE-7/7R v0.xx/v1.00/v1.01, ILCE-5000, DSC-RX10
 1588         #   43 10 66 0e    0x0a1b    (n)  ILCE-7/7R v1.02/v1.10
 1589         #   43 30 6c 0e    0x0a1b    (n)  ILCE-7/7R v1.20-v3.20
 1590         #   44 00 9c 0e    0x0a39    (o)  ILCE-6000 v1.00/v1.10, DSC-HX60V/HX350/HX400V/WX220/WX350 (also DSC-QX30 samples from sony.net)
 1591         #   44 10 a2 0e    0x0a39    (o)  ILCE-6000 v1.20/v1.21
 1592         #   44 20 a2 0e    0x0a39    (o)  ILCE-6000 v2.00-v3.20
 1593         #   49 00 b0 0e    0x0a3b    (p)  ILCA-68 v1.00, ILCA-77M2 V1.00/v1.01/v2.00 (also DSC-RX100M3 samples from sony.net)
 1594         #   4a 00 b3 0e    0x0a3d    (q)  ILCE-7S v1.00, ILCE-5100 v1.00/v1.10, ILCE-QX1, DSC-QX30/RX100M3
 1595         #   4a 20 b9 0e    0x0a3d    (q)  ILCE-7S v1.20-v3.20
 1596         #   4e 10 d0 0e    0x0a5a    (r)  ILCE-7M2 v1.00/v1.10
 1597         #   4e 30 d6 0e    0x0a5a    (r)  ILCE-7M2 v1.20-v4.00
 1598         #   5a 00 14 0f    0x0a85    (s)  DSC-HX80/HX90V/WX500
 1599         #   5d 00 56 0f    0x0ac7    (t)  DSC-RX10M2/RX100M4, ILCE-7RM2/7SM2 v1.00-v2.20 (also DSC-RX1RM2 samples from Sony)
 1600         #   5d 1d 58 0f    0x0ac7    (t)  ILCE-7RM2 v3.00-v4.00
 1601         #   5d 1e 57 0f    0x0ac7    (t)  DSC-RX1RM2 v1.00
 1602         #   5d 10 56 0f    0x0ac7    (t)  ILCE-6300 v1.00 (samples from Sony)
 1603         #   5d 20 58 0f    0x0ac7    (t)  ILCE-6300 v1.00/v1.10
 1604         #   5e 00 56 0f    0x0ac7    (t)  DSC-RX10M3 v1.00
 1605         #   64 00 a8 0f    0x0b15    (u)  DSC-RX100M5 v1.00
 1606         #   67 00 f9 0f    0x0b66    (v)  ILCA-99M2 v1.00, ILCE-6500 v1.00-v1.05, DSC-RX0 v1.00
 1607         #   7c 00 fe 0f    0x0adb    (w)  ILCE-9 v0.01-v2.00
 1608         #   7d 00 fe 0f    0x0adb    (w)  ILCE-9 v2.10-v4.10
 1609         #   7f 00 fa 0f    0x0add    (x)  DSC-RX10M4 v1.00
 1610         #   80 00 fa 0f    0x0add    (x)  ILCE-7M3/7RM3 v1.00-v3.01
 1611         #   82 00 fc 0f    0x0ad9    (y)  DSC-RX100M5A v1.00, DSC-RX100M6 v1.00
 1612         #   90 00 fe 0f    0x098f?   (z)  DSC-HX99 v1.00
 1613         #   92 10 ff 0f    0x0990    (za) ILCE-6100/6400/6600 v1.00
 1614         #   94 00 ce 0b    0x0879    (zb) ILCE-9 v5.00-v6.00, DSC-RX0M2
 1615         #   98 00 db 0c    0x088a    (zc) ILCE-7RM4 v1.00
 1616         #   9a 00 e3 0c    0x088a    (zc) DSC-RX100M7 v1.00, ILCE-9M2 v1.00
 1617         #
 1618         # 0x0004 - (RX100: 0 or 1. subsequent data valid only if 1 - PH)
 1619         # 0x0007 => {
 1620         #     Name => 'DynamicRangeOptimizer_9401',
 1621         #     PrintConv => {
 1622         #         0 => 'Disabled', # seen for Panorama images
 1623         #         1 => 'Auto',
 1624         #         3 => 'Lv1', #(NC)
 1625         #         4 => 'Lv2', #(NC)
 1626         #         5 => 'Lv3',
 1627         #         6 => 'Lv4',
 1628         #         7 => 'Lv5',
 1629         #         # 8 - seen for VG20E and some other models - PH
 1630         #         255 => 'Off',
 1631         #     },
 1632         # },
 1633     },
 1634     0x9402 => [{
 1635         Name => 'Tag9402',
 1636         # first 2 bytes deciphered:
 1637         #   0x00      0x00     SLT-A37/A57/A65/A77
 1638         #   0x0e      0x00     DSC-H90/HX7V/HX9V/HX100V/TX10/TX100/TX100V/TX20/TX55/W650/W690/W730/WX10/WX30/WX7/WX9, but also seen:
 1639         #     0x0e      0x01     for a few DSC-W650/W690 samples ...
 1640         #   0x0f      0x01     NEX-5N/7/VG20, Lunar
 1641         #   0x10      0x01     DSC-HX10V/HX200V/HX20V/HX300/HX30V/HX50V/TX200V/TX30/TX300V/TX66/RX100/RX1/RX1R/WX100/WX150/WX200/WX300/WX50/WX60/WX70/WX80, Stellar,
 1642         #                      ILCE-3000/3500, NEX-F3/3N/5R/5T/6/VG30/VG900
 1643         #   0x11      0x01     DSC-RX100M2/QX10/QX100
 1644         #   0x13      0x01     ILCE-5000/7/7R, DSC-RX10, but also seen:
 1645         #     0x12      0x01     for ILCE-7/7R and DSC-RX10 samples from Sony.net ...
 1646         #     0x15      0x01     for a few ILCE-7/7R ...
 1647         #   0x14      0x01     ILCE-6000, DSC-HX60V/HX350/HX400V/WX220/WX350
 1648         #   0x17      0x01     ILCE-7S/7M2/5100/QX1, DSC-QX30/RX100M3
 1649         #   0x19      0x01     DSC-HX80/HX90V/RX1RM2/RX10M2/RX100M4/WX500, ILCE-6300/7RM2/7SM2
 1650         #   0x1a      0x01     DSC-RX0/RX10M3/RX100M5, ILCE-6500
 1651         #   0x1c      0x01     ILCE-9
 1652         #   0x1d      0x01     DSC-RX10M4
 1653         #   0x1e      0x01     ILCE-7M3/7RM3, DSC-RX100M5A/RX100M6
 1654         #   0x1f      0x01     DSC-HX99
 1655         #   0x20      0x01     ILCE-6100/6400/6600/7RM4/9M2, ILCE-9 v5.00-v6.00, DSC-RX0M2/RX100M7
 1656         #   var       var      SLT-A58/A99V, HV, ILCA-68/77M2/99M2
 1657         # only valid when first byte 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x19, 0x1a, 0x1c (enciphered 0x8a, 0x70, 0xb6, 0x69, 0x88, 0x20, 0x30, 0xd7, 0xbb, 0x92, 0x28)
 1658 #        Condition => '$$self{DoubleCipher} ? $$valPt =~ /^[\x7e\x46\x1d\x18\x3a\x95\x24\x26\xd6]\x01/ : $$valPt =~ /^[\x8a\x70\xb6\x69\x88\x20\x30\xd7\xbb\x92\x28]\x01/',
 1659 # alternative simpler Condition:
 1660 # not valid for SLT/HV/ILCA models, and not valid for first byte 0x0e or 0xff (enciphered 0x05 or 0xff)
 1661         Condition => '$$self{Model} !~ /^(SLT-|HV|ILCA-)/ and $$valPt !~ /^[\x05\xff]/',
 1662         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9402' },
 1663     },{
 1664         Name => 'Sony_0x9402',
 1665         %unknownCipherData,
 1666     }],
 1667     0x9403 => {
 1668         Name => 'Tag9403',
 1669         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9403' },
 1670     },
 1671     # 0x9404 first 5 bytes (deciphered):
 1672     #  4  0  163  1  2     SLT-A65V/A77V, NEX-5N/7, Lunar, DSC-HX7V/HX9V/HX100V/TX10/TX20/TX55/TX100/TX100V/WX9/WX10/WX30...
 1673     #  5  0  172  1  2     DSC-HX10V/HX200V/HX20V/HX30V/TX66/TX200V/TX300V/WX50/WX70/WX100/WX150...
 1674     #  9  0   38  2  2     SLT-A37/A57/A99V, NEX-5R/5T/6/F3/VG30E/VG900, DSC-RX1/RX1R/RX100, Stellar
 1675     # 12  0    8  2  2     SLT-A58, NEX-3N, ILCE-3000/3500, DSC-HX300/HX50V/WX60/WX80/WX300/TX30...
 1676     # 13  0    9  2  2     DSC-QX10/QX100/RX100M2
 1677     # 15  0   35  2  2     ILCA-68/77M2, ILCE-5000/5100/6000/7/7R/7S/7M2/QX1, DSC-HX60V/HX350/HX400V/QX30/RX10/RX100M3/WX220/WX350
 1678     # 16  0   85  2  2     DSC-HX80/HX90V/WX500
 1679     # 17  0  232  1  2     DSC-RX0/RX0M2/RX1RM2/RX10M2/RX10M3/RX10M4/RX100M4/RX100M5/RX100M5A/RX100M6/RX100M7/HX99, ILCE-6100/6300/6400/6500/6600/7M3/7RM2/7RM3/7RM4/7SM2/9/9M2, ILCA-99M2
 1680     # other values for Panorama images and several other models
 1681     0x9404 => [{
 1682         Name => 'Tag9404a',
 1683         # first byte must be 4 or 5 and 4th byte must be 1 (deciphered)
 1684         Condition => '$$valPt =~ /^[\x40\x7d]..\x01/',
 1685         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9404a' },
 1686     },{
 1687         Name => 'Tag9404b',
 1688         # first byte must be 9 or 12 or 13 or 15 or 16 and 4th byte must be 2 (deciphered)
 1689         Condition => '$$valPt =~ /^[\xe7\xea\xcd\x8a\x70]..\x08/',
 1690         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9404b' },
 1691     },{
 1692         Name => 'Tag9404c',
 1693         # first byte must be 17 and 4th byte must be 1 (deciphered)
 1694         Condition => '$$valPt =~ /^\xb6..\x01/',
 1695         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9404c' },
 1696     },{
 1697         Name => 'Sony_0x9404',
 1698         %unknownCipherData,
 1699     }],
 1700     # 0x9405 first 2 bytes:
 1701     #   0   0  (0x00 =   0   0 enc.) DSC-H90
 1702     #   2   0  (0x08 =   8   0 enc.) DSC and HDR of HX9V generation
 1703     #   3   0  (0x1b =  27   0 enc.) SLT, NEX, ILCE-3000/3500, DSC-RX100/RX1 + other DSC of same generation, also QX10 and QX100
 1704     #   4   0  (0x40 =  64   0 enc.) DSC-RX1R
 1705     #   5   0  (0x7d = 125   0 enc.) DSC-RX100M2
 1706     # 136 var  (0x3a =  58 var enc.) ILCE-7/7R/5000/6000, DSC-HX60V/HX350/HX400V/RX10/WX220/WX350
 1707     # 137 var  (0xb3 = 179 var enc.) ILCA-68/77M2, DSC-RX100M3 - appears to go with 136
 1708     # 138 var  (0x7e = 126 var enc.) ILCE-7S/5100/QX1, DSC-QX30   - appears to go with 136
 1709     # 139 var  (0x9a = 154 var enc.) ILCE-7M2
 1710     # 142 var  (0x25 =  37 var enc.) DSC-HX80/HX90V/RX1RM2/RX10M2/RX10M3/RX100M4/WX500, ILCE-6300/7RM2/7SM2
 1711     # 144 var  (0xe1 = 225 var enc.) DSC-RX100M5
 1712     # 145 var  (0x76 = 118 var enc.) ILCA-99M2, ILCE-6500, DSC-RX0
 1713     # 163 var  (0x8b = 139 var enc.) ILCE-6100/6400/6600/7M3/7RM3/7RM4/9/9M2, DSC-RX0M2/RX10M4/RX100M5A/RX100M6/RX100M7/HX99
 1714     0x9405 => [{
 1715         Name => 'Tag9405a',
 1716         # first byte must be 0x1b or 0x40 or 0x7d
 1717         Condition => '$$valPt =~ /^[\x1b\x40\x7d]/',
 1718         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9405a' },
 1719     },{
 1720         Name => 'Tag9405b',
 1721         # first byte must be 0x3a, 0xb3, 0x7e, 0x9a, 0x25, 0xe1, 0x76 or 0x8b
 1722         Condition => '$$valPt =~ /^[\x3a\xb3\x7e\x9a\x25\xe1\x76\x8b]/',
 1723         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9405b' },
 1724     },{
 1725         Name => 'Sony_0x9405',
 1726         %unknownCipherData,
 1727     }],
 1728     0x9406 => [{
 1729         Name => 'Tag9406',
 1730         # - first byte must be 0x01 or 0x02 (enciphered 0x01 or 0x08),
 1731         #   or 0x03 (enc. 0x1b) for ILCE-6100/6300/6400/6500/6600/7M3/7RM2/7RM3/7RM4/7SM2/9/9M2, and ILCA-99M2
 1732         #   third byte must be 0x02 or 0x03 (enciphered 0x08 or 0x1b) - ref JR
 1733         # (applies to most SLT/ILCA and NEX/ILCE models, but no DSC models)
 1734         Condition => '$$valPt =~ /^[\x01\x08\x1b].[\x08\x1b]/s',
 1735         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9406' },
 1736     },{
 1737         Name => 'Sony_0x9406',
 1738         %unknownCipherData,
 1739     }],
 1740     0x9407 => {
 1741         Name => 'Sony_0x9407',
 1742         %unknownCipherData,
 1743     },
 1744     0x9408 => {
 1745         Name => 'Sony_0x9408',
 1746         %unknownCipherData,
 1747     },
 1748     0x9409 => {
 1749         Name => 'Sony_0x9409',
 1750         %unknownCipherData,
 1751     },
 1752     0x940a => [{
 1753         Name => 'Tag940a',
 1754         Condition => '$$self{Model} =~ /^(SLT-|HV)/', # but appears not valid for ILCA models ...
 1755         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag940a' },
 1756     },{
 1757         Name => 'Sony_0x940a',
 1758         %unknownCipherData,
 1759     }],
 1760     0x940b => {
 1761         Name => 'Sony_0x940b',
 1762         %unknownCipherData,
 1763     },
 1764     0x940c => [{
 1765         Name => 'Tag940c',
 1766         Condition => '$$self{Model} =~ /^(NEX-|ILCE-|Lunar)\b/',
 1767         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag940c' },
 1768     },{
 1769         Name => 'Sony_0x940c',
 1770         %unknownCipherData,
 1771     }],
 1772     0x940d => {
 1773         Name => 'Sony_0x940d',
 1774         %unknownCipherData,
 1775     },
 1776 #   0x940e: 2nd byte = 0: no AFInfo, default for NEX/ILCE
 1777 #           2nd byte = 1: AFInfo for SLT/ILCA models (but also seen 1 for DSC-HX20W/HX300/WX70 ...)
 1778 #           2nd byte = 2: AFInfo for NEX/ILCE with LA-EA2/EA4 Phase-detect AF Adapter
 1779     0x940e => [{
 1780         Name => 'AFInfo',
 1781         Condition => '$$self{Model} =~ /^(SLT-|HV|ILCA-)/',
 1782         SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFInfo' },
 1783     },{
 1784         Name => 'Tag940e',
 1785         Condition => '$$self{Model} =~ /^(NEX-|ILCE-|Lunar)/',
 1786         SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag940e' },
 1787     },{
 1788         Name => 'Sony_0x940e',
 1789         %unknownCipherData,
 1790     }],
 1791     0x940f => {
 1792         Name => 'Sony_0x940f',
 1793         %unknownCipherData,
 1794     },
 1795     0x9411 => {
 1796         Name => 'Sony_0x9411',
 1797         %unknownCipherData,
 1798         # 0x02 - int32u?: 1,3,5,7,9 (A77)
 1799     },
 1800     0xb000 => { #8
 1801         Name => 'FileFormat',
 1802         Writable => 'int8u',
 1803         Count => 4,
 1804         # dynamically set the file type to SR2 because we could have assumed ARW up till now
 1805         RawConv => q{
 1806             $self->OverrideFileType($$self{TIFF_TYPE} = 'SR2') if $val eq '1 0 0 0';
 1807             return $val;
 1808         },
 1809         PrintConvColumns => 2,
 1810         PrintConv => {
 1811             '0 0 0 2' => 'JPEG',
 1812             '1 0 0 0' => 'SR2',
 1813             '2 0 0 0' => 'ARW 1.0',
 1814             '3 0 0 0' => 'ARW 2.0',
 1815             '3 1 0 0' => 'ARW 2.1',
 1816             '3 2 0 0' => 'ARW 2.2', #PH (NEX-5)
 1817             '3 3 0 0' => 'ARW 2.3', #PH (SLT-A65,SLT-A77)
 1818             '3 3 1 0' => 'ARW 2.3.1', #PH/JR (DSC-RX1R/RX100M2/Stellar2)
 1819             '3 3 2 0' => 'ARW 2.3.2', #JR (DSC-RX1RM2,ILCE-7SM2 - support for uncompressed 14-bit RAW)
 1820             '3 3 3 0' => 'ARW 2.3.3', #JR (ILCE-9)
 1821             '3 3 5 0' => 'ARW 2.3.5', #JR (DSC-HX99)
 1822             # what about cRAW images?
 1823         },
 1824     },
 1825     0xb001 => { # ref http://forums.dpreview.com/forums/read.asp?forum=1037&message=33609644
 1826         # (ARW and SR2 images only until the SLT-A65V started writing them to JPEG too)
 1827         Name => 'SonyModelID',
 1828         Writable => 'int16u',
 1829         PrintConvColumns => 2,
 1830         PrintConv => {
 1831             #0 => 'DSC-HX80', #PH  (and several other DSC models)
 1832             2 => 'DSC-R1',
 1833             256 => 'DSLR-A100',
 1834             257 => 'DSLR-A900',
 1835             258 => 'DSLR-A700',
 1836             259 => 'DSLR-A200',
 1837             260 => 'DSLR-A350',
 1838             261 => 'DSLR-A300',
 1839             262 => 'DSLR-A900 (APS-C mode)', #https://exiftool.org/forum/index.php/topic,3994.0.html
 1840             263 => 'DSLR-A380/A390', #PH (A390)
 1841             264 => 'DSLR-A330',
 1842             265 => 'DSLR-A230',
 1843             266 => 'DSLR-A290', #PH
 1844             269 => 'DSLR-A850',
 1845             270 => 'DSLR-A850 (APS-C mode)', #https://exiftool.org/forum/index.php/topic,3994.0.html
 1846             273 => 'DSLR-A550',
 1847             274 => 'DSLR-A500', #PH
 1848             275 => 'DSLR-A450', #http://dev.exiv2.org/issues/show/0000611
 1849             278 => 'NEX-5', #PH
 1850             279 => 'NEX-3', #PH
 1851             280 => 'SLT-A33', #PH
 1852             281 => 'SLT-A55 / SLT-A55V', #PH (A55 NC)
 1853             282 => 'DSLR-A560', #PH
 1854             283 => 'DSLR-A580', #https://exiftool.org/forum/index.php/topic,2881.0.html
 1855             284 => 'NEX-C3', #PH
 1856             285 => 'SLT-A35', #JR
 1857             286 => 'SLT-A65 / SLT-A65V', #PH
 1858             287 => 'SLT-A77 / SLT-A77V', #PH
 1859             288 => 'NEX-5N', #PH
 1860             289 => 'NEX-7', #PH (also Hasselblad Lunar, ref JR)
 1861             290 => 'NEX-VG20E', #JR
 1862             291 => 'SLT-A37', #JR
 1863             292 => 'SLT-A57', #JR
 1864             293 => 'NEX-F3', #PH
 1865             294 => 'SLT-A99 / SLT-A99V', #JR (also Hasselblad HV)
 1866             295 => 'NEX-6', #JR
 1867             296 => 'NEX-5R', #JR
 1868             297 => 'DSC-RX100', #PH (also Hasselblad Stellar, ref JR)
 1869             298 => 'DSC-RX1', #JR
 1870             299 => 'NEX-VG900', #JR
 1871             300 => 'NEX-VG30E', #JR
 1872             302 => 'ILCE-3000 / ILCE-3500', #JR
 1873             303 => 'SLT-A58', #JR
 1874             305 => 'NEX-3N', #PH
 1875             306 => 'ILCE-7', #JR
 1876             307 => 'NEX-5T', #JR
 1877             308 => 'DSC-RX100M2', #JR
 1878             309 => 'DSC-RX10', #JR
 1879             310 => 'DSC-RX1R', #JR
 1880             311 => 'ILCE-7R', #JR
 1881             312 => 'ILCE-6000', #JR
 1882             313 => 'ILCE-5000', #JR
 1883             317 => 'DSC-RX100M3', #JR
 1884             318 => 'ILCE-7S', #JR
 1885             319 => 'ILCA-77M2', #IB
 1886             339 => 'ILCE-5100', #JR
 1887             340 => 'ILCE-7M2', #JR
 1888             341 => 'DSC-RX100M4', #PH
 1889             342 => 'DSC-RX10M2', #JR
 1890             344 => 'DSC-RX1RM2', #JR
 1891             346 => 'ILCE-QX1', #IB
 1892             347 => 'ILCE-7RM2', #JR
 1893             350 => 'ILCE-7SM2', #JR
 1894             353 => 'ILCA-68', #IB
 1895             354 => 'ILCA-99M2', #JR
 1896             355 => 'DSC-RX10M3', #PH
 1897             356 => 'DSC-RX100M5', #IB/JR
 1898             357 => 'ILCE-6300', #IB
 1899             358 => 'ILCE-9', #JR
 1900             360 => 'ILCE-6500', #JR
 1901             362 => 'ILCE-7RM3', #IB
 1902             363 => 'ILCE-7M3', #JR/IB
 1903             364 => 'DSC-RX0', #PH
 1904             365 => 'DSC-RX10M4', #JR
 1905             366 => 'DSC-RX100M6', #IB
 1906             367 => 'DSC-HX99', #IB
 1907             369 => 'DSC-RX100M5A', #JR
 1908             371 => 'ILCE-6400', #IB
 1909             372 => 'DSC-RX0M2', #JR
 1910             374 => 'DSC-RX100M7', #IB
 1911             375 => 'ILCE-7RM4', #IB
 1912             376 => 'ILCE-9M2', #JR
 1913             378 => 'ILCE-6600', #IB/JR
 1914             379 => 'ILCE-6100', #IB/JR
 1915         },
 1916     },
 1917     0xb020 => { #2
 1918         Name => 'CreativeStyle',
 1919         Writable => 'string',
 1920         # (all of these values have been observed, ref JR and PH)
 1921         # - this PrintConv is included to make these strings consistent with
 1922         #   other CreativeStyle tags, and to facilitate the language translations
 1923         # - these values are always English, regardless of the camera language settings
 1924         PrintConv => {
 1925             OTHER => sub { shift }, # pass other values straight through
 1926             None        => 'None',
 1927             AdobeRGB    => 'Adobe RGB',
 1928             Real        => 'Real',
 1929             Standard    => 'Standard',
 1930             Vivid       => 'Vivid',
 1931             Portrait    => 'Portrait',
 1932             Landscape   => 'Landscape',
 1933             Sunset      => 'Sunset',
 1934             Nightview   => 'Night View/Portrait',
 1935             BW          => 'B&W',
 1936             Neutral     => 'Neutral',
 1937             Clear       => 'Clear',
 1938             Deep        => 'Deep',
 1939             Light       => 'Light',
 1940             Autumnleaves=> 'Autumn Leaves',
 1941             Sepia       => 'Sepia',
 1942         },
 1943     },
 1944     0xb021 => { #2
 1945         Name => 'ColorTemperature',
 1946         Writable => 'int32u',
 1947         PrintConv => '$val ? ($val==0xffffffff ? "n/a" : $val) : "Auto"',
 1948         PrintConvInv => '$val=~/Auto/i ? 0 : ($val eq "n/a" ? 0xffffffff : $val)',
 1949     },
 1950     0xb022 => { #7
 1951         Name => 'ColorCompensationFilter',
 1952         Format => 'int32s',
 1953         Writable => 'int32u', # (written incorrectly as unsigned by Sony)
 1954         Notes => 'negative is green, positive is magenta',
 1955     },
 1956     0xb023 => { #PH (A100) - (set by mode dial)
 1957         Name => 'SceneMode',
 1958         Writable => 'int32u',
 1959         PrintConvColumns => 2,
 1960         PrintConv => \%Image::ExifTool::Minolta::minoltaSceneMode,
 1961     },
 1962     0xb024 => { #PH (A100)
 1963         Name => 'ZoneMatching',
 1964         Writable => 'int32u',
 1965         PrintConv => {
 1966             0 => 'ISO Setting Used',
 1967             1 => 'High Key',
 1968             2 => 'Low Key',
 1969         },
 1970     },
 1971     0xb025 => { #PH (A100)
 1972         Name => 'DynamicRangeOptimizer',
 1973         Writable => 'int32u',
 1974         PrintConvColumns => 2,
 1975         PrintConv => {
 1976             0 => 'Off',
 1977             1 => 'Standard',
 1978             2 => 'Advanced Auto',
 1979             3 => 'Auto', # (A550)
 1980             8 => 'Advanced Lv1', #JD
 1981             9 => 'Advanced Lv2', #JD
 1982             10 => 'Advanced Lv3', #JD
 1983             11 => 'Advanced Lv4', #JD
 1984             12 => 'Advanced Lv5', #JD
 1985             16 => 'Lv1', # (NEX-5)
 1986             17 => 'Lv2',
 1987             18 => 'Lv3',
 1988             19 => 'Lv4',
 1989             20 => 'Lv5',
 1990         },
 1991     },
 1992     0xb026 => { #PH (A100)
 1993         Name => 'ImageStabilization',
 1994         Writable => 'int32u',
 1995         PrintConv => {
 1996             0 => 'Off',
 1997             1 => 'On',
 1998             0xffffffff => 'n/a', # (HX9V sweep panorama, ref JR)
 1999         },
 2000     },
 2001     0xb027 => { #2
 2002         Name => 'LensType',
 2003         Writable => 'int32u',
 2004         SeparateTable => 1,
 2005         # set to 65535 for E-mount lenses (values 0x80xx)
 2006         ValueConvInv => '($val & 0xff00) == 0x8000 ? 65535 : int($val)',
 2007         PrintConv => \%sonyLensTypes,
 2008     },
 2009     0xb028 => { #2
 2010         # (used by the DSLR-A100)
 2011         Name => 'MinoltaMakerNote',
 2012         # must check for zero since apparently a value of zero indicates the IFD doesn't exist
 2013         # (dumb Sony -- they shouldn't write this tag if the IFD is missing!)
 2014         Condition => '$$valPt ne "\0\0\0\0"',
 2015         Flags => 'SubIFD',
 2016         SubDirectory => {
 2017             TagTable => 'Image::ExifTool::Minolta::Main',
 2018             Start => '$val',
 2019         },
 2020     },
 2021     0xb029 => { #2 (set by creative style menu)
 2022         Name => 'ColorMode',
 2023         Writable => 'int32u',
 2024         PrintConvColumns => 2,
 2025         PrintConv => \%Image::ExifTool::Minolta::sonyColorMode,
 2026     },
 2027     0xb02a => {
 2028         Name => 'LensSpec',
 2029         Format => 'undef',
 2030         Writable => 'int8u',
 2031         Count => 8,
 2032         Notes => q{
 2033             like LensInfo, but also specifies lens features: DT, E, ZA, G, SSM, SAM,
 2034             OSS, STF, Reflex, Macro and Fisheye
 2035         },
 2036         ValueConv => \&ConvLensSpec,
 2037         ValueConvInv => \&ConvInvLensSpec,
 2038         PrintConv => \&PrintLensSpec,
 2039         PrintConvInv => \&PrintInvLensSpec,
 2040     },
 2041     0xb02b => { #PH (A550 JPEG and A200, A230, A300, A350, A380, A700 and A900 ARW)
 2042         Name => 'FullImageSize',
 2043         Writable => 'int32u',
 2044         Count => 2,
 2045         # values stored height first, so swap to get "width height"
 2046         ValueConv => 'join(" ", reverse split(" ", $val))',
 2047         ValueConvInv => 'join(" ", reverse split(" ", $val))',
 2048         PrintConv => '$val =~ tr/ /x/; $val',
 2049         PrintConvInv => '$val =~ tr/x/ /; $val',
 2050     },
 2051     0xb02c => { #PH (A550 JPEG and A200, A230, A300, A350, A380, A700 and A900 ARW)
 2052         Name => 'PreviewImageSize',
 2053         Writable => 'int32u',
 2054         Count => 2,
 2055         ValueConv => 'join(" ", reverse split(" ", $val))',
 2056         ValueConvInv => 'join(" ", reverse split(" ", $val))',
 2057         PrintConv => '$val =~ tr/ /x/; $val',
 2058         PrintConvInv => '$val =~ tr/x/ /; $val',
 2059     },
 2060     0xb040 => { #2
 2061         Name => 'Macro',
 2062         Writable => 'int16u',
 2063         RawConv => '$val == 65535 ? undef : $val',
 2064         PrintConv => {
 2065             0 => 'Off',
 2066             1 => 'On',
 2067             2 => 'Close Focus', #9
 2068             65535 => 'n/a', #PH (A100)
 2069         },
 2070     },
 2071     0xb041 => { #2
 2072         Name => 'ExposureMode',
 2073         Writable => 'int16u',
 2074         RawConv => '$val == 65535 ? undef : $val',
 2075         PrintConvColumns => 2,
 2076         PrintConv => {
 2077             0 => 'Program AE', # (RX100 'Program','Sunset' - PH)
 2078             1 => 'Portrait', #PH (HX1)
 2079             2 => 'Beach', #9
 2080             3 => 'Sports', #9
 2081             4 => 'Snow', #9
 2082             5 => 'Landscape',
 2083             6 => 'Auto', # (RX100 'Intelligent Auto' - PH)
 2084             7 => 'Aperture-priority AE',
 2085             8 => 'Shutter speed priority AE',
 2086             9 => 'Night Scene / Twilight',#2/9
 2087             10 => 'Hi-Speed Shutter', #9
 2088             11 => 'Twilight Portrait', #9 (RX100 'Night Portrait' - PH)
 2089             12 => 'Soft Snap/Portrait', #9 (TX7 'Soft Snap'; RX100/A37 'Portrait' but manuals say "reproduces soft skin tone" - PH)
 2090             13 => 'Fireworks', #9
 2091             14 => 'Smile Shutter', #9 (T200)
 2092             15 => 'Manual',
 2093             18 => 'High Sensitivity', #9
 2094             19 => 'Macro', #JR
 2095             20 => 'Advanced Sports Shooting', #9
 2096             29 => 'Underwater', #9
 2097             # 30 seen for DSC-W110 and W390, maybe something with Face or Portrait ??
 2098             33 => 'Food', #9
 2099             34 => 'Sweep Panorama', #PH (HX1)
 2100             35 => 'Handheld Night Shot', #PH (HX1/TX1, also called "Hand-held Twilight")
 2101             36 => 'Anti Motion Blur', #PH (TX1)
 2102             37 => 'Pet', #9
 2103             38 => 'Backlight Correction HDR', #9
 2104             39 => 'Superior Auto', #9
 2105             40 => 'Background Defocus', #PH (HX20V)
 2106             41 => 'Soft Skin', #JR (HX9V) (HX200V Portrait - PH)
 2107             42 => '3D Image', #JR (HX9V)
 2108             # 50 seen for DSC-W530
 2109             65535 => 'n/a', #PH (A100)
 2110         },
 2111     },
 2112     0xb042 => { #9
 2113         Name => 'FocusMode',
 2114         # Only FocusMode for older DSC models;
 2115         # Newest DSC models give only 0, many models of 'HX9V generation' give only 4 -
 2116         # these models give FocusMode in tag 0xb04e, and are excluded here.
 2117         Condition => q{
 2118             ($$self{TagB042} = Get16u($valPt, 0)) and
 2119             (not $$self{MetaVersion} or $$self{MetaVersion} ne 'DC7303320222000')
 2120         },
 2121         Notes => 'not valid for all models',
 2122         Writable => 'int16u',
 2123         RawConv => '$val == 65535 ? undef : $val',
 2124         PrintConv => {
 2125             # 0 - seen this for panorama shot
 2126             1 => 'AF-S', # (called Single-AF by Sony)
 2127             2 => 'AF-C', # (called Monitor-AF by Sony)
 2128             4 => 'Permanent-AF', # (TX7,HX9V?)
 2129             65535 => 'n/a', #PH (A100), also for DSC-W690 panorama shots
 2130         },
 2131     },
 2132     0xb043 => [{ #9
 2133         Name => 'AFAreaMode',
 2134         # AFAreaMode only for older models;
 2135         # exclude newest DSC models, which give AFAreaMode in Tag9402 0x0017 (eg. RX100 - PH)
 2136         Writable => 'int16u',
 2137         Condition => 'not $$self{MetaVersion} or $$self{MetaVersion} ne "DC7303320222000"', #JR
 2138         RawConv => '$val == 65535 ? undef : $val',
 2139         Notes => 'older models',
 2140         PrintConv => {
 2141             # 0 - (takes this value after camera reset, but can't be set back once changed)
 2142             0 => 'Default',
 2143             1 => 'Multi',
 2144             2 => 'Center',
 2145             3 => 'Spot',
 2146             4 => 'Flexible Spot', # (T200)
 2147             6 => 'Touch',
 2148             14 => 'Tracking', #JR (HX9V) ("Manual" for the T200?, ref 9)
 2149             15 => 'Face Tracking', # (not set when in face detect mode and no faces detected)
 2150             65535 => 'n/a', #PH (A100)
 2151         },
 2152     },{ #JR
 2153         Name => 'AFAreaMode',
 2154         # AFAreaMode for DSC-HX9V generation, having values that appear to be different from older models.
 2155         Writable => 'int16u',
 2156         Condition => '$$self{TagB042} and $$self{TagB042} != 0',
 2157         Notes => 'DSC-HX9V generation cameras',
 2158         PrintConv => {
 2159             0 => 'Multi',
 2160             1 => 'Center',
 2161             2 => 'Spot', #(NC) seen for DSC-WX9
 2162             3 => 'Flexible Spot',
 2163             10 => 'Selective (for Miniature effect)', # seen for Miniature effect of DSC-WX30
 2164             14 => 'Tracking',
 2165             15 => 'Face Tracking',
 2166             255 => 'Manual',
 2167         },
 2168     }],
 2169     0xb044 => { #9
 2170         Name => 'AFIlluminator',
 2171         Writable => 'int16u',
 2172         RawConv => '$val == 65535 ? undef : $val',
 2173         PrintConv => {
 2174             0 => 'Off',
 2175             1 => 'Auto',
 2176             65535 => 'n/a', #PH (A100)
 2177         },
 2178     },
 2179     # 0xb045 - int16u: 0
 2180     # 0xb046 - int16u: 0
 2181     0xb047 => { #2
 2182         Name => 'JPEGQuality',
 2183         Writable => 'int16u',
 2184         RawConv => '$val == 65535 ? undef : $val',
 2185         PrintConv => {
 2186             0 => 'Standard',
 2187             1 => 'Fine',
 2188             2 => 'Extra Fine', #JR
 2189             65535 => 'n/a', #PH (A100)
 2190         },
 2191     },
 2192     0xb048 => { #9
 2193         Name => 'FlashLevel',  #JR other name, but values -9 to 9 match FlashExposureCompensation
 2194         Writable => 'int16s',
 2195         RawConv => '($val == -1 and $$self{Model} =~ /DSLR-A100\b/) ? undef : $val',
 2196         PrintConv => {
 2197             -32768 => 'Low',
 2198             -9 => '-9/3', #JR
 2199             -6 => '-6/3', #JR
 2200             -5 => '-5/3', #JR
 2201             -4 => '-4/3', #JR
 2202             -3 => '-3/3',
 2203             -2 => '-2/3',
 2204             -1 => '-1/3', # (for the A100, -1 is effectively 'n/a' - PH)
 2205             0 => 'Normal',
 2206             1 => '+1/3',
 2207             2 => '+2/3',
 2208             3 => '+3/3',
 2209             4 => '+4/3', #JR (NC)
 2210             5 => '+5/3', #JR (NC)
 2211             6 => '+6/3', #JR
 2212             9 => '+9/3', #JR
 2213             128 => 'n/a', #JR (HX9V)
 2214             32767 => 'High',
 2215         },
 2216     },
 2217     0xb049 => { #9
 2218         Name => 'ReleaseMode',
 2219         Writable => 'int16u',
 2220         RawConv => '$val == 65535 ? undef : $val',
 2221         PrintConv => {
 2222             0 => 'Normal', # (ie. shutter button)
 2223             2 => 'Continuous',
 2224             5 => 'Exposure Bracketing',
 2225             6 => 'White Balance Bracketing', # (HX5)
 2226             8 => 'DRO Bracketing', #JR (ILCE-7RM2)
 2227             65535 => 'n/a', #PH (A100)
 2228         },
 2229     },
 2230     0xb04a => { #9
 2231         Name => 'SequenceNumber',
 2232         Notes => 'shot number in continuous burst',
 2233         Writable => 'int16u',
 2234         RawConv => '$val == 65535 ? undef : $val',
 2235         PrintConv => {
 2236             0 => 'Single',
 2237             65535 => 'n/a', #PH (A100)
 2238             OTHER => sub { shift }, # pass all other numbers straight through
 2239         },
 2240     },
 2241     0xb04b => { #2/PH
 2242         Name => 'Anti-Blur',
 2243         Writable => 'int16u',
 2244         RawConv => '$val == 65535 ? undef : $val',
 2245         PrintConv => {
 2246             0 => 'Off',
 2247             1 => 'On (Continuous)', #PH (NC)
 2248             2 => 'On (Shooting)', #PH (NC)
 2249             65535 => 'n/a',
 2250         },
 2251     },
 2252     # 0xb04c - rational64u: 10/10 (seen 5 for HX9V Manual-exposure images, ref JR)
 2253     # 0xb04d - int16u: 0
 2254     # (the Kamisaka decoding of 0xb04e seems wrong - ref JR)
 2255     # 0xb04e => { #2
 2256     #     Name => 'LongExposureNoiseReduction',
 2257     #     Notes => 'LongExposureNoiseReduction for other models',
 2258     #     Writable => 'int16u',
 2259     #     RawConv => '$val == 65535 ? undef : $val',
 2260     #     PrintConv => {
 2261     #         0 => 'Off',
 2262     #         1 => 'On',
 2263     #         2 => 'On 2', #PH (TX10, TX100, WX9, WX10, etc)
 2264     #         # 4 - seen this (CX360E, CX700E)
 2265     #         65535 => 'n/a', #PH (A100)
 2266     #     },
 2267     # },
 2268     0xb04e => { #PH (RX100) - but not in RX100M3 anymore (ref JR)
 2269         Name => 'FocusMode',
 2270         Condition => '$$self{MetaVersion} and $$self{MetaVersion} eq "DC7303320222000"', #JR
 2271         Notes => 'valid for DSC-HX9V generation and newer',
 2272         Writable => 'int16u',
 2273         PrintConv => {
 2274             0 => 'Manual',
 2275             # 1 - seen for DSC-WX7 burst, HDR-CX130E/CX560E
 2276             2 => 'AF-S',
 2277             3 => 'AF-C',
 2278             # 4 - seen for HDR-CX360E/CX700E
 2279             5 => 'Semi-manual', #JR (HX9V)
 2280             6 => 'DMF', # "Direct Manual Focus"
 2281         },
 2282     },
 2283     0xb04f => { #PH (TX1)
 2284         Name => 'DynamicRangeOptimizer',
 2285         Writable => 'int16u',
 2286         Priority => 0, # (unreliable for the A77)
 2287         PrintConv => {
 2288             0 => 'Off',
 2289             1 => 'Standard',
 2290             2 => 'Plus',
 2291             # 8 for HDR models - what does this mean?
 2292         },
 2293     },
 2294     0xb050 => { #PH (RX100)
 2295         Name => 'HighISONoiseReduction2',
 2296         Condition => '$$self{Model} =~ /^(DSC-|Stellar)/',
 2297         Notes => 'DSC models only',
 2298         Writable => 'int16u',
 2299         PrintConv => {
 2300             0 => 'Normal',
 2301             1 => 'High',
 2302             2 => 'Low',
 2303             3 => 'Off', #JR
 2304             # it seems that all SLT and NEX models give n/a here (ref JR)
 2305             65535 => 'n/a',
 2306         },
 2307     },
 2308     # 0xb051 - int16u: 0
 2309     0xb052 => { #PH (TX1)
 2310         Name => 'IntelligentAuto',
 2311         Writable => 'int16u',
 2312         PrintConv => {
 2313             0 => 'Off',
 2314             1 => 'On',
 2315             2 => 'Advanced', #9
 2316         },
 2317     },
 2318     # 0xb053 - int16u: normally 0, but got 1 for a superior auto backlight picture (RX100)
 2319     0xb054 => { #PH/9/JR (TX1,TX7,RX100,HX9V)
 2320         Name => 'WhiteBalance',
 2321         Writable => 'int16u',
 2322         Notes => q{
 2323             decoding of the Fluorescent settings matches the EXIF standard, which is
 2324             different than the names used by Sony for some models
 2325         },
 2326         PrintConv => {
 2327             0 => 'Auto',
 2328             4 => 'Custom', # (manual)
 2329             5 => 'Daylight',
 2330             6 => 'Cloudy',
 2331             # PrintConv names matching Exif Fluorescent LightSource names (ref JR)
 2332             # (Sony uses conflicting names for some models)
 2333             7 => 'Cool White Fluorescent', # (RX100) (TX7/HX9V "Fluorescent 1 (White)", ref 9/JR)
 2334             8 => 'Day White Fluorescent',  # (RX100) (TX7/HX9V "Fluorescent 2 (Natural White)", ref 9/JR)
 2335             9 => 'Daylight Fluorescent',   # (RX100) (TX7/HX9V "Fluorescent 3 (Day White)", ref 9/JR)
 2336             10 => 'Incandescent2', #JR (HX9V)
 2337             11 => 'Warm White Fluorescent',
 2338             14 => 'Incandescent',
 2339             15 => 'Flash',
 2340             17 => 'Underwater 1 (Blue Water)', #9
 2341             18 => 'Underwater 2 (Green Water)', #9
 2342             19 => 'Underwater Auto', #JR
 2343         },
 2344     },
 2345 );
 2346 
 2347 # "SEMC MS" maker notes
 2348 %Image::ExifTool::Sony::Ericsson = (
 2349     WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
 2350     CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
 2351     GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
 2352     NOTES => 'Maker notes found in images from some Sony Ericsson phones.',
 2353     0x2000 => {
 2354         Name => 'MakerNoteVersion',
 2355         Writable => 'undef',
 2356         Count => 4,
 2357     },
 2358     0x201 => {
 2359         Name => 'PreviewImageStart',
 2360         IsOffset => 1,
 2361         MakerPreview => 1, # force preview inside maker notes
 2362         OffsetPair => 0x202,
 2363         DataTag => 'PreviewImage',
 2364         Writable => 'int32u',
 2365         WriteGroup => 'MakerNotes',
 2366         Protected => 2,
 2367         Notes => 'a small 320x200 preview image',
 2368     },
 2369     0x202 => {
 2370         Name => 'PreviewImageLength',
 2371         OffsetPair => 0x201,
 2372         DataTag => 'PreviewImage',
 2373         Writable => 'int32u',
 2374         WriteGroup => 'MakerNotes',
 2375         Protected => 2,
 2376     },
 2377 );
 2378 
 2379 # camera information for the A700/A850/A900 (ref JR)
 2380 %Image::ExifTool::Sony::CameraInfo = (
 2381     %binaryDataAttrs,
 2382     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 2383     NOTES => 'Camera information for the A700, A850 and A900.',
 2384     0x00 => {
 2385         Name => 'LensSpec',
 2386         # the A700/A850/A900 use a different int16 byte ordering! - PH
 2387         Format => 'undef[8]',
 2388         ValueConv => sub {
 2389             my $val = shift;;
 2390             return ConvLensSpec(pack('v*', unpack('n*', $val)));
 2391         },
 2392         ValueConvInv => sub {
 2393             my $val = shift;
 2394             return pack('v*', unpack('n*', ConvInvLensSpec($val)));
 2395         },
 2396         PrintConv => \&PrintLensSpec,
 2397         PrintConvInv => \&PrintInvLensSpec,
 2398     },
 2399     0x0014 => {
 2400         Name => 'FocusModeSetting',
 2401         Notes => 'FocusModeSetting for the A700, A850 and A900',
 2402         PrintConv => {
 2403             0 => 'Manual',
 2404             1 => 'AF-S',
 2405             2 => 'AF-C',
 2406             3 => 'AF-A',
 2407             4 => 'DMF',
 2408         },
 2409     },
 2410     0x0015 => { # the AF Point selected in AFAreaMode=Local or Spot; always '0' for AFAreaMode=Wide
 2411         Name => 'AFPointSelected',
 2412         PrintConvColumns => 2,
 2413         PrintConv => {
 2414             0 => 'Auto',
 2415             1 => 'Center',
 2416             2 => 'Top',
 2417             3 => 'Upper-right',
 2418             4 => 'Right',
 2419             5 => 'Lower-right',
 2420             6 => 'Bottom',
 2421             7 => 'Lower-left',
 2422             8 => 'Left',
 2423             9 => 'Upper-left',
 2424             10 => 'Far Right', # only given by A700
 2425             11 => 'Far Left',  # only given by A700
 2426         },
 2427     },
 2428     # 0x0019 - AF sensor used for focusing for A700/A850/A900:
 2429     #
 2430     #   A700 AF sensor layout:         A850/A900 AF sensor layout:
 2431     #
 2432     #              -                             *-*                 - = AF sensor
 2433     #        |           |                  |           |            * = assist sensor
 2434     #              -                             *-*                 o = F2.8 sensor
 2435     #   |    |    |o|    |    |        |    *    |o|    *    |       A700 center: double-cross + F2.8
 2436     #              -                             *-*                 A850 center: double-cross + F2.8 + 4 assist
 2437     #        |           |                  |           |
 2438     #              -                             *-*
 2439     #
 2440     # Following values seen for A700/A850 in AFAreaMode=Local or Spot: (other values only seen in "Wide")
 2441     #
 2442     #              16
 2443     #         0           19
 2444     #              13
 2445     #    3    1    22     20    18
 2446     #               8
 2447     #         2           21
 2448     #               5
 2449     #
 2450     # Note 1: A850/A900 AFPoint Selected 'Left'/'Right' (in 0x0015) corresponds in position (see diagram)
 2451     #         to A700 Local AFPoint 'Far Left'/'Far Right', and gives 'Far Left'/'Far Right' in 0x0019.
 2452     # Note 2: A700 in "Wide" also gives all 23 values in 0x0019, although it doesn't have assist-points ...
 2453     0x0019 => { # the AF sensor used for focusing
 2454         Name => 'AFPoint',
 2455         PrintConv => {
 2456             0 => 'Upper-left',
 2457             1 => 'Left',
 2458             2 => 'Lower-left',
 2459             3 => 'Far Left',
 2460             4 => 'Bottom Assist-left', #(NC)
 2461             5 => 'Bottom',
 2462             6 => 'Bottom Assist-right', #(NC)
 2463             # values 7-14: 8 center points: 4 from double-cross + 4 assist; 7-10 appear horizontal, 11-14 vertical
 2464             7  => 'Center (7)', #(NC)
 2465             8  => 'Center (horizontal)',
 2466             9  => 'Center (9)', #(NC)
 2467             10 => 'Center (10)', #(NC)
 2468             11 => 'Center (11)', #(NC)
 2469             12 => 'Center (12)', #(NC)
 2470             13 => 'Center (vertical)',
 2471             14 => 'Center (14)', #(NC)
 2472             15 => 'Top Assist-left', #(NC)
 2473             16 => 'Top',
 2474             17 => 'Top Assist-right', #(NC)
 2475             18 => 'Far Right',
 2476             19 => 'Upper-right',
 2477             20 => 'Right',
 2478             21 => 'Lower-right',
 2479             22 => 'Center F2.8',
 2480         },
 2481     },
 2482     # AF Status for A700/A850/A900, which have different sensor layout
 2483     # and different int16 byte ordering
 2484     0x001e => { Name => 'AFStatusActiveSensor',       %Image::ExifTool::Minolta::afStatusInfo },
 2485     0x0020 => { Name => 'AFStatusUpper-left',         %Image::ExifTool::Minolta::afStatusInfo },
 2486     0x0022 => { Name => 'AFStatusLeft',               %Image::ExifTool::Minolta::afStatusInfo },
 2487     0x0024 => { Name => 'AFStatusLower-left',         %Image::ExifTool::Minolta::afStatusInfo },
 2488     0x0026 => { Name => 'AFStatusFarLeft',            %Image::ExifTool::Minolta::afStatusInfo },
 2489     0x0028 => { Name => 'AFStatusBottomAssist-left',  %Image::ExifTool::Minolta::afStatusInfo },
 2490     0x002a => { Name => 'AFStatusBottom',             %Image::ExifTool::Minolta::afStatusInfo },
 2491     0x002c => { Name => 'AFStatusBottomAssist-right', %Image::ExifTool::Minolta::afStatusInfo },
 2492     0x002e => { Name => 'AFStatusCenter-7',           %Image::ExifTool::Minolta::afStatusInfo },
 2493     0x0030 => { Name => 'AFStatusCenter-horizontal',  %Image::ExifTool::Minolta::afStatusInfo },
 2494     0x0032 => { Name => 'AFStatusCenter-9',           %Image::ExifTool::Minolta::afStatusInfo },
 2495     0x0034 => { Name => 'AFStatusCenter-10',          %Image::ExifTool::Minolta::afStatusInfo },
 2496     0x0036 => { Name => 'AFStatusCenter-11',          %Image::ExifTool::Minolta::afStatusInfo },
 2497     0x0038 => { Name => 'AFStatusCenter-12',          %Image::ExifTool::Minolta::afStatusInfo },
 2498     0x003a => { Name => 'AFStatusCenter-vertical',    %Image::ExifTool::Minolta::afStatusInfo },
 2499     0x003c => { Name => 'AFStatusCenter-14',          %Image::ExifTool::Minolta::afStatusInfo },
 2500     0x003e => { Name => 'AFStatusTopAssist-left',     %Image::ExifTool::Minolta::afStatusInfo },
 2501     0x0040 => { Name => 'AFStatusTop',                %Image::ExifTool::Minolta::afStatusInfo },
 2502     0x0042 => { Name => 'AFStatusTopAssist-right',    %Image::ExifTool::Minolta::afStatusInfo },
 2503     0x0044 => { Name => 'AFStatusFarRight',           %Image::ExifTool::Minolta::afStatusInfo },
 2504     0x0046 => { Name => 'AFStatusUpper-right',        %Image::ExifTool::Minolta::afStatusInfo },
 2505     0x0048 => { Name => 'AFStatusRight',              %Image::ExifTool::Minolta::afStatusInfo },
 2506     0x004a => { Name => 'AFStatusLower-right',        %Image::ExifTool::Minolta::afStatusInfo },
 2507     0x004c => { Name => 'AFStatusCenterF2-8',         %Image::ExifTool::Minolta::afStatusInfo },
 2508     0x0130 => {
 2509         Name => 'AFMicroAdjValue',
 2510         Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
 2511         ValueConv => '$val - 20',
 2512         ValueConvInv => '$val + 20',
 2513     },
 2514     0x0131 => {
 2515         Name => 'AFMicroAdjMode',
 2516         Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
 2517         Mask => 0x80,
 2518         PrintConv => {
 2519             0 => 'Off',
 2520             1 => 'On',
 2521         },
 2522     },
 2523     305.1 => { # (0x131)
 2524         Name => 'AFMicroAdjRegisteredLenses',
 2525         Notes => 'number of registered lenses with a non-zero AFMicroAdjValue',
 2526         Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
 2527         Mask => 0x7f,
 2528     },
 2529     # 0x0166 - 40 x 128 int8u values: AF Info Blocks for A850 and A900, not for A700
 2530 );
 2531 
 2532 # camera information for other DSLR models (ref JR)
 2533 %Image::ExifTool::Sony::CameraInfo2 = (
 2534     %binaryDataAttrs,
 2535     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 2536     NOTES => q{
 2537         Camera information for the DSLR-A200, A230, A290, A300, A330, A350, A380 and
 2538         A390.
 2539     },
 2540     0x00 => {
 2541         Name => 'LensSpec',
 2542         Format => 'undef[8]',
 2543         ValueConv => \&ConvLensSpec,
 2544         ValueConvInv => \&ConvInvLensSpec,
 2545         PrintConv => \&PrintLensSpec,
 2546         PrintConvInv => \&PrintInvLensSpec,
 2547     },
 2548     # 0x0010 - maybe to do with AFStatus: 0 na./Manual, 4 Failed, 16 Tracking, 64 Focused
 2549     0x0014 => {
 2550         Name => 'AFPointSelected',
 2551         PrintConvColumns => 2,
 2552         PrintConv => { #JR (NC) same list as A100, A700/A900, as all have 9 point AF
 2553             0 => 'Auto',
 2554             1 => 'Center',
 2555             2 => 'Top',
 2556             3 => 'Upper-right',
 2557             4 => 'Right',
 2558             5 => 'Lower-right',
 2559             6 => 'Bottom',
 2560             7 => 'Lower-left',
 2561             8 => 'Left',
 2562             9 => 'Upper-left',
 2563         },
 2564     },
 2565     0x0015 => {
 2566         Name => 'FocusModeSetting',
 2567         Notes => 'FocusModeSetting for other models',
 2568         PrintConv => {
 2569             0 => 'Manual',
 2570             1 => 'AF-S',
 2571             2 => 'AF-C',
 2572             3 => 'AF-A',
 2573             4 => 'DMF',
 2574         },
 2575     },
 2576     # 0x0018 - AF sensor used for focusing for A200/A230/A290/A300/A330/A350/A380/A390; AF sensor layout:
 2577     #
 2578     #               -              - = AF sensor
 2579     #        |              |      + = cross sensor
 2580     #
 2581     #            -  +  -
 2582     #
 2583     #        |              |
 2584     #               -
 2585     #
 2586     0x0018 => { # used A100 list which appears to match
 2587         Name => 'AFPoint',
 2588         PrintConv => {
 2589             0 => 'Top-right',
 2590             1 => 'Bottom-right',
 2591             2 => 'Bottom',
 2592             3 => 'Middle Horizontal',
 2593             4 => 'Center Vertical',
 2594             5 => 'Top',
 2595             6 => 'Top-left',
 2596             7 => 'Bottom-left',
 2597         },
 2598     },
 2599     # AF Status for A200/A230/A290/A300/A330/A350/A380/A390: analogous to A100 in Minolta.pm
 2600     0x001b => { Name => 'AFStatusActiveSensor',     %Image::ExifTool::Minolta::afStatusInfo },
 2601     0x001d => { Name => 'AFStatusTop-right',        %Image::ExifTool::Minolta::afStatusInfo },
 2602     0x001f => { Name => 'AFStatusBottom-right',     %Image::ExifTool::Minolta::afStatusInfo },
 2603     0x0021 => { Name => 'AFStatusBottom',           %Image::ExifTool::Minolta::afStatusInfo },
 2604     # MiddleHorizontal is any of the 3 central horizontal sensors
 2605     0x0023 => { Name => 'AFStatusMiddleHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
 2606     0x0025 => { Name => 'AFStatusCenterVertical',   %Image::ExifTool::Minolta::afStatusInfo },
 2607     0x0027 => { Name => 'AFStatusTop',              %Image::ExifTool::Minolta::afStatusInfo },
 2608     0x0029 => { Name => 'AFStatusTop-left',         %Image::ExifTool::Minolta::afStatusInfo },
 2609     0x002b => { Name => 'AFStatusBottom-left',      %Image::ExifTool::Minolta::afStatusInfo },
 2610     # the 3 MiddleHorizontal sensors
 2611     0x002d => { Name => 'AFStatusLeft',             %Image::ExifTool::Minolta::afStatusInfo },
 2612     0x002f => { Name => 'AFStatusCenterHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
 2613     0x0031 => { Name => 'AFStatusRight',            %Image::ExifTool::Minolta::afStatusInfo },
 2614     # 0x0166 -  59 x 96 int8u values: AF Info Blocks for A230/A290/A330/A380/A390
 2615     # 0x0182 -  58 x 88 int8u values: AF Info Blocks for A200/A300/A350
 2616 );
 2617 
 2618 # Camera information for the A55 (ref PH)
 2619 # (also valid for A33, A35, A560, A580 - ref JR)
 2620 %Image::ExifTool::Sony::CameraInfo3 = (
 2621     %binaryDataAttrs,
 2622     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 2623     IS_SUBDIR => [ 0x23 ],
 2624     NOTES => q{
 2625         Camera information stored by the A33, A35, A55, A450, A500, A550, A560,
 2626         A580, NEX-3/5/5C/C3 and VG10E.  Some tags are valid only for some of these
 2627         models.
 2628     },
 2629     0x00 => { #JR
 2630         Name => 'LensSpec',
 2631         Condition => '$$self{Model} !~ /^NEX-5C/',
 2632         Format => 'undef[8]',
 2633         ValueConv => \&ConvLensSpec,
 2634         ValueConvInv => \&ConvInvLensSpec,
 2635         PrintConv => \&PrintLensSpec,
 2636         PrintConvInv => \&PrintInvLensSpec,
 2637     },
 2638     0x0e => { #JR
 2639         Name => 'FocalLength',
 2640         Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
 2641         Format => 'int16u',
 2642         Priority => 0,
 2643         ValueConv => '$val / 10',
 2644         ValueConvInv => '$val * 10',
 2645         PrintConv => 'sprintf("%.1f mm",$val)',
 2646         PrintConvInv => '$val =~ s/ mm//; $val',
 2647     },
 2648     0x10 => { #JR
 2649         Name => 'FocalLengthTeleZoom',
 2650         Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
 2651         Format => 'int16u',
 2652         ValueConv => '$val * 2 / 3',
 2653         ValueConvInv => 'int($val * 3 / 2 + 0.5)',
 2654         PrintConv => 'sprintf("%.1f mm",$val)',
 2655         PrintConvInv => '$val =~ s/ mm//; $val',
 2656     },
 2657 #
 2658 # Note:
 2659 # The below AF decoding covers cameras with 2 different AF systems, with overlapping offsets !
 2660 #  1) DSLR-A450/A500/A550 with 9 point AF system: decoding/offsets identical to A200 - A390 in CameraInfo
 2661 #  2) SLT-A33/A35/A55 and DSLR-A560/A580 with 15 point AF system: similar/more info but at different offsets
 2662 #
 2663     0x14 => { #JR
 2664         Name => 'AFPointSelected',
 2665         Condition => '$$self{Model} =~ /^(DSLR-A(450|500|550))\b/',
 2666         # (these cameras have a 9-point AF system, ref JR)
 2667         PrintConvColumns => 2,
 2668         PrintConv => {
 2669             0 => 'Auto', # (seen in Wide mode and for Manual Focus)
 2670             1 => 'Center', # seen for AFArea=Spot
 2671             2 => 'Top',
 2672             3 => 'Upper-right',
 2673             4 => 'Right',
 2674             5 => 'Lower-right',
 2675             6 => 'Bottom',
 2676             7 => 'Lower-left',
 2677             8 => 'Left',
 2678             9 => 'Upper-left',
 2679         },
 2680     },
 2681     0x15 => { #JR
 2682         Name => 'FocusMode',
 2683         Condition => '$$self{Model} =~ /^(DSLR-A(450|500|550))\b/',
 2684         PrintConv => {
 2685             0 => 'Manual',
 2686             1 => 'AF-S',
 2687             2 => 'AF-C',
 2688             3 => 'AF-A',
 2689         },
 2690     },
 2691     0x18 => { #JR
 2692         Name => 'AFPoint',
 2693         Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
 2694         PrintConv => {
 2695             0 => 'Top-right',
 2696             1 => 'Bottom-right',
 2697             2 => 'Bottom',
 2698             3 => 'Middle Horizontal',
 2699             4 => 'Center Vertical',
 2700             5 => 'Top',
 2701             6 => 'Top-left',
 2702             7 => 'Bottom-left',
 2703         },
 2704     },
 2705     0x19 => { #JR
 2706         Name => 'FocusStatus',
 2707         Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
 2708         Notes => 'not valid with Contrast AF or for NEX models',
 2709         # seen the following values:
 2710         #  0 with MF (A35, A55V-HDR, A560, A580), non-AF lens (A35), and A580 Contrast-AF
 2711         #  4 with MF (A33, A55V), and A580 Contrast-AF
 2712         # 16 with AF-C (or AF-A) and focus OK
 2713         # 24 with AF-C (or AF-A) and unsharp or fast moving subject e.g. bird in flight
 2714         # 64 with AF-S (or AF-A) and focus OK
 2715         PrintConv => {
 2716             0 => 'Manual - Not confirmed (0)',
 2717             4 => 'Manual - Not confirmed (4)',
 2718             16 => 'AF-C - Confirmed',
 2719             24 => 'AF-C - Not Confirmed',
 2720             64 => 'AF-S - Confirmed',
 2721         },
 2722     },
 2723     0x1b => { #JR
 2724         Name => 'AFStatusActiveSensor',
 2725         Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
 2726         %Image::ExifTool::Minolta::afStatusInfo,
 2727     },
 2728     0x1c => {
 2729         Name => 'AFPointSelected',  # (v8.88: renamed from LocalAFAreaPointSelected)
 2730         Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
 2731         Notes => 'not valid for Contrast AF', #JR
 2732         # (all of these cameras have an 15-point three-cross AF system, ref JR)
 2733         PrintConvColumns => 2,
 2734         PrintConv => {
 2735             0 => 'Auto', # (seen in Wide mode)
 2736             1 => 'Center',
 2737             2 => 'Top',
 2738             3 => 'Upper-right',
 2739             4 => 'Right',
 2740             5 => 'Lower-right',
 2741             6 => 'Bottom',
 2742             7 => 'Lower-left',
 2743             8 => 'Left',
 2744             9 => 'Upper-left',
 2745             10 => 'Far Right',
 2746             11 => 'Far Left',
 2747             12 => 'Upper-middle',
 2748             13 => 'Near Right',
 2749             14 => 'Lower-middle',
 2750             15 => 'Near Left',
 2751         },
 2752     },
 2753     0x1d => [
 2754         {
 2755             Name => 'FocusMode',
 2756             Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
 2757             PrintConv => {
 2758                 0 => 'Manual',
 2759                 1 => 'AF-S',
 2760                 2 => 'AF-C',
 2761                 3 => 'AF-A',
 2762             },
 2763         },{ #JR
 2764             Name => 'AFStatusTop-right',
 2765             Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
 2766             %Image::ExifTool::Minolta::afStatusInfo,
 2767         },
 2768     ],
 2769     0x1f => { #JR
 2770         Name => 'AFStatusBottom-right',
 2771         Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
 2772         %Image::ExifTool::Minolta::afStatusInfo,
 2773     },
 2774     0x20 => { #JR
 2775         Name => 'AFPoint',  # (v8.88: renamed from LocalAFAreaPointUsed)
 2776         Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
 2777         Notes => 'the AF sensor used for focusing. Not valid for Contrast AF',
 2778         PrintConvColumns => 2,
 2779         PrintConv => {
 2780             %afPoint15,
 2781             255 => '(none)', #PH (A55, guess; also A35 with non-AF lens, ref JR)
 2782         },
 2783     },
 2784     0x21 => [ #JR
 2785         {
 2786             Name => 'AFStatusActiveSensor',
 2787             Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
 2788             %Image::ExifTool::Minolta::afStatusInfo,
 2789         },{
 2790             Name => 'AFStatusBottom',
 2791             Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
 2792             %Image::ExifTool::Minolta::afStatusInfo,
 2793         },
 2794     ],
 2795     0x23 => [ #JR
 2796         {
 2797             Name => 'AFStatus15',
 2798             Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
 2799             Format => 'int16s[18]',
 2800             SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFStatus15' },
 2801         },{
 2802             Name => 'AFStatusMiddleHorizontal', # MiddleHorizontal is any of the 3 central horizontal sensors
 2803             Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
 2804             %Image::ExifTool::Minolta::afStatusInfo,
 2805         },
 2806     ],
 2807     0x25 => { Name => 'AFStatusCenterVertical',   Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2808     0x27 => { Name => 'AFStatusTop',              Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2809     0x29 => { Name => 'AFStatusTop-left',         Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2810     0x2b => { Name => 'AFStatusBottom-left',      Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2811     # the 3 MiddleHorizontal sensors:
 2812     0x2d => { Name => 'AFStatusLeft',             Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2813     0x2f => { Name => 'AFStatusCenterHorizontal', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2814     0x31 => { Name => 'AFStatusRight',            Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
 2815     # 0x0166 - starting here there are 96 AF Info blocks of 155 bytes each for the SLT-A33/A35/A55 and DSLR-A560/A580,
 2816     #          starting here there are 86 AF Info blocks of 174 bytes each for the DSLR-A450/A500/A550,
 2817     #          but NOT for NEX, and not for the A580 in Contrast-AF mode (ref JR)
 2818     #          The 43rd byte of each block for A580 appears to be the AFPoint as in offset 0x20,
 2819     #          possibly also 73rd and 74th byte
 2820 );
 2821 
 2822 # Camera information for other models (ref PH)
 2823 %Image::ExifTool::Sony::CameraInfoUnknown = (
 2824     %binaryDataAttrs,
 2825     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 2826 );
 2827 
 2828 # white balance and other camera information (ref PH)
 2829 %Image::ExifTool::Sony::FocusInfo = (
 2830     %binaryDataAttrs,
 2831     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 2832     PRIORITY => 0,
 2833     NOTES => q{
 2834         More camera settings and focus information decoded for models such as the
 2835         A200, A230, A290, A300, A330, A350, A380, A390, A700, A850 and A900.
 2836     },
 2837     0x0e => [{ #7/JR
 2838         Name => 'DriveMode2',
 2839         Condition => '$$self{Model} =~ /^DSLR-A(230|290|330|380|390)$/',
 2840         Notes => 'A230, A290, A330, A380 and A390',
 2841         ValueConvInv => '$val',
 2842         PrintHex => 1,
 2843         PrintConv => { # (values confirmed for specified models - PH)
 2844             0x01 => 'Single Frame', # (A230,A330,A380)
 2845             0x02 => 'Continuous High', #PH (A230,A330)
 2846             0x04 => 'Self-timer 10 sec', # (A230)
 2847             0x05 => 'Self-timer 2 sec, Mirror Lock-up', # (A230,A290,A330,A380,390)
 2848             0x07 => 'Continuous Bracketing', # (A230,A330)
 2849             0x0a => 'Remote Commander', # (A230)
 2850             0x0b => 'Continuous Self-timer', # (A230,A330)
 2851         },
 2852     },{
 2853         Name => 'DriveMode2',
 2854         Notes => 'A200, A300, A350, A700, A850 and A900',
 2855         ValueConvInv => '$val',
 2856         PrintHex => 1,
 2857         PrintConv => {
 2858             0x01 => 'Single Frame',
 2859             0x02 => 'Continuous High', # A700/A900; not on A850
 2860             0x12 => 'Continuous Low', #JR
 2861             0x04 => 'Self-timer 10 sec',
 2862             0x05 => 'Self-timer 2 sec, Mirror Lock-up',
 2863             0x06 => 'Single-frame Bracketing',
 2864             0x07 => 'Continuous Bracketing',
 2865             0x18 => 'White Balance Bracketing Low', #JR
 2866             0x28 => 'White Balance Bracketing High', #JR
 2867             0x19 => 'D-Range Optimizer Bracketing Low', #JR
 2868             0x29 => 'D-Range Optimizer Bracketing High', #JR
 2869             0x0a => 'Remote Commander', #JR
 2870             0x0b => 'Mirror Lock-up', #JR (A850/A900; not on A700)
 2871         },
 2872     }],
 2873     0x10 => { #JR (1 and 2 inverted!)
 2874         Name => 'Rotation',
 2875         PrintConv => {
 2876             0 => 'Horizontal (normal)',
 2877             1 => 'Rotate 270 CW',
 2878             2 => 'Rotate 90 CW',
 2879         },
 2880     },
 2881     0x14 => {
 2882         Name => 'ImageStabilizationSetting',
 2883         PrintConv => { 0 => 'Off', 1 => 'On' },
 2884     },
 2885     0x15 => { #7
 2886         Name => 'DynamicRangeOptimizerMode',
 2887         PrintConv => {
 2888             0 => 'Off',
 2889             1 => 'Standard',
 2890             2 => 'Advanced Auto',
 2891             3 => 'Advanced Level',
 2892         },
 2893     },
 2894     0x2b => { #JR seen 2,1,3 for both WB and DRO bracketing
 2895         Name => 'BracketShotNumber',
 2896         Notes => 'WB and DRO bracketing',
 2897     },
 2898     0x2c => { #JR
 2899         Name => 'WhiteBalanceBracketing',
 2900         PrintConv => {
 2901             0 => 'Off',
 2902             1 => 'Low',
 2903             2 => 'High',
 2904         },
 2905     },
 2906     0x2d => { #JR seen 2,1,3 for both WB and DRO bracketing
 2907         Name => 'BracketShotNumber2',
 2908     },
 2909     0x2e => { #JR
 2910         Name => 'DynamicRangeOptimizerBracket',
 2911         PrintConv => {
 2912             0 => 'Off',
 2913             1 => 'Low',
 2914             2 => 'High',
 2915         },
 2916     },
 2917     0x2f => { #JR seen 0,1,2 and 0,1,2,3,4 for 3 and 5 image bracketing sequences
 2918         Name => 'ExposureBracketShotNumber',
 2919     },
 2920     0x3f => { #JR
 2921         Name => 'ExposureProgram',
 2922         SeparateTable => 'ExposureProgram',
 2923         PrintConv => \%sonyExposureProgram,
 2924     },
 2925     0x41 => { #JR style actually used (combination of mode dial + creative style menu)
 2926         Name => 'CreativeStyle',
 2927         PrintConvColumns => 2,
 2928         PrintConv => {
 2929             1 => 'Standard',
 2930             2 => 'Vivid',
 2931             3 => 'Portrait',
 2932             4 => 'Landscape',
 2933             5 => 'Sunset',
 2934             6 => 'Night View/Portrait',
 2935             8 => 'B&W',
 2936             9 => 'Adobe RGB', # A700
 2937             11 => 'Neutral',
 2938             12 => 'Clear', #7
 2939             13 => 'Deep', #7
 2940             14 => 'Light', #7
 2941             15 => 'Autumn Leaves', #7
 2942             16 => 'Sepia', #7
 2943         },
 2944     },
 2945     0x6d => {
 2946         Name => 'ISOSetting',
 2947         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 2948         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 2949         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 2950         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 2951     },
 2952     0x6f => {
 2953         Name => 'ISO',
 2954         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 2955         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 2956         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 2957         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 2958     },
 2959     0x77 => { #JR
 2960         Name => 'DynamicRangeOptimizerMode',
 2961         PrintConv => {
 2962             0 => 'Off',
 2963             1 => 'Standard',
 2964             2 => 'Advanced Auto',
 2965             3 => 'Advanced Level',
 2966         },
 2967     },
 2968     0x79 => 'DynamicRangeOptimizerLevel',
 2969 #    0x06f1 - int16u    LensType,  Condition => '$$self{Model} =~ /^DSLR-A(700|850|900)$/',
 2970 #    0x4a81 - int16u    LensType,  Condition => '$$self{Model} !~ /^DSLR-A(700|850|900)$/',
 2971 #    0x4a84 - int16uRev LensType,  Condition => '$$self{Model} =~ /^DSLR-A(700|850|900)$/',
 2972     0x0846 => { #13
 2973         Name => 'ShutterCount', # (=ImageCount for these models)
 2974         Condition => '$$self{Model} =~ /^DSLR-A(230|290|330|380|390|850|900)$/',
 2975         Format => 'int32u',
 2976         Notes => 'only valid for some DSLR models',
 2977         RawConv => '$val & 0x00ffffff', #PH
 2978     },
 2979     0x09bb => { #PH (validated only for DSLR-A850)
 2980         Name => 'FocusPosition',
 2981         Condition => '$$self{Model} =~ /^DSLR-A(200|230|290|300|330|350|380|390|700|850|900)$/',
 2982         Notes => 'only valid for some DSLR models',
 2983         # 128 = infinity -- see Composite:FocusDistance below
 2984     },
 2985     0x1110 => { # (9600 bytes: 4 sets of 40x30 int16u values in the range 0-8191)
 2986         Name => 'TiffMeteringImage',
 2987         Format => 'undef[9600]',
 2988         Notes => q{
 2989             13-bit RBGG (?) 40x30 pixels, presumably metering info, extracted as a
 2990             16-bit TIFF image;
 2991         },
 2992         ValueConv => sub {
 2993             my ($val, $et) = @_;
 2994             return undef unless length $val >= 9600;
 2995             return \ "Binary data 7404 bytes" unless $et->Options('Binary');
 2996             my @dat = unpack('n*', $val);
 2997             # TIFF header for a 16-bit RGB 10dpi 40x30 image
 2998             $val = Image::ExifTool::MakeTiffHeader(40,30,3,16,10);
 2999             # re-order data to RGB pixels
 3000             my ($i, @val);
 3001             for ($i=0; $i<40*30; ++$i) {
 3002                 # data is 13-bit (max 8191), shift left to fill 16 bits
 3003                 # (typically, this gives a very dark image since the data should
 3004                 # really be anti-logged to convert from EV to perceived brightness)
 3005 #                push @val, $dat[$i]<<3, $dat[$i+2400]<<3, $dat[$i+1200]<<3;
 3006                 push @val, int(5041.1*log($dat[$i]+1)/log(2)), int(5041.1*log($dat[$i+2400]+1)/log(2)), int(5041.1*log($dat[$i+1200]+1)/log(2));
 3007             }
 3008             $val .= pack('v*', @val);   # add TIFF strip data
 3009             return \$val;
 3010         },
 3011     },
 3012 );
 3013 
 3014 # more camera setting information (ref JR)
 3015 # - many of these tags are the same as in CameraSettings3
 3016 %Image::ExifTool::Sony::MoreInfo = (
 3017     PROCESS_PROC => \&ProcessMoreInfo,
 3018     WRITE_PROC => \&ProcessMoreInfo,
 3019     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3020     NOTES => q{
 3021         More camera settings information decoded for the A450, A500, A550, A560,
 3022         A580, A33, A35, A55, NEX-3/5/C3 and VG10E.
 3023     },
 3024     0x0001 => { # (256 bytes)
 3025         Name => 'MoreSettings',
 3026         SubDirectory => { TagTable => 'Image::ExifTool::Sony::MoreSettings' },
 3027     },
 3028     # (byte sizes for a single A580 image -- not checked for other images)
 3029     0x0002 => [ # (256 bytes)
 3030         {
 3031             Name => 'FaceInfo',
 3032             Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
 3033             SubDirectory => { TagTable => 'Image::ExifTool::Sony::FaceInfo' },
 3034         },{
 3035             Name => 'FaceInfoA',
 3036             Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
 3037             SubDirectory => { TagTable => 'Image::ExifTool::Sony::FaceInfoA' },
 3038         },
 3039     ],
 3040     # 0x0101:  512 bytes
 3041     # 0x0102: 1804 bytes
 3042     # 0x0103:  176 bytes
 3043     # 0x0104: 1088 bytes
 3044     # 0x0105:  160 bytes (all zero unless flash is used, ref JR)
 3045     # 0x0106:  256 bytes (faces detected if first byte is non-zero? ref JR)
 3046     0x0107 => { # (7200 bytes: 3 sets of 40x30 int16u values in the range 0-1023)
 3047         Name => 'TiffMeteringImage',
 3048         Notes => q{
 3049             10-bit RGB data from the 1200 AE metering segments, extracted as a 16-bit
 3050             TIFF image
 3051         },
 3052         ValueConv => sub {
 3053             my ($val, $et) = @_;
 3054             return undef unless length $val >= 7200;
 3055             return \ "Binary data 7404 bytes" unless $et->Options('Binary');
 3056             my @dat = unpack('v*', $val);
 3057             # TIFF header for a 16-bit RGB 10dpi 40x30 image
 3058             $val = Image::ExifTool::MakeTiffHeader(40,30,3,16,10);
 3059             # re-order data to RGB pixels
 3060             my ($i, @val);
 3061             for ($i=0; $i<40*30; ++$i) {
 3062                 # data is 10-bit (max 1023), shift left to fill 16 bits
 3063                 # (typically, this gives a very dark image since the data should
 3064                 # really be anti-logged to convert from EV to perceived brightness)
 3065                 push @val, $dat[$i]<<6, $dat[$i+1200]<<6, $dat[$i+2400]<<6;
 3066             }
 3067             $val .= pack('v*', @val);   # add TIFF strip data
 3068             return \$val;
 3069         },
 3070     },
 3071     # 0x0108:  140 bytes
 3072     # 0x0109:  256 bytes
 3073     # 0x010a:  256 bytes
 3074     # 0x0306:  276 bytes
 3075     # 0x0307:  256 bytes
 3076     # 0x0308:   96 bytes
 3077     # 0x0309:  112 bytes
 3078     # 0xffff:  788 bytes
 3079     0x0201 => { # (368 bytes)
 3080         Name => 'MoreInfo0201',
 3081         SubDirectory => { TagTable => 'Image::ExifTool::Sony::MoreInfo0201' },
 3082     },
 3083     # 0x0202:  144 bytes
 3084     # 0x0401: 4608 bytes
 3085     0x0401 => {
 3086         Name => 'MoreInfo0401',
 3087         SubDirectory => { TagTable => 'Image::ExifTool::Sony::MoreInfo0401' },
 3088     },
 3089 );
 3090 
 3091 %Image::ExifTool::Sony::MoreInfo0201 = (
 3092     %binaryDataAttrs,
 3093     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3094     PRIORITY => 0,
 3095 #    0x005d - also from 0 - 255, in sync with but lower than 0x005e, depending on FocalLength
 3096 #    0x005e => {
 3097 #        # FocusPosition for A560/A580/A33/A35/A55V
 3098 #        # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
 3099 #        Name => 'FocusPosition2_0201',
 3100 #        Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
 3101 #    },
 3102 #    0x0093 - also from 0 - 255, in sync with but lower than 0x0094, depending on FocalLength
 3103 #    0x0094 => {
 3104 #        # FocusPosition for A450/A500/A550
 3105 #        # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
 3106 #        Name => 'FocusPosition2_0201',
 3107 #        Condition => '$$self{Model} =~ /^(DSLR-(A450|A500|A550)$)/',
 3108 #    },
 3109     0x011b => { #13
 3110         Name => 'ImageCount',
 3111         Condition => '$$self{Model} !~ /^DSLR-A(450|500|550)$/', #JR
 3112         Format => 'int32u',
 3113         Notes => 'not valid for the A450, A500 or A550',
 3114         RawConv => '$val & 0x00ffffff',
 3115     },
 3116     0x0125 => { #13
 3117         Name => 'ShutterCount',
 3118         Condition => '$$self{Model} !~ /^DSLR-A(450|500|550)$/', #JR
 3119         Format => 'int32u',
 3120         Notes => 'not valid for the A450, A500 or A550',
 3121         RawConv => '$val & 0x00ffffff',
 3122     },
 3123     0x014a => { #13
 3124         Name => 'ShutterCount', # (=ImageCount for these models)
 3125         Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)$/', #JR
 3126         Format => 'int32u',
 3127         Notes => 'A450, A500 and A550 only',
 3128         RawConv => '$val & 0x00ffffff',
 3129     },
 3130 );
 3131 
 3132 %Image::ExifTool::Sony::MoreInfo0401 = (
 3133     %binaryDataAttrs,
 3134     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3135     PRIORITY => 0,
 3136     0x044e => { #JR
 3137         Name => 'ShotNumberSincePowerUp',
 3138         Condition => '$$self{Model} !~ /^NEX-(3|5)$/',
 3139         Format => 'int32u',
 3140         Notes => 'Not valid for the NEX-3 or NEX-5',
 3141         RawConv => '$val & 0x00ffffff',
 3142     },
 3143 #    0x101e - int16u LensType  Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
 3144 #    0x1022 - int16u LensType  Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
 3145 #    0x102a - int16u LensType  Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
 3146 
 3147 #    0x10a8 - int16u LensType  Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
 3148 #    0x10ac - int16u LensType  Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
 3149 #    0x10b4 - int16u LensType  Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
 3150 #
 3151 #    0x10f7 - int16u LensType  Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
 3152 #    0x10fb - int16u LensType  Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
 3153 #    0x1103 - int16u LensType  Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
 3154 #
 3155 #    0x1181 - int16u LensType  Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
 3156 #    0x1185 - int16u LensType  Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
 3157 #    0x118d - int16u LensType  Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
 3158 );
 3159 
 3160 # more camera setting information (ref JR)
 3161 # - many of these tags are the same as in CameraSettings3
 3162 %Image::ExifTool::Sony::MoreSettings = (
 3163     %binaryDataAttrs,
 3164     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3165     PRIORITY => 0,
 3166     0x01 => { # interesting: somewhere between CameraSettings3 0x04 and 0x34
 3167         Name => 'DriveMode2',
 3168         PrintHex => 1,
 3169         PrintConv => {
 3170             0x10 => 'Single Frame',
 3171             0x21 => 'Continuous High', # also automatically selected for Scene mode Sports-action (0x05=52)
 3172             0x22 => 'Continuous Low',
 3173             0x30 => 'Speed Priority Continuous',
 3174             0x51 => 'Self-timer 10 sec',
 3175             0x52 => 'Self-timer 2 sec, Mirror Lock-up',
 3176             0x71 => 'Continuous Bracketing 0.3 EV',
 3177             0x75 => 'Continuous Bracketing 0.7 EV',
 3178             0x91 => 'White Balance Bracketing Low',
 3179             0x92 => 'White Balance Bracketing High',
 3180             0xc0 => 'Remote Commander',
 3181         },
 3182     },
 3183     0x02 => {
 3184         Name => 'ExposureProgram',
 3185         SeparateTable => 'ExposureProgram2',
 3186         PrintConv => \%sonyExposureProgram2,
 3187     },
 3188     0x03 => {
 3189         Name => 'MeteringMode',
 3190         PrintConv => {
 3191             1 => 'Multi-segment',
 3192             2 => 'Center-weighted average',
 3193             3 => 'Spot',
 3194         },
 3195     },
 3196     0x04 => {
 3197         Name => 'DynamicRangeOptimizerSetting',
 3198         PrintConv => {
 3199             1 => 'Off',
 3200             16 => 'On (Auto)',
 3201             17 => 'On (Manual)',
 3202         },
 3203     },
 3204     0x05 => 'DynamicRangeOptimizerLevel',
 3205     0x06 => {
 3206         Name => 'ColorSpace',
 3207         PrintConv => {
 3208             1 => 'sRGB',
 3209             2 => 'Adobe RGB',
 3210         },
 3211     },
 3212     0x07 => {
 3213         Name => 'CreativeStyleSetting',
 3214         PrintConvColumns => 2,
 3215         PrintConv => {
 3216             16 => 'Standard',
 3217             32 => 'Vivid',
 3218             64 => 'Portrait',
 3219             80 => 'Landscape',
 3220             96 => 'B&W',
 3221             160 => 'Sunset',
 3222         },
 3223     },
 3224     0x08 => { #JR
 3225         Name => 'ContrastSetting',
 3226         Format => 'int8s',
 3227         PrintConv => '$val > 0 ? "+$val" : $val',
 3228         PrintConvInv => '$val',
 3229     },
 3230     0x09 => {
 3231         Name => 'SaturationSetting',
 3232         Format => 'int8s',
 3233         PrintConv => '$val > 0 ? "+$val" : $val',
 3234         PrintConvInv => '$val',
 3235     },
 3236     0x0a => {
 3237         Name => 'SharpnessSetting',
 3238         Format => 'int8s',
 3239         PrintConv => '$val > 0 ? "+$val" : $val',
 3240         PrintConvInv => '$val',
 3241     },
 3242     0x0d => {
 3243         Name => 'WhiteBalanceSetting',
 3244         # many guessed, based on "logical system" as observed for Daylight and Shade and steps of 16 between the modes
 3245         PrintHex => 1,
 3246         PrintConvColumns => 2,
 3247         PrintConv => \%whiteBalanceSetting,
 3248         SeparateTable => 1,
 3249     },
 3250     0x0e => {
 3251         Name => 'ColorTemperatureSetting',
 3252         # matches "0xb021 ColorTemperature" when WB set to "Custom" or "Color Temperature/Color Filter"
 3253         ValueConv => '$val * 100',
 3254         ValueConvInv => '$val / 100',
 3255         PrintConv => '"$val K"',
 3256         PrintConvInv => '$val =~ s/ ?K$//i; $val',
 3257     },
 3258     0x0f => {
 3259         Name => 'ColorCompensationFilterSet',
 3260         # seen 0, 1-9 and 245-255, corresponding to 0, M1-M9 and G9-G1 on camera display
 3261         # matches "0xb022 ColorCompensationFilter" when WB set to "Custom" or "Color Temperature/Color Filter"
 3262         Format => 'int8s',
 3263         Notes => 'negative is green, positive is magenta',
 3264         PrintConv => '$val > 0 ? "+$val" : $val',
 3265         PrintConvInv => '$val',
 3266     },
 3267     0x10 => {
 3268         Name => 'FlashMode',
 3269         PrintConvColumns => 2,
 3270         PrintConv => {
 3271             1 => 'Flash Off',
 3272             16 => 'Autoflash',
 3273             17 => 'Fill-flash',
 3274             18 => 'Slow Sync',
 3275             19 => 'Rear Sync',
 3276             20 => 'Wireless',
 3277         },
 3278     },
 3279     0x11 => {
 3280         Name => 'LongExposureNoiseReduction',
 3281         PrintConv => {
 3282             1 => 'Off',
 3283             16 => 'On',  # (unused or dark subject)
 3284         },
 3285     },
 3286     0x12 => {
 3287         Name => 'HighISONoiseReduction',
 3288         PrintConv => {
 3289             16 => 'Low',
 3290             17 => 'High',
 3291             19 => 'Auto',
 3292         },
 3293     },
 3294     0x13 => { # why is this not valid for A450/A500/A550 ?
 3295         Name => 'FocusMode',
 3296         Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
 3297         PrintConv => {
 3298             17 => 'AF-S',
 3299             18 => 'AF-C',
 3300             19 => 'AF-A',
 3301             32 => 'Manual',
 3302             48 => 'DMF', #(NC) (seen for NEX-5)
 3303         },
 3304     },
 3305     0x15 => {
 3306         Name => 'MultiFrameNoiseReduction',
 3307         Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
 3308         PrintConv => {
 3309             0 => 'n/a', # seen for A450/A500/A550
 3310             1 => 'Off',
 3311             16 => 'On',
 3312             255 => 'None', # seen for NEX-3/5/C3
 3313         },
 3314     },
 3315     0x16 => {
 3316         Name => 'HDRSetting',
 3317         PrintConv => {
 3318             1 => 'Off',
 3319             16 => 'On (Auto)',
 3320             17 => 'On (Manual)',
 3321         },
 3322     },
 3323     0x17 => {
 3324         Name => 'HDRLevel',
 3325         PrintConvColumns => 3,
 3326         PrintConv => {
 3327             33 => '1 EV',
 3328             34 => '1.5 EV', #JR (NC)
 3329             35 => '2 EV',
 3330             36 => '2.5 EV', #JR (NC)
 3331             37 => '3 EV',
 3332             38 => '3.5 EV', #PH (NC)
 3333             39 => '4 EV',
 3334             40 => '5 EV',
 3335             41 => '6 EV',
 3336         },
 3337     },
 3338     0x18 => {
 3339         Name => 'ViewingMode',
 3340         PrintConv => {
 3341             16 => 'ViewFinder',
 3342             33 => 'Focus Check Live View',
 3343             34 => 'Quick AF Live View',
 3344         },
 3345     },
 3346     0x19 => {
 3347         Name => 'FaceDetection',
 3348         PrintConv => {
 3349             1 => 'Off',
 3350             16 => 'On',
 3351         },
 3352     },
 3353     0x1a => {
 3354         Name => 'CustomWB_RBLevels',
 3355         # matches "0x7313 WB_RGGBLevels" when WB set to "Custom", except factor of 4
 3356         Format => 'int16uRev[2]',
 3357     },
 3358     # From here different and overlapping offsets for 3 groups of cameras:
 3359     # 1) DSLR-A450/A500/A550
 3360     # 2) NEX-3/5/5C
 3361     # 3) DSLR-A560/A580, NEX-C3/VG10/VG10E, SLT-A33/A35/A55V
 3362     0x1e => [{
 3363         Name => 'BrightnessValue',
 3364         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3365         Notes => 'A450, A500 and A550',
 3366         ValueConv => '($val-106)/8',
 3367         ValueConvInv => '$val * 8 + 106',
 3368     },{
 3369         Name => 'ExposureCompensationSet',
 3370         Notes => 'other models',
 3371         ValueConv => '($val - 128) / 24', #PH
 3372         ValueConvInv => 'int($val * 24 + 128.5)',
 3373         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3374         PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
 3375     }],
 3376     0x1f => [{
 3377         Name => 'ISO',
 3378         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3379         Notes => 'A450, A500 and A550',
 3380         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 3381         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 3382         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 3383         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 3384     },{
 3385         Name => 'FlashExposureCompSet',
 3386         Notes => 'other models',
 3387         Description => 'Flash Exposure Comp. Setting',
 3388         ValueConv => '($val - 128) / 24', #PH
 3389         ValueConvInv => 'int($val * 24 + 128.5)',
 3390         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3391         PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
 3392     }],
 3393     0x20 => [{
 3394         Name => 'FNumber',
 3395         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3396         Notes => 'A450, A500 and A550',
 3397         ValueConv => '2 ** (($val/8 - 1) / 2)',
 3398         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 3399         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 3400         PrintConvInv => '$val',
 3401     },{
 3402         Name => 'LiveViewAFMethod',
 3403         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)/',
 3404         Notes => 'other models except the NEX-3/5/5C',
 3405         PrintConv => {
 3406             0 => 'n/a',
 3407             1 => 'Phase-detect AF',
 3408             2 => 'Contrast AF',
 3409             # Contrast AF is only available with SSM/SAM lenses and in Focus Check LV,
 3410             # NOT in Quick AF LV, and is automatically set when mounting SSM/SAM lens
 3411             # - changes into Phase-AF when switching to Quick AF LV.
 3412         },
 3413     }],
 3414     0x21 => [{
 3415         Name => 'ExposureTime',
 3416         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3417         Notes => 'A450, A500 and A550',
 3418         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 3419         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 3420         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 3421         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 3422     },{
 3423         Name => 'ISO',
 3424         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3425         Notes => 'NEX-3/5/5C',
 3426         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 3427         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 3428         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 3429         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 3430     }],
 3431     0x22 => {
 3432         Name => 'FNumber',
 3433         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3434         Notes => 'NEX-3/5/5C only',
 3435         ValueConv => '2 ** (($val/8 - 1) / 2)',
 3436         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 3437         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 3438         PrintConvInv => '$val',
 3439     },
 3440     0x23 => [{
 3441         Name => 'FocalLength2',
 3442         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3443         Notes => 'A450, A500 and A550',
 3444         ValueConv => '10 * 2 ** (($val-28)/16)',
 3445         ValueConvInv => '$val>0 ? log($val/10)/log(2) * 16 + 28 : 0',
 3446         PrintConv => 'sprintf("%.1f mm",$val)',
 3447         PrintConvInv => '$val=~s/\s*mm$//; $val',
 3448     },{
 3449         Name => 'ExposureTime',
 3450         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3451         Notes => 'NEX-3/5/5C',
 3452         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 3453         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 3454         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 3455         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 3456     }],
 3457     0x24 => {
 3458         Name => 'ExposureCompensation2',
 3459         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3460         Notes => 'A450, A500 and A550',
 3461         Format => 'int16s',
 3462         ValueConv => '$val / 8',
 3463         ValueConvInv => '$val * 8',
 3464         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3465         PrintConvInv => '$val',
 3466     },
 3467     0x25 => [{
 3468         Name => 'FocalLength2',
 3469         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3470         Notes => 'NEX-3/5/5C',
 3471         ValueConv => '10 * 2 ** (($val-28)/16)',
 3472         ValueConvInv => '$val>0 ? log($val/10)/log(2) * 16 + 28 : 0',
 3473         PrintConv => 'sprintf("%.1f mm",$val)',
 3474         PrintConvInv => '$val=~s/\s*mm$//; $val',
 3475     },{
 3476         Name => 'ISO',
 3477         Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)/',
 3478         Notes => 'other models except the A450, A500 and A550',
 3479         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 3480         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 3481         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 3482         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 3483     }],
 3484     0x26 => [{
 3485         Name => 'FlashExposureCompSet2',
 3486         Description => 'Flash Exposure Comp. Setting 2',
 3487         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3488         Notes => 'A450, A500 and A550',
 3489         Format => 'int16s',
 3490         ValueConv => '$val / 8',
 3491         ValueConvInv => '$val * 8',
 3492         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3493         PrintConvInv => '$val',
 3494     },{
 3495         Name => 'ExposureCompensation2',
 3496         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3497         Notes => 'NEX-3/5/5C',
 3498         Format => 'int16s',
 3499         ValueConv => '$val / 8',
 3500         ValueConvInv => '$val * 8',
 3501         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3502         PrintConvInv => '$val',
 3503     },{
 3504         Name => 'FNumber',
 3505         Notes => 'other models',
 3506         ValueConv => '2 ** (($val/8 - 1) / 2)',
 3507         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 3508         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 3509         PrintConvInv => '$val',
 3510     }],
 3511     0x27 => {
 3512         Name => 'ExposureTime',
 3513         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
 3514         Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
 3515         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 3516         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 3517         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 3518         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 3519     },
 3520     0x28 => {
 3521         Name => 'Orientation2',
 3522         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3523         Notes => 'A450, A500 and A550',
 3524         PrintConv => {
 3525             1 => 'Horizontal (normal)',
 3526             2 => 'Rotate 180',
 3527             6 => 'Rotate 90 CW',
 3528             8 => 'Rotate 270 CW',
 3529         },
 3530     },
 3531     0x29 => [{
 3532         # FocusPosition for A450/A500/A550
 3533         # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
 3534         Name => 'FocusPosition2',
 3535         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3536         Notes => 'A450, A500 and A550',
 3537     },{
 3538         # value increase of 16 corresponds to doubling of FocalLength
 3539         Name => 'FocalLength2',
 3540         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)/',
 3541         Notes => 'other models except the NEX-3/5/5C',
 3542         ValueConv => '10 * 2 ** (($val-28)/16)',
 3543         ValueConvInv => '$val>0 ? log($val/10)/log(2) * 16 + 28 : 0',
 3544         PrintConv => 'sprintf("%.1f mm",$val)',
 3545         PrintConvInv => '$val=~s/\s*mm$//; $val',
 3546     }],
 3547     0x2a => [{
 3548         Name => 'FlashAction',
 3549         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3550         Notes => 'A450, A500 and A550',
 3551         PrintConv => {
 3552             0 => 'Did not fire',
 3553             1 => 'Fired',
 3554         },
 3555     },{
 3556         Name => 'ExposureCompensation2',
 3557         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)/',
 3558         Notes => 'other models except the NEX-3/5/5C',
 3559         Format => 'int16s',
 3560         ValueConv => '$val / 8',
 3561         ValueConvInv => '$val * 8',
 3562         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3563         PrintConvInv => '$val',
 3564     }],
 3565     0x2b => {
 3566         # FocusPosition for NEX-3/5/5C
 3567         # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
 3568         Name => 'FocusPosition2',
 3569         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3570         Notes => 'NEX-3/5/5C only',
 3571     },
 3572     0x2c => [{
 3573         Name => 'FocusMode2',
 3574         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3575         Notes => 'A450, A500 and A550',
 3576         PrintConv => {
 3577             0 => 'AF',
 3578             1 => 'MF',
 3579         },
 3580     },{
 3581         Name => 'FlashAction',
 3582         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3583         Notes => 'NEX-3/5/5C FlashAction2',
 3584         PrintConv => {
 3585             0 => 'Did not fire',
 3586             1 => 'Fired',
 3587         },
 3588     },{
 3589         Name => 'FlashExposureCompSet2',
 3590         Description => 'Flash Exposure Comp. Setting 2',
 3591         Notes => 'other models FlashExposureCompSet2',
 3592         Format => 'int16s',
 3593         ValueConv => '$val / 8',
 3594         ValueConvInv => '$val * 8',
 3595         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3596         PrintConvInv => '$val',
 3597     }],
 3598     0x2e => [{
 3599         Name => 'FocusMode2',
 3600         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3601         Notes => 'NEX-3/5/5C',
 3602         PrintConv => {
 3603             0 => 'AF',
 3604             1 => 'MF',
 3605         },
 3606     },{
 3607         Name => 'Orientation2', # seen some A55 images where this does not match the other Orientation tags
 3608         Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)/',
 3609         Notes => 'other models except the A450, A500 and A550',
 3610         PrintConv => {
 3611             1 => 'Horizontal (normal)',
 3612             2 => 'Rotate 180',
 3613             6 => 'Rotate 90 CW',
 3614             8 => 'Rotate 270 CW',
 3615         },
 3616     }],
 3617     0x2f => {
 3618         # FocusPosition for A560/A580/A33/A35/A55V and NEX-C3/VG10/VG10E
 3619         # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
 3620         Name => 'FocusPosition2',
 3621         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
 3622         Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
 3623     },
 3624     0x30 => {
 3625         Name => 'FlashAction',
 3626         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
 3627         Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
 3628         PrintConv => {
 3629             0 => 'Did not fire',
 3630             1 => 'Fired',
 3631         },
 3632     },
 3633     0x32 => {
 3634         Name => 'FocusMode2',
 3635         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
 3636         Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
 3637         PrintConv => {
 3638             0 => 'AF',
 3639             1 => 'MF',
 3640         },
 3641     },
 3642     0x0077 => {
 3643         Name => 'FlashAction2',
 3644         Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
 3645         PrintConv => {
 3646             0 => 'Did not fire',
 3647             2 => 'External Flash fired (2)',
 3648             3 => 'Built-in Flash fired',
 3649             4 => 'External Flash fired (4)', # what is difference with 2 ?
 3650         },
 3651     },
 3652     0x0078 => {
 3653         Name => 'FlashActionExternal',
 3654         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3655         PrintConv => {
 3656             136 => 'Did not fire',
 3657             121 => 'Fired', # what is difference with 122 ?
 3658             122 => 'Fired',
 3659         },
 3660     },
 3661     0x007c => {
 3662         Name => 'FlashActionExternal',
 3663         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
 3664         PrintConv => {
 3665             136 => 'Did not fire',
 3666             167 => 'Fired',
 3667             182 => 'Fired, HSS',
 3668         },
 3669     },
 3670     0x0082 => {
 3671         Name => 'FlashStatus',
 3672         Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
 3673         PrintConv => {
 3674             0 => 'None',
 3675             2 => 'External',
 3676         },
 3677     },
 3678     0x0086 => {
 3679         Name => 'FlashStatus',
 3680         Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
 3681         PrintConv => {
 3682             0 => 'None',
 3683             1 => 'Built-in',
 3684             2 => 'External',
 3685         },
 3686     },
 3687 );
 3688 
 3689 # Face detection information (ref JR)
 3690 my %faceInfo = (
 3691     Format => 'int16u[4]',
 3692     # re-order to top,left,height,width and scale to full-sized image like other Sony models
 3693     ValueConv => 'my @v=split(" ",$val); $_*=15 foreach @v; "$v[1] $v[0] $v[3] $v[2]"',
 3694     ValueConvInv => 'my @v=split(" ",$val); $_=int($_/15+0.5) foreach @v; "$v[1] $v[0] $v[3] $v[2]"',
 3695 );
 3696 %Image::ExifTool::Sony::FaceInfo = (
 3697     %binaryDataAttrs,
 3698     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3699     FORMAT => 'int16u',
 3700     DATAMEMBER => [ 0x00 ],
 3701     0x00 => {
 3702         Name => 'FacesDetected',
 3703         DataMember => 'FacesDetected',
 3704         Format => 'int16s',
 3705         RawConv => '$$self{FacesDetected} = ($val == -1 ? 0 : $val); $val',
 3706         PrintConv => {
 3707             OTHER => sub { shift }, # pass other values straight through
 3708             -1 => 'n/a',
 3709         },
 3710     },
 3711     0x01 => {
 3712         Name => 'Face1Position',
 3713         Condition => '$$self{FacesDetected} >= 1',
 3714         %faceInfo,
 3715         Notes => q{
 3716             re-ordered and scaled to return the top, left, height and width of detected
 3717             face, with coordinates relative to the full-sized unrotated image and
 3718             increasing Y downwards
 3719         },
 3720     },
 3721     0x06 => {
 3722         Name => 'Face2Position',
 3723         Condition => '$$self{FacesDetected} >= 2',
 3724         %faceInfo,
 3725     },
 3726     0x0b => {
 3727         Name => 'Face3Position',
 3728         Condition => '$$self{FacesDetected} >= 3',
 3729         %faceInfo,
 3730     },
 3731     0x10 => {
 3732         Name => 'Face4Position',
 3733         Condition => '$$self{FacesDetected} >= 4',
 3734         %faceInfo,
 3735     },
 3736     0x15 => {
 3737         Name => 'Face5Position',
 3738         Condition => '$$self{FacesDetected} >= 5',
 3739         %faceInfo,
 3740     },
 3741     0x1a => {
 3742         Name => 'Face6Position',
 3743         Condition => '$$self{FacesDetected} >= 6',
 3744         %faceInfo,
 3745     },
 3746     0x1f => {
 3747         Name => 'Face7Position',
 3748         Condition => '$$self{FacesDetected} >= 7',
 3749         %faceInfo,
 3750     },
 3751     0x24 => {
 3752         Name => 'Face8Position',
 3753         Condition => '$$self{FacesDetected} >= 8',
 3754         %faceInfo,
 3755     },
 3756 );
 3757 
 3758 %Image::ExifTool::Sony::FaceInfoA = ( # different offsets for A450/A500/A550
 3759     %binaryDataAttrs,
 3760     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3761     FORMAT => 'int16u',
 3762     DATAMEMBER => [ 0x02, 0x03, 0x08 ],
 3763 #
 3764 # The FacesDetected number at 0x03 below is often 1 lower than the one at Tag900b 0x02.
 3765 # The number of Face Positions starting at 0x5b (max. 4) corresponds to the number at 0x03.
 3766 # The number of Face Positions starting at 0x0b usually corresponds to the FacesDetected number of Tag900b...
 3767 # Therefore created the extra condition at 0x0b (11.1) to output an available FacePosition, even when 0x03=0...
 3768 #
 3769     0x02 => {
 3770         Name => 'FaceTest2',
 3771         DataMember => 'FaceTest2',
 3772         Hidden => 1,
 3773         RawConv => '$$self{FaceTest2} = $val; $$self{OPTIONS}{Unknown}<2 ? undef : $val',
 3774     },
 3775     0x03 => {
 3776         Name => 'FacesDetected',
 3777         DataMember => 'FacesDetected',
 3778         RawConv => '$$self{FacesDetected} = ($val > 8 ? 0 : $val); $val',
 3779         ValueConv => '$val > 8 ? 0 : $val',
 3780     },
 3781     0x08 => {
 3782         Name => 'FaceTest8',
 3783         DataMember => 'FaceTest8',
 3784         Hidden => 1,
 3785         RawConv => '$$self{FaceTest8} = $val; $$self{OPTIONS}{Unknown}<2 ? undef : $val',
 3786     },
 3787 # 0x0b - start of 8 Face Positions of 10 int16u values each
 3788     0x0b => {
 3789         Name => 'PotentialFace1Position',
 3790         Condition => q{
 3791             $$self{FacesDetected} >= 1 or
 3792             ($$self{FaceTest8} > 0 and ($$self{FaceTest2} == 1 or $$self{FaceTest2} == 257))
 3793         },
 3794         %faceInfo,
 3795     },
 3796     0x15 => {
 3797         Name => 'PotentialFace2Position',
 3798         Condition => '$$self{FacesDetected} >= 2 or ($$self{FacesDetected} == 1 and $$self{FaceTest8} > 0)',
 3799         %faceInfo,
 3800     },
 3801     0x1f => {
 3802         Name => 'PotentialFace3Position',
 3803         Condition => '$$self{FacesDetected} >= 3 or ($$self{FacesDetected} == 2 and $$self{FaceTest8} > 0)',
 3804         %faceInfo,
 3805     },
 3806     0x29 => {
 3807         Name => 'PotentialFace4Position',
 3808         Condition => '$$self{FacesDetected} >= 4 or ($$self{FacesDetected} == 3 and $$self{FaceTest8} > 0)',
 3809         %faceInfo,
 3810     },
 3811     0x33 => {
 3812         Name => 'PotentialFace5Position',
 3813         Condition => '$$self{FacesDetected} >= 5 or ($$self{FacesDetected} == 4 and $$self{FaceTest8} > 0)',
 3814         %faceInfo,
 3815     },
 3816     0x3d => {
 3817         Name => 'PotentialFace6Position',
 3818         Condition => '$$self{FacesDetected} >= 6 or ($$self{FacesDetected} == 5 and $$self{FaceTest8} > 0)',
 3819         %faceInfo,
 3820     },
 3821     0x47 => {
 3822         Name => 'PotentialFace7Position',
 3823         Condition => '$$self{FacesDetected} >= 7 or ($$self{FacesDetected} == 6 and $$self{FaceTest8} > 0)',
 3824         %faceInfo,
 3825     },
 3826     0x51 => {
 3827         Name => 'PotentialFace8Position',
 3828         Condition => '$$self{FacesDetected} >= 8 or ($$self{FacesDetected} == 7 and $$self{FaceTest8} > 0)',
 3829         %faceInfo,
 3830     },
 3831 # 0x5b - start of max. 4 further Face Positions here
 3832     0x5b => {
 3833         Name => 'Face1Position',
 3834         Condition => '$$self{FacesDetected} >= 1',
 3835         %faceInfo,
 3836     },
 3837     0x65 => {
 3838         Name => 'Face2Position',
 3839         Condition => '$$self{FacesDetected} >= 2',
 3840         %faceInfo,
 3841     },
 3842     0x6f => {
 3843         Name => 'Face3Position',
 3844         Condition => '$$self{FacesDetected} >= 3',
 3845         %faceInfo,
 3846     },
 3847     0x79 => {
 3848         Name => 'Face4Position',
 3849         Condition => '$$self{FacesDetected} >= 4',
 3850         %faceInfo,
 3851     },
 3852 );
 3853 
 3854 # Camera settings (ref PH) (decoded mainly from A200)
 3855 %Image::ExifTool::Sony::CameraSettings = (
 3856     %binaryDataAttrs,
 3857     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 3858     FORMAT => 'int16u',
 3859     PRIORITY => 0,
 3860     NOTES => 'Camera settings for the A200, A300, A350, A700, A850 and A900.',
 3861     0x00 => { #JR
 3862         Name => 'ExposureTime',
 3863         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 3864         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 3865         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 3866         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 3867     },
 3868     0x01 => { #JR
 3869         Name => 'FNumber',
 3870         ValueConv => '2 ** (($val/8 - 1) / 2)',
 3871         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 3872         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 3873         PrintConvInv => '$val',
 3874     },
 3875     0x02 => { #JR (requires external flash)
 3876         Name => 'HighSpeedSync',
 3877         PrintConv => {
 3878             0 => 'Off',
 3879             1 => 'On',
 3880         },
 3881     },
 3882     0x03 => { #JR
 3883         Name => 'ExposureCompensationSet',
 3884         ValueConv => '($val - 128) / 24',
 3885         ValueConvInv => 'int($val * 24 + 128.5)',
 3886         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 3887         PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
 3888     },
 3889     0x04 => { #7/JR
 3890         Name => 'DriveMode',
 3891         Mask => 0xff, # (not sure what upper byte is for)
 3892         PrintHex => 1,
 3893         PrintConv => {
 3894             0x01 => 'Single Frame',
 3895             0x02 => 'Continuous High', # A700/A900; not on A850
 3896             0x12 => 'Continuous Low', #JR
 3897             0x04 => 'Self-timer 10 sec',
 3898             0x05 => 'Self-timer 2 sec, Mirror Lock-up',
 3899             0x06 => 'Single-frame Bracketing',
 3900             0x07 => 'Continuous Bracketing', # (A200 val=0x1107)
 3901             0x18 => 'White Balance Bracketing Low', #JR
 3902             0x28 => 'White Balance Bracketing High', #JR
 3903             0x19 => 'D-Range Optimizer Bracketing Low', #JR
 3904             0x29 => 'D-Range Optimizer Bracketing High', #JR
 3905             0x0a => 'Remote Commander', #JR
 3906             0x0b => 'Mirror Lock-up', #JR (A850/A900; not on A700)
 3907         },
 3908     },
 3909     0x05 => { #JR
 3910         Name => 'WhiteBalanceSetting',
 3911         PrintConv => {
 3912             2 => 'Auto',
 3913             4 => 'Daylight',
 3914             5 => 'Fluorescent',
 3915             6 => 'Tungsten',
 3916             7 => 'Flash',
 3917             16 => 'Cloudy',
 3918             17 => 'Shade',
 3919             18 => 'Color Temperature/Color Filter',
 3920             32 => 'Custom 1',
 3921             33 => 'Custom 2',
 3922             34 => 'Custom 3',
 3923         },
 3924     },
 3925     0x06 => { #7 (A700) (ref JR: at least also valid for A200, ValueConv as for ColorCompensationFilterSet)
 3926         Name => 'WhiteBalanceFineTune',
 3927         ValueConv => '$val > 128 ? $val - 256 : $val',
 3928         ValueConvInv => '$val < 0 ? $val + 256 : $val',
 3929     },
 3930     0x07 => { #JR as set in WB "Color Temperature/Color Filter" and in White Balance Bracketing
 3931         Name => 'ColorTemperatureSet',
 3932         ValueConv => '$val * 100',
 3933         ValueConvInv => '$val / 100',
 3934         PrintConv => '"$val K"',
 3935         PrintConvInv => '$val =~ s/ ?K$//i; $val',
 3936     },
 3937     0x08 => { #JR as set in WB "Color Temperature/Color Filter"
 3938         Name => 'ColorCompensationFilterSet',
 3939         Notes => 'negative is green, positive is magenta',
 3940         ValueConv => '$val > 128 ? $val - 256 : $val',
 3941         ValueConvInv => '$val < 0 ? $val + 256 : $val',
 3942         PrintConv => '$val > 0 ? "+$val" : $val',
 3943         PrintConvInv => '$val',
 3944     },
 3945     0x0c => { #JR as set in WB "Custom" and in White Balance Bracketing
 3946         Name => 'ColorTemperatureCustom',
 3947         ValueConv => '$val * 100',
 3948         ValueConvInv => '$val / 100',
 3949         PrintConv => '"$val K"',
 3950         PrintConvInv => '$val =~ s/ ?K$//i; $val',
 3951     },
 3952     0x0d => { #JR as set in WB "Custom"
 3953         Name => 'ColorCompensationFilterCustom',
 3954         Notes => 'negative is green, positive is magenta',
 3955         ValueConv => '$val > 128 ? $val - 256 : $val',
 3956         ValueConvInv => '$val < 0 ? $val + 256 : $val',
 3957         PrintConv => '$val > 0 ? "+$val" : $val',
 3958         PrintConvInv => '$val',
 3959     },
 3960     0x0f => { #JR
 3961         Name => 'WhiteBalance',
 3962         PrintConv => {
 3963             2 => 'Auto',
 3964             4 => 'Daylight',
 3965             5 => 'Fluorescent',
 3966             6 => 'Tungsten',
 3967             7 => 'Flash',
 3968             12 => 'Color Temperature',
 3969             13 => 'Color Filter',
 3970             14 => 'Custom',
 3971             16 => 'Cloudy',
 3972             17 => 'Shade',
 3973         },
 3974     },
 3975     0x10 => { #7 (A700)
 3976         Name => 'FocusModeSetting',
 3977         PrintConv => {
 3978             0 => 'Manual',
 3979             1 => 'AF-S',
 3980             2 => 'AF-C',
 3981             3 => 'AF-A',
 3982             4 => 'DMF', #JR
 3983         },
 3984     },
 3985     0x11 => { #JD (A700)
 3986         Name => 'AFAreaMode',
 3987         PrintConv => {
 3988             0 => 'Wide',
 3989             1 => 'Local',
 3990             2 => 'Spot',
 3991         },
 3992     },
 3993     0x12 => { #7 (A700)
 3994         Name => 'AFPointSetting',
 3995         Format => 'int16u',
 3996         # The AF point as selected by the user in AFAreaMode=Local or Spot;
 3997         # Reported value remains at the last-set position in AFAreaModes=Wide.
 3998         # A200, A300, A350: 9-point centre-cross (ref JR)
 3999         # A700: 11-point centre-dual-cross (ref JR)
 4000         # A850, A900: 9-point centre-dual-cross with 10 assist-points (ref JR)
 4001         PrintConvColumns => 2,
 4002         PrintConv => {
 4003             1 => 'Center',
 4004             2 => 'Top',
 4005             3 => 'Upper-right',
 4006             4 => 'Right',
 4007             5 => 'Lower-right',
 4008             6 => 'Bottom',
 4009             7 => 'Lower-left',
 4010             8 => 'Left',
 4011             9 => 'Upper-left',
 4012             10 => 'Far Right', # (presumably A700 only)
 4013             11 => 'Far Left', # (presumably A700 only)
 4014         },
 4015     },
 4016     0x13 => { #JR
 4017         Name => 'FlashMode',
 4018         PrintConv => {
 4019             0 => 'Autoflash',
 4020             2 => 'Rear Sync',
 4021             3 => 'Wireless',
 4022             4 => 'Fill-flash',
 4023             5 => 'Flash Off',
 4024             6 => 'Slow Sync',
 4025         },
 4026     },
 4027     0x14 => { #JR
 4028         Name => 'FlashExposureCompSet',
 4029         Description => 'Flash Exposure Comp. Setting',
 4030         # (as pre-selected by the user, not zero if flash didn't fire)
 4031         ValueConv => '($val - 128) / 24', #PH
 4032         ValueConvInv => 'int($val * 24 + 128.5)',
 4033         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 4034         PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
 4035     },
 4036     0x15 => { #7
 4037         Name => 'MeteringMode',
 4038         PrintConv => {
 4039             1 => 'Multi-segment',
 4040             2 => 'Center-weighted average',
 4041             4 => 'Spot',
 4042         },
 4043     },
 4044     0x16 => {
 4045         Name => 'ISOSetting',
 4046         # 0 indicates 'Auto' (I think)
 4047         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 4048         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 4049         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 4050         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 4051     },
 4052     0x18 => { #7
 4053         Name => 'DynamicRangeOptimizerMode',
 4054         PrintConv => {
 4055             0 => 'Off',
 4056             1 => 'Standard',
 4057             2 => 'Advanced Auto',
 4058             3 => 'Advanced Level',
 4059         },
 4060     },
 4061     0x19 => { #7
 4062         Name => 'DynamicRangeOptimizerLevel',
 4063     },
 4064     0x1a => { # style actually used (combination of mode dial + creative style menu)
 4065         Name => 'CreativeStyle',
 4066         PrintConvColumns => 2,
 4067         PrintConv => {
 4068             1 => 'Standard',
 4069             2 => 'Vivid',
 4070             3 => 'Portrait',
 4071             4 => 'Landscape',
 4072             5 => 'Sunset',
 4073             6 => 'Night View/Portrait',
 4074             8 => 'B&W',
 4075             9 => 'Adobe RGB', # A700
 4076             11 => 'Neutral',
 4077             12 => 'Clear', #7
 4078             13 => 'Deep', #7
 4079             14 => 'Light', #7
 4080             15 => 'Autumn Leaves', #7
 4081             16 => 'Sepia', #7
 4082         },
 4083     },
 4084     0x1b => { #JR
 4085         Name => 'ColorSpace',
 4086         PrintConv => {
 4087             0 => 'sRGB',
 4088             1 => 'Adobe RGB',        # (A850, selected via Colorspace menu item)
 4089             5 => 'Adobe RGB (A700)', # (A700, selected via CreativeStyle menu)
 4090         },
 4091     },
 4092     0x1c => {
 4093         Name => 'Sharpness',
 4094         ValueConv => '$val - 10',
 4095         ValueConvInv => '$val + 10',
 4096         PrintConv => '$val > 0 ? "+$val" : $val',
 4097         PrintConvInv => '$val',
 4098     },
 4099     0x1d => {
 4100         Name => 'Contrast',
 4101         ValueConv => '$val - 10',
 4102         ValueConvInv => '$val + 10',
 4103         PrintConv => '$val > 0 ? "+$val" : $val',
 4104         PrintConvInv => '$val',
 4105     },
 4106     0x1e => {
 4107         Name => 'Saturation',
 4108         ValueConv => '$val - 10',
 4109         ValueConvInv => '$val + 10',
 4110         PrintConv => '$val > 0 ? "+$val" : $val',
 4111         PrintConvInv => '$val',
 4112     },
 4113     0x1f => { #7
 4114         Name => 'ZoneMatchingValue',
 4115         ValueConv => '$val - 10',
 4116         ValueConvInv => '$val + 10',
 4117         PrintConv => '$val > 0 ? "+$val" : $val',
 4118         PrintConvInv => '$val',
 4119     },
 4120     0x22 => { #7
 4121         Name => 'Brightness',
 4122         ValueConv => '$val - 10',
 4123         ValueConvInv => '$val + 10',
 4124         PrintConv => '$val > 0 ? "+$val" : $val',
 4125         PrintConvInv => '$val',
 4126     },
 4127     0x23 => {
 4128         Name => 'FlashControl',
 4129         PrintConv => {
 4130             0 => 'ADI',
 4131             1 => 'Pre-flash TTL',
 4132             2 => 'Manual',
 4133         },
 4134     },
 4135     0x28 => { #7
 4136         Name => 'PrioritySetupShutterRelease',
 4137         PrintConv => {
 4138             0 => 'AF',
 4139             1 => 'Release',
 4140         },
 4141     },
 4142     0x29 => { #7
 4143         Name => 'AFIlluminator',
 4144         PrintConv => {
 4145             0 => 'Auto',
 4146             1 => 'Off',
 4147         },
 4148     },
 4149     0x2a => { #7
 4150         Name => 'AFWithShutter',
 4151         PrintConv => { 0 => 'On', 1 => 'Off' },
 4152     },
 4153     0x2b => { #7
 4154         Name => 'LongExposureNoiseReduction',
 4155         PrintConv => { 0 => 'Off', 1 => 'On' },
 4156     },
 4157     0x2c => { #7
 4158         Name => 'HighISONoiseReduction',
 4159         PrintConv => {
 4160             0 => 'Normal',
 4161             1 => 'Low',
 4162             2 => 'High',
 4163             3 => 'Off',
 4164         },
 4165     },
 4166     0x2d => { #7
 4167         Name => 'ImageStyle',
 4168         PrintConvColumns => 2,
 4169         PrintConv => {
 4170             1 => 'Standard',
 4171             2 => 'Vivid',
 4172             3 => 'Portrait', #PH
 4173             4 => 'Landscape', #PH
 4174             5 => 'Sunset', #PH
 4175             7 => 'Night View/Portrait', #PH (A200/A350 when CreativeStyle was 6!)
 4176             8 => 'B&W', #PH (guess)
 4177             9 => 'Adobe RGB',
 4178             11 => 'Neutral',
 4179             129 => 'StyleBox1',
 4180             130 => 'StyleBox2',
 4181             131 => 'StyleBox3',
 4182             132 => 'StyleBox4', #JR (A850)
 4183             133 => 'StyleBox5', #JR (A850)
 4184             134 => 'StyleBox6', #JR (A850)
 4185         },
 4186     },
 4187     0x2e => { #JR (may not apply to A200/A300/A350 -- they don't have the AF/MF button)
 4188         Name => 'FocusModeSwitch',
 4189         PrintConv => {
 4190             0 => 'AF',
 4191             1 => 'Manual',
 4192         },
 4193     },
 4194     0x2f => { #JR
 4195         Name => 'ShutterSpeedSetting',
 4196         Notes => 'used in M, S and Program Shift S modes',
 4197         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 4198         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 4199         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 4200         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 4201     },
 4202     0x30 => { #JR
 4203         Name => 'ApertureSetting',
 4204         Notes => 'used in M, A and Program Shift A modes',
 4205         ValueConv => '2 ** (($val/8 - 1) / 2)',
 4206         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 4207         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 4208         PrintConvInv => '$val',
 4209     },
 4210     0x3c => {
 4211         Name => 'ExposureProgram',
 4212         SeparateTable => 'ExposureProgram',
 4213         PrintConv => \%sonyExposureProgram,
 4214     },
 4215     0x3d => {
 4216         Name => 'ImageStabilizationSetting',
 4217         PrintConv => { 0 => 'Off', 1 => 'On' },
 4218     },
 4219     0x3e => { #JR
 4220         Name => 'FlashAction',
 4221         PrintConv => {
 4222             0 => 'Did not fire',
 4223             1 => 'Fired',
 4224             2 => 'External Flash, Did not fire',
 4225             3 => 'External Flash, Fired',
 4226         },
 4227     },
 4228     0x3f => { # (verified for A330/A380)
 4229         Name => 'Rotation',
 4230         PrintConv => {
 4231             0 => 'Horizontal (normal)',
 4232             1 => 'Rotate 90 CW', #(NC)
 4233             2 => 'Rotate 270 CW',
 4234         },
 4235     },
 4236     0x40 => { #JR
 4237         Name => 'AELock',
 4238         PrintConv => {
 4239             1 => 'Off',
 4240             2 => 'On',
 4241         },
 4242     },
 4243     0x4c => { #JR
 4244         Name => 'FlashAction2',
 4245         PrintConv => {
 4246             1 => 'Fired, Autoflash',
 4247             2 => 'Fired, Fill-flash',
 4248             3 => 'Fired, Rear Sync',
 4249             4 => 'Fired, Wireless',
 4250             5 => 'Did not fire',
 4251             6 => 'Fired, Slow Sync',
 4252             17 => 'Fired, Autoflash, Red-eye reduction',
 4253             18 => 'Fired, Fill-flash, Red-eye reduction',
 4254             34 => 'Fired, Fill-flash, HSS',
 4255         },
 4256     },
 4257     0x4d => { #JR
 4258         Name => 'FocusMode', # (focus mode actually used)
 4259         PrintConv => {
 4260             0 => 'Manual',
 4261             1 => 'AF-S',
 4262             2 => 'AF-C',
 4263             3 => 'AF-A',
 4264             4 => 'DMF', #JR
 4265         },
 4266     },
 4267     0x50 => { #JR
 4268         Name => 'BatteryState',
 4269         PrintConv => {
 4270             2 => 'Empty',      # 0%
 4271             3 => 'Very Low',   # 1 - 20%
 4272             4 => 'Low',        # 21 - 50%
 4273             5 => 'Sufficient', # 51 - 80%
 4274             6 => 'Full',       # > 80%
 4275         },
 4276     },
 4277     0x51 => { #JR
 4278         Name => 'BatteryLevel',
 4279         PrintConv => '"$val%"',
 4280         PrintConvInv => '$val=~s/\s*\%//; $val',
 4281     },
 4282     0x53 => { #JR
 4283         Name => 'FocusStatus',
 4284         PrintConv => {
 4285             0 => 'Not confirmed',
 4286             4 => 'Not confirmed, Tracking',
 4287             BITMASK => {
 4288                 0 => 'Confirmed',
 4289                 1 => 'Failed',
 4290                 2 => 'Tracking',
 4291             },
 4292         },
 4293     },
 4294     0x54 => {
 4295         Name => 'SonyImageSize',
 4296         PrintConv => {
 4297             1 => 'Large',
 4298             2 => 'Medium',
 4299             3 => 'Small',
 4300         },
 4301     },
 4302     0x55 => { #7
 4303         Name => 'AspectRatio',
 4304         PrintConv => {
 4305             1 => '3:2',
 4306             2 => '16:9',
 4307         },
 4308     },
 4309     0x56 => { #PH/7
 4310         Name => 'Quality',
 4311         PrintConv => {
 4312             0 => 'RAW',
 4313             2 => 'CRAW',
 4314             34 => 'RAW + JPEG',
 4315             35 => 'CRAW + JPEG',
 4316             16 => 'Extra Fine',
 4317             32 => 'Fine',
 4318             48 => 'Standard',
 4319         },
 4320     },
 4321     0x58 => { #7
 4322         Name => 'ExposureLevelIncrements',
 4323         PrintConv => {
 4324             33 => '1/3 EV',
 4325             50 => '1/2 EV',
 4326         },
 4327     },
 4328     0x6a => { #JR
 4329         Name => 'RedEyeReduction',
 4330         PrintConv => {
 4331             0 => 'Off',
 4332             1 => 'On',
 4333         },
 4334     },
 4335     0x9a => { #JR
 4336         Name => 'FolderNumber',
 4337         Mask => 0x03ff, # (not sure what the upper 6 bits are for)
 4338         PrintConv => 'sprintf("%.3d",$val)',
 4339         PrintConvInv => '$val',
 4340     },
 4341     0x9b => { #JR
 4342         Name => 'ImageNumber',
 4343         Mask => 0x3fff, # (not sure what the upper 2 bits are for)
 4344         PrintConv => 'sprintf("%.4d",$val)',
 4345         PrintConvInv => '$val',
 4346     },
 4347 );
 4348 
 4349 # Camera settings (ref PH) (A230, A290, A330, A380 and A390)
 4350 %Image::ExifTool::Sony::CameraSettings2 = (
 4351     %binaryDataAttrs,
 4352     GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
 4353     FORMAT => 'int16u',
 4354     PRIORITY => 0,
 4355     NOTES => 'Camera settings for the A230, A290, A330, A380 and A390.',
 4356 ### 0x00-0x03: same TagID as CameraSettings
 4357     0x00 => { #JR
 4358         Name => 'ExposureTime',
 4359         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 4360         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 4361         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 4362         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 4363     },
 4364     0x01 => { #JR
 4365         Name => 'FNumber',
 4366         ValueConv => '2 ** (($val/8 - 1) / 2)',
 4367         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 4368         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 4369         PrintConvInv => '$val',
 4370     },
 4371     0x02 => { #JR (requires external flash)
 4372         Name => 'HighSpeedSync',
 4373         PrintConv => {
 4374             0 => 'Off',
 4375             1 => 'On',
 4376         },
 4377     },
 4378     0x03 => { #JR
 4379         Name => 'ExposureCompensationSet',
 4380         ValueConv => '($val - 128) / 24',
 4381         ValueConvInv => 'int($val * 24 + 128.5)',
 4382         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 4383         PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
 4384     },
 4385 ### 0x04-0x11: subtract 1 from CameraSettings TagID
 4386     0x04 => { #JR
 4387         Name => 'WhiteBalanceSetting',
 4388         PrintConv => {
 4389             2 => 'Auto',
 4390             4 => 'Daylight',
 4391             5 => 'Fluorescent',
 4392             6 => 'Tungsten',
 4393             7 => 'Flash',
 4394             16 => 'Cloudy',
 4395             17 => 'Shade',
 4396             18 => 'Color Temperature/Color Filter',
 4397             32 => 'Custom 1',
 4398             33 => 'Custom 2',
 4399             34 => 'Custom 3',
 4400         },
 4401     },
 4402     0x05 => { #JR
 4403         Name => 'WhiteBalanceFineTune',
 4404         ValueConv => '$val > 128 ? $val - 256 : $val',
 4405         ValueConvInv => '$val < 0 ? $val + 256 : $val',
 4406     },
 4407     0x06 => { #JR as set in WB "Color Temperature/Color Filter" and in White Balance Bracketing
 4408         Name => 'ColorTemperatureSet',
 4409         ValueConv => '$val * 100',
 4410         ValueConvInv => '$val / 100',
 4411         PrintConv => '"$val K"',
 4412         PrintConvInv => '$val =~ s/ ?K$//i; $val',
 4413     },
 4414     0x07 => { #JR as set in WB "Color Temperature/Color Filter"
 4415         Name => 'ColorCompensationFilterSet',
 4416         Notes => 'negative is green, positive is magenta',
 4417         ValueConv => '$val > 128 ? $val - 256 : $val',
 4418         ValueConvInv => '$val < 0 ? $val + 256 : $val',
 4419         PrintConv => '$val > 0 ? "+$val" : $val',
 4420         PrintConvInv => '$val',
 4421     },
 4422     0x08 => { #JR
 4423         Name => 'CustomWB_RGBLevels',
 4424         Format => 'int16u[3]',
 4425     },
 4426     0x0b => { #JR as set in WB "Custom" and in White Balance Bracketing
 4427         Name => 'ColorTemperatureCustom',
 4428         ValueConv => '$val * 100',
 4429         ValueConvInv => '$val / 100',
 4430         PrintConv => '"$val K"',
 4431         PrintConvInv => '$val =~ s/ ?K$//i; $val',
 4432     },
 4433     0x0c => { #JR as set in WB "Custom"
 4434         Name => 'ColorCompensationFilterCustom',
 4435         Notes => 'negative is green, positive is magenta',
 4436         ValueConv => '$val > 128 ? $val - 256 : $val',
 4437         ValueConvInv => '$val < 0 ? $val + 256 : $val',
 4438         PrintConv => '$val > 0 ? "+$val" : $val',
 4439         PrintConvInv => '$val',
 4440     },
 4441     0x0e => { #JR
 4442         Name => 'WhiteBalance',
 4443         PrintConv => {
 4444             2 => 'Auto',
 4445             4 => 'Daylight',
 4446             5 => 'Fluorescent',
 4447             6 => 'Tungsten',
 4448             7 => 'Flash',
 4449             12 => 'Color Temperature',
 4450             13 => 'Color Filter',
 4451             14 => 'Custom',
 4452             16 => 'Cloudy',
 4453             17 => 'Shade',
 4454         },
 4455     },
 4456     0x0f => { #JR/PH (educated guess)
 4457         Name => 'FocusModeSetting',
 4458         PrintConv => {
 4459             0 => 'Manual',
 4460             1 => 'AF-S',
 4461             2 => 'AF-C',
 4462             3 => 'AF-A',
 4463             # seen 5 for A380 (FocusMode was Manual and FocusStatus was Confirmed)
 4464         },
 4465     },
 4466     0x10 => { #JR/PH (educated guess)
 4467         Name => 'AFAreaMode',
 4468         PrintConv => {
 4469             0 => 'Wide',
 4470             1 => 'Local',
 4471             2 => 'Spot',
 4472         },
 4473     },
 4474     0x11 => { #JR/PH (educated guess)
 4475         Name => 'AFPointSetting',
 4476         Format => 'int16u',
 4477         # The AF point as selected by the user in AFAreaMode=Local or Spot;
 4478         # Reported value remains at the last-set position in AFAreaModes=Wide.
 4479         # (all of these cameras have a 9-point centre-cross AF system, ref JR)
 4480         PrintConvColumns => 2,
 4481         PrintConv => {
 4482             1 => 'Center',
 4483             2 => 'Top',
 4484             3 => 'Upper-right',
 4485             4 => 'Right',
 4486             5 => 'Lower-right',
 4487             6 => 'Bottom',
 4488             7 => 'Lower-left',
 4489             8 => 'Left',
 4490             9 => 'Upper-left',
 4491         },
 4492     },
 4493 ### 0x12-0x18: subtract 2 from CameraSettings TagID
 4494     0x12 => { #JR
 4495         Name => 'FlashExposureCompSet',
 4496         Description => 'Flash Exposure Comp. Setting',
 4497         # (as pre-selected by the user, not zero if flash didn't fire)
 4498         ValueConv => '($val - 128) / 24', #PH
 4499         ValueConvInv => 'int($val * 24 + 128.5)',
 4500         PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
 4501         PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
 4502     },
 4503     0x13 => {
 4504         Name => 'MeteringMode',
 4505         PrintConv => {
 4506             1 => 'Multi-segment',
 4507             2 => 'Center-weighted average',
 4508             4 => 'Spot',
 4509         },
 4510     },
 4511     0x14 => { # A330/A380
 4512         Name => 'ISOSetting',
 4513         # 0 indicates 'Auto' (?)
 4514         ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
 4515         ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
 4516         PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
 4517         PrintConvInv => '$val =~ /auto/i ? 0 : $val',
 4518     },
 4519     0x16 => {
 4520         Name => 'DynamicRangeOptimizerMode',
 4521         PrintConv => {
 4522             0 => 'Off',
 4523             1 => 'Standard',
 4524             2 => 'Advanced Auto',
 4525             3 => 'Advanced Level',
 4526         },
 4527     },
 4528     0x17 => 'DynamicRangeOptimizerLevel',
 4529     0x18 => { # A380
 4530         Name => 'CreativeStyle',
 4531         PrintConvColumns => 2,
 4532         PrintConv => {
 4533             1 => 'Standard',
 4534             2 => 'Vivid',
 4535             3 => 'Portrait',
 4536             4 => 'Landscape',
 4537             5 => 'Sunset',
 4538             6 => 'Night View/Portrait',
 4539             8 => 'B&W',
 4540             # (these models don't have Neutral - PH)
 4541         },
 4542     },
 4543 ### 0x19-0x1b: subtract 3 from CameraSettings TagID
 4544     0x19 => {
 4545         Name => 'Sharpness',
 4546         ValueConv => '$val - 10',
 4547         ValueConvInv => '$val + 10',
 4548         PrintConv => '$val > 0 ? "+$val" : $val',
 4549         PrintConvInv => '$val',
 4550     },
 4551     0x1a => {
 4552         Name => 'Contrast',
 4553         ValueConv => '$val - 10',
 4554         ValueConvInv => '$val + 10',
 4555         PrintConv => '$val > 0 ? "+$val" : $val',
 4556         PrintConvInv => '$val',
 4557     },
 4558     0x1b => {
 4559         Name => 'Saturation',
 4560         ValueConv => '$val - 10',
 4561         ValueConvInv => '$val + 10',
 4562         PrintConv => '$val > 0 ? "+$val" : $val',
 4563         PrintConvInv => '$val',
 4564     },
 4565 ### 0x1c-0x24: subtract 4 from CameraSettings TagID (not sure about 0x1c)
 4566     0x1f => { #PH (educated guess)
 4567         Name => 'FlashControl',
 4568         PrintConv => {
 4569             0 => 'ADI',
 4570             1 => 'Pre-flash TTL',
 4571             2 => 'Manual',
 4572         },
 4573     },
 4574 ### 0x25-0x27: subtract 6 from CameraSettings TagID
 4575     0x25 => { #PH
 4576         Name => 'LongExposureNoiseReduction',
 4577         PrintConv => { 0 => 'Off', 1 => 'On' },
 4578     },
 4579     0x26 => { #PH
 4580         Name => 'HighISONoiseReduction',
 4581         # (Note: the order is different from that in CameraSettings)
 4582         PrintConv => {
 4583             0 => 'Off',
 4584             1 => 'Low',
 4585             2 => 'Normal',
 4586             3 => 'High',
 4587         },
 4588     },
 4589     0x27 => { #PH
 4590         Name => 'ImageStyle',
 4591         PrintConvColumns => 2,
 4592         PrintConv => {
 4593             1 => 'Standard',
 4594             2 => 'Vivid',
 4595             3 => 'Portrait', #PH
 4596             4 => 'Landscape', #PH
 4597             5 => 'Sunset', #PH
 4598             7 => 'Night View/Portrait', #PH (A200 when CreativeStyle was 6!)
 4599             8 => 'B&W', #PH (A380)
 4600             # (these models don't have Neutral - PH)
 4601         },
 4602     },
 4603 ### 0x28-0x3b: subtract 7 from CameraSettings TagID
 4604     0x28 => { #PH
 4605         Name => 'ShutterSpeedSetting',
 4606         Notes => 'used in M, S and Program Shift S modes',
 4607         ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
 4608         ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
 4609         PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
 4610         PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
 4611     },
 4612     0x29 => { #PH
 4613         Name => 'ApertureSetting',
 4614         Notes => 'used in M, A and Program Shift A modes',
 4615         ValueConv => '2 ** (($val/8 - 1) / 2)',
 4616         ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
 4617         PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
 4618         PrintConvInv => '$val',
 4619     },
 4620 ### 0x3c-0x59: same TagID as CameraSettings
 4621     0x3c => {
 4622         Name => 'ExposureProgram',
 4623         SeparateTable => 'ExposureProgram',
 4624         PrintConv => \%sonyExposureProgram,
 4625     },
 4626     0x3d => { # (copied from CameraSettings, ref JR)
 4627         Name => 'ImageStabilizationSetting',
 4628         PrintConv => { 0 => 'Off', 1 => 'On' },
 4629     },
 4630     0x3e => { #JR
 4631         Name => 'FlashAction',
 4632         PrintConv => {
 4633             0 => 'Did not fire',
 4634             1 => 'Fired',
 4635             2 => 'External Flash, Did not fire',
 4636             3 => 'External Flash, Fired',
 4637         },
 4638     },
 4639     0x3f => { # (verified for A330/A380)
 4640         Name => 'Rotation',
 4641         PrintConv => {
 4642             0 => 'Horizontal (normal)',
 4643             1 => 'Rotate 90 CW', #(NC)
 4644             2 => 'Rotate 270 CW',
 4645         },
 4646     },
 4647     0x40 => { #JR
 4648         Name => 'AELock',
 4649         PrintConv => {
 4650             1 => 'Off',
 4651             2 => 'On',
 4652         },
 4653     },
 4654     0x4c => { #JR
 4655         Name => 'FlashAction2',
 4656         PrintConv => {
 4657             1 => 'Fired, Autoflash',
 4658             2 => 'Fired, Fill-flash',
 4659             3 => 'Fired, Rear Sync',
 4660             4 => 'Fired, Wireless',
 4661             5 => 'Did not fire',
 4662             6 => 'Fired, Slow Sync',
 4663             17 => 'Fired, Autoflash, Red-eye reduction',
 4664             18 => 'Fired, Fill-flash, Red-eye reduction',
 4665             34 => 'Fired, Fill-flash, HSS',
 4666         },
 4667     },
 4668     0x4d => { #JR
 4669         Name => 'FocusMode', # (focus mode actually used)
 4670         PrintConv => {
 4671             0 => 'Manual',
 4672             1 => 'AF-S',
 4673             2 => 'AF-C',
 4674             3 => 'AF-A',
 4675         },
 4676     },
 4677     0x53 => { #JR (copied from CameraSettings, but all bits may not be applicable for these models)
 4678         Name => 'FocusStatus',
 4679         PrintConv => {
 4680             0 => 'Not confirmed',
 4681             4 => 'Not confirmed, Tracking',
 4682             BITMASK => {
 4683                 0 => 'Confirmed',
 4684                 1 => 'Failed',
 4685                 2 => 'Tracking',
 4686             },
 4687         },
 4688     },
 4689     0x54 => {
 4690         Name => 'SonyImageSize',
 4691         PrintConv => {
 4692             1 => 'Large',
 4693             2 => 'Medium',
 4694             3 => 'Small',
 4695         },
 4696     },
 4697     0x55 => { # (copied from CameraSettings, ref JR)
 4698         Name => 'AspectRatio',
 4699         PrintConv => {
 4700             1 => '3:2',
 4701             2 => '16:9',
 4702         },
 4703     },
 4704     0x56 => { # (copied from CameraSettings, ref JR)
 4705         Name => 'Quality',
 4706         PrintConv => {
 4707             0 => 'RAW',
 4708             2 => 'CRAW',
 4709             34 => 'RAW + JPEG',
 4710             35 => 'CRAW + JPEG',
 4711             16 => 'Extra Fine',
 4712             32 => 'Fine',
 4713             48 => 'Standard',
 4714         },
 4715     },
 4716     0x58 => { # (copied from CameraSettings, ref JR)
 4717         Name => 'ExposureLevelIncrements',
 4718         PrintConv => {
 4719             33 => '1/3 EV',
 4720             50 => '1/2 EV',
 4721         },
 4722     },
 4723 ### 0x5a onwards: subtract 1 from CameraSettings TagID
 4724     # (0x69 not confirmed)
 4725     #0x69 => { #JR
 4726     #    Name => 'RedEyeReduction',
 4727     #    PrintConv => {
 4728     #        0 => 'Off',
 4729     #        1 => 'On',
 4730     #    },
 4731     #},
 4732     0x7e => { #JR
 4733         Name => 'DriveMode',
 4734         Mask => 0xff, # (not sure what upper byte is for)
 4735         PrintConv => { # (values confirmed for specified models - PH)
 4736             1 => 'Single Frame', # (A230,A330,A380)
 4737             2 => 'Continuous High', #PH (A230,A330)
 4738             4 => 'Self-timer 10 sec', # (A230)
 4739             5 => 'Self-timer 2 sec, Mirror Lock-up', # (A230,A290,A330,A380,390)
 4740             7 => 'Continuous Bracketing', # (A230 val=0x1107, A330 val=0x1307 [0.7 EV])
 4741             10 => 'Remote Commander', # (A230)
 4742             11 => 'Continuous Self-timer', # (A230 val=0x800b [5 shots], A330 v