exiftool-vendored.pl 13.31.0 → 13.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/Changes CHANGED
@@ -7,6 +7,22 @@ RSS feed: https://exiftool.org/rss.xml
7
7
  Note: The most recent production release is Version 13.30. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ July 2, 2025 - Version 13.32
11
+
12
+ - Added a new Olympus CameraType (thanks Herb and Albert Shan)
13
+ - Added a new Sony LensType (github #335)
14
+ - Added a new Nikon CropHiSpeed value (thanks Albert Shan)
15
+ - Added a warning if a tag value couldn't be packed for writing to a binary
16
+ data structure
17
+ - Decode more Ricoh/Pentax AF tags for some models (thanks Karsten Gieselmann)
18
+ - Decode Canon HDR-PQ tag (github #336)
19
+ - Extract a couple more EXIF tags
20
+ - Patched to allow a dot (.) in the name of a structure element when writing
21
+ - Fixed "uninitialized value" bug when using -w with the -stay_open feature
22
+ - Fixed bug in -file option when tag names were used to specify the name of
23
+ the alternate file (the tags were taken only from the first input file
24
+ unless a file name formatting code was also specified)
25
+
10
26
  June 19, 2025 - Version 13.31
11
27
 
12
28
  - Added a new CanonModelID and RFLensType (thanks Norbert Wasser)
package/bin/META.json CHANGED
@@ -50,6 +50,6 @@
50
50
  }
51
51
  },
52
52
  "release_status" : "stable",
53
- "version" : "13.31",
53
+ "version" : "13.32",
54
54
  "x_serialization_backend" : "JSON::PP version 4.06"
55
55
  }
package/bin/META.yml CHANGED
@@ -31,5 +31,5 @@ recommends:
31
31
  Time::HiRes: '0'
32
32
  requires:
33
33
  perl: '5.004'
34
- version: '13.31'
34
+ version: '13.32'
35
35
  x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
package/bin/README CHANGED
@@ -109,8 +109,8 @@ your home directory, then you would type the following commands in a
109
109
  terminal window to extract and run ExifTool:
110
110
 
111
111
  cd ~/Desktop
112
- gzip -dc Image-ExifTool-13.31.tar.gz | tar -xf -
113
- cd Image-ExifTool-13.31
112
+ gzip -dc Image-ExifTool-13.32.tar.gz | tar -xf -
113
+ cd Image-ExifTool-13.32
114
114
  ./exiftool t/images/ExifTool.jpg
115
115
 
116
116
  Note: These commands extract meta information from one of the test images.
package/bin/exiftool CHANGED
@@ -11,7 +11,7 @@ use strict;
11
11
  use warnings;
12
12
  require 5.004;
13
13
 
14
- my $version = '13.31';
14
+ my $version = '13.32';
15
15
 
16
16
  $^W = 1; # enable global warnings
17
17
 
@@ -101,9 +101,9 @@ my @csvFiles; # list of files when reading with CSV option (in ExifTool Ch
101
101
  my @csvTags; # order of tags for first file with CSV option (lower case)
102
102
  my @delFiles; # list of files to delete
103
103
  my @dynamicFiles; # list of -tagsFromFile files with dynamic names and -TAG<=FMT pairs
104
+ my (@echo3, @echo4);# stdout and stderr echo after processing is complete
104
105
  my @efile; # files for writing list of error/fail/same file names
105
106
  my @exclude; # list of excluded tags
106
- my (@echo3, @echo4);# stdout and stderr echo after processing is complete
107
107
  my @files; # list of files and directories to scan
108
108
  my @moreArgs; # more arguments to process after -stay_open -@
109
109
  my @newValues; # list of new tag values to set
@@ -118,7 +118,6 @@ my %csvTags; # lookup for all found tags with CSV option (lower case keys
118
118
  my %database; # lookup for database information based on file name (in ExifTool Charset)
119
119
  my %filterExt; # lookup for filtered extensions
120
120
  my %ignore; # directory names to ignore
121
- my $ignoreHidden; # flag to ignore hidden files
122
121
  my %outComma; # flag that output text file needs a comma
123
122
  my %outTrailer; # trailer for output text file
124
123
  my %preserveTime; # preserved timestamps for files
@@ -130,6 +129,7 @@ my %usedFileName; # lookup for file names we already used in TestName feature
130
129
  my %utf8FileName; # lookup for file names that are UTF-8 encoded
131
130
  my %warnedOnce; # lookup for once-only warnings
132
131
  my %wext; # -W extensions to write
132
+ my %wroteHEAD; # list of output txt files to which we wrote HEAD
133
133
  my $allGroup; # show group name for all tags
134
134
  my $altEnc; # alternate character encoding if not UTF-8
135
135
  my $argFormat; # use exiftool argument-format output
@@ -175,6 +175,7 @@ my $forcePrint; # string to use for missing tag values (undef to not print t
175
175
  my $geoOnly; # flag to extract Geolocation tags only
176
176
  my $helped; # flag to avoid printing help if no tags specified
177
177
  my $html; # flag for html-formatted output (2=html dump)
178
+ my $ignoreHidden; # flag to ignore hidden files
178
179
  my $interrupted; # flag set if CTRL-C is pressed during a critical process
179
180
  my $isBinary; # true if value is a SCALAR ref
180
181
  my $isWriting; # flag set if we are writing tags
@@ -227,7 +228,6 @@ my $validFile; # flag indicating we processed a valid file
227
228
  my $verbose; # verbose setting
228
229
  my $vout; # verbose output file reference (\*STDOUT or \*STDERR by default)
229
230
  my $windowTitle; # title for console window
230
- my %wroteHEAD; # list of output txt files to which we wrote HEAD
231
231
  my $xml; # flag for XML-formatted output
232
232
 
233
233
  # flag to keep the input -@ argfile open:
@@ -451,8 +451,10 @@ undef @efile;
451
451
  undef @exclude;
452
452
  undef @files;
453
453
  undef @newValues;
454
+ undef @requestTags;
454
455
  undef @srcFmt;
455
456
  undef @tags;
457
+ undef %altFile;
456
458
  undef %appended;
457
459
  undef %countLink;
458
460
  undef %created;
@@ -472,6 +474,7 @@ undef %usedFileName;
472
474
  undef %utf8FileName;
473
475
  undef %warnedOnce;
474
476
  undef %wext;
477
+ undef %wroteHEAD;
475
478
  undef $allGroup;
476
479
  undef $altEnc;
477
480
  undef $argFormat;
@@ -488,8 +491,8 @@ undef $doSetFileName;
488
491
  undef $doUnzip;
489
492
  undef $end;
490
493
  undef $endDir;
491
- undef $escapeHTML;
492
494
  undef $escapeC;
495
+ undef $escapeHTML;
493
496
  undef $evalWarning;
494
497
  undef $executeID;
495
498
  undef $failCondition;
@@ -500,18 +503,22 @@ undef $fixLen;
500
503
  undef $forcePrint;
501
504
  undef $geoOnly;
502
505
  undef $ignoreHidden;
506
+ undef $isBinary;
503
507
  undef $joinLists;
504
508
  undef $langOpt;
509
+ undef $listDir;
505
510
  undef $listItem;
506
511
  undef $multiFile;
507
512
  undef $noBinary;
508
513
  undef $outOpt;
514
+ undef $plot;
509
515
  undef $preserveTime;
510
516
  undef $progress;
511
517
  undef $progressCount;
512
518
  undef $progressIncr;
513
519
  undef $progressMax;
514
520
  undef $progressNext;
521
+ undef $rafStdin;
515
522
  undef $recurse;
516
523
  undef $scanWritable;
517
524
  undef $sectHeader;
@@ -521,6 +528,7 @@ undef $showTagID;
521
528
  undef $structOpt;
522
529
  undef $tagOut;
523
530
  undef $textOut;
531
+ undef $textOut2;
524
532
  undef $textOverwrite;
525
533
  undef $tmpFile;
526
534
  undef $tmpText;
@@ -6054,7 +6062,7 @@ with this command:
6054
6062
 
6055
6063
  produces output like this:
6056
6064
 
6057
- -- Generated by ExifTool 13.31 --
6065
+ -- Generated by ExifTool 13.32 --
6058
6066
  File: a.jpg - 2003:10:31 15:44:19
6059
6067
  (f/5.6, 1/60s, ISO 100)
6060
6068
  File: b.jpg - 2006:05:23 11:57:38
@@ -7298,6 +7306,8 @@ used in file names.)
7298
7306
 
7299
7307
  =head4 Helper functions
7300
7308
 
7309
+ Note that function names are case sensitive.
7310
+
7301
7311
  C<DateFmt>
7302
7312
 
7303
7313
  Simplifies reformatting of individual date/time values. This function acts
@@ -7335,8 +7345,6 @@ rewritten unnecessarily:
7335
7345
 
7336
7346
  exiftool -sep '##' '-keywords<${keywords;NoDups(1)}' a.jpg
7337
7347
 
7338
- Note that function names are case sensitive.
7339
-
7340
7348
  ExifTool 12.64 adds an API NoDups option which makes the NoDups helper
7341
7349
  function largely redundant, with all the functionality except the ability to
7342
7350
  avoid rewriting the file if there are no duplicates, but with the advantage
@@ -271,11 +271,11 @@ tags remain.
271
271
 
272
272
  The table below lists all EXIF tags. Also listed are TIFF, DNG, HDP and
273
273
  other tags which are not part of the EXIF specification, but may co-exist
274
- with EXIF tags in some images. Tags which are part of the EXIF 2.32
274
+ with EXIF tags in some images. Tags which are part of the EXIF 3.0
275
275
  specification have an underlined B<Tag Name> in the HTML version of this
276
276
  documentation. See
277
- L<https://web.archive.org/web/20190624045241if_/http://www.cipa.jp:80/std/documents/e/DC-008-Translation-2019-E.pdf>
278
- for the official EXIF 2.32 specification.
277
+ L<https://www.cipa.jp/std/documents/download_e.html?CIPA_DC-008-2024-E>
278
+ for the official EXIF 3.0 specification.
279
279
  },
280
280
  GPS => q{
281
281
  These GPS tags are part of the EXIF standard, and are stored in a separate
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
88
88
  sub ProcessExifInfo($$$);
89
89
  sub SwapWords($);
90
90
 
91
- $VERSION = '4.92';
91
+ $VERSION = '4.93';
92
92
 
93
93
  # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
94
94
  # (or is it? Ref 32 shows 5 non-USM L-type lenses)
@@ -2628,6 +2628,10 @@ my %offOn = ( 0 => 'Off', 1 => 'On' );
2628
2628
  0x7fff => 'n/a',
2629
2629
  },
2630
2630
  },
2631
+ 52 => { #github336
2632
+ Name => 'HDR-PQ',
2633
+ PrintConv => { %offOn, -1 => 'n/a' },
2634
+ },
2631
2635
  );
2632
2636
 
2633
2637
  # focal length information (MakerNotes tag 0x02)
@@ -57,7 +57,7 @@ use vars qw($VERSION $AUTOLOAD @formatSize @formatName %formatNumber %intFormat
57
57
  use Image::ExifTool qw(:DataAccess :Utils);
58
58
  use Image::ExifTool::MakerNotes;
59
59
 
60
- $VERSION = '4.58';
60
+ $VERSION = '4.59';
61
61
 
62
62
  sub ProcessExif($$$);
63
63
  sub WriteExif($$$);
@@ -2029,7 +2029,7 @@ my %opcodeInfo = (
2029
2029
  OffsetPair => -1,
2030
2030
  },
2031
2031
  0x8782 => 'T88Options', #20
2032
- 0x87ac => 'ImageLayer',
2032
+ 0x87ac => 'ImageLayer', # Defined in the Mixed Raster Content part of RFC 2301
2033
2033
  0x87af => { #30
2034
2034
  Name => 'GeoTiffDirectory',
2035
2035
  Format => 'undef',
@@ -4209,6 +4209,8 @@ my %opcodeInfo = (
4209
4209
  },
4210
4210
  },
4211
4211
  # 0xc7d6 - int8u: 1 (SubIFD1 of Nikon Z6/Z7 NEF)
4212
+ 0xc7d7 => { Name => 'ZIFMetadata', Binary => 1 },
4213
+ 0xc7d8 => { Name => 'ZIFAnnotations', Binary => 1 },
4212
4214
  0xc7e9 => { # DNG 1.5
4213
4215
  Name => 'DepthFormat',
4214
4216
  Writable => 'int16u',
@@ -65,7 +65,7 @@ use Image::ExifTool::Exif;
65
65
  use Image::ExifTool::GPS;
66
66
  use Image::ExifTool::XMP;
67
67
 
68
- $VERSION = '4.47';
68
+ $VERSION = '4.48';
69
69
 
70
70
  sub LensIDConv($$$);
71
71
  sub ProcessNikonAVI($$$);
@@ -1691,14 +1691,15 @@ my %cropHiSpeed = ( #IB
1691
1691
  4 => '3:2 Crop', # (1.2x, ref 36)
1692
1692
  6 => '16:9 Crop',
1693
1693
  8 => '2.7x Crop', #36 (D4/D500)
1694
- 9 => 'DX Movie Crop', # (DX during movie recording, Large)
1694
+ 9 => 'DX Movie 16:9 Crop', # (DX during movie recording, Large)
1695
1695
  10 => '1.3x Movie Crop', #36 (D4/D500)
1696
1696
  11 => 'FX Uncropped',
1697
1697
  12 => 'DX Uncropped',
1698
1698
  13 => '2.8x Movie Crop', #28 (D5/D6) 5584/1936
1699
1699
  14 => '1.4x Movie Crop', #28 (D5/D6) 5584/3856
1700
1700
  15 => '1.5x Movie Crop', #36 (D4/D500) 5600/3872
1701
- 17 => '1:1 Crop',
1701
+ 17 => 'FX 1:1 Crop',
1702
+ 18 => 'DX 1:1 Crop',
1702
1703
  OTHER => sub {
1703
1704
  my ($val, $inv, $conv) = @_;
1704
1705
  return undef if $inv;
@@ -40,7 +40,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
40
40
  use Image::ExifTool::Exif;
41
41
  use Image::ExifTool::APP12;
42
42
 
43
- $VERSION = '2.86';
43
+ $VERSION = '2.87';
44
44
 
45
45
  sub PrintLensInfo($$$);
46
46
 
@@ -447,6 +447,7 @@ my %olympusCameraTypes = (
447
447
  S0101 => 'OM-5', #IB
448
448
  S0121 => 'OM-1MarkII', #forum15652
449
449
  S0123 => 'OM-3', #forum17208
450
+ S0130 => 'OM-5MarkII', #forum17465
450
451
  SR45 => 'D220',
451
452
  SR55 => 'D320L',
452
453
  SR83 => 'D340L',
@@ -46,6 +46,7 @@
46
46
  # IB) Iliah Borg private communication (LibRaw)
47
47
  # JD) Jens Duttke private communication
48
48
  # NJ) Niels Kristian Bech Jensen private communication
49
+ # KG) Karsten Gieselmann private communication
49
50
  #
50
51
  # Notes: See POD documentation at the bottom of this file
51
52
  #------------------------------------------------------------------------------
@@ -58,11 +59,14 @@ use Image::ExifTool::Exif;
58
59
  use Image::ExifTool::GPS;
59
60
  use Image::ExifTool::HP;
60
61
 
61
- $VERSION = '3.52';
62
+ $VERSION = '3.53';
62
63
 
63
64
  sub CryptShutterCount($$);
64
65
  sub PrintFilter($$$);
65
66
  sub DecodeAFPoints($$$$;$);
67
+ sub AFPointNamesK3III($$;$);
68
+ sub AFPointValuesK3III($$);
69
+ sub AFAreasK3III($$);
66
70
 
67
71
  # pentax lens type codes (ref 4)
68
72
  # The first number gives the lens series, and the 2nd gives the model number
@@ -1148,31 +1152,38 @@ my %binaryDataAttrs = (
1148
1152
  Notes => 'Pentax models',
1149
1153
  Writable => 'int16u',
1150
1154
  PrintConvColumns => 2,
1155
+ PrintHex => 1,
1151
1156
  PrintConv => { #PH
1152
- 0 => 'Normal',
1153
- 1 => 'Macro',
1154
- 2 => 'Infinity',
1155
- 3 => 'Manual',
1156
- 4 => 'Super Macro', #JD
1157
- 5 => 'Pan Focus',
1158
- 6 => 'Auto-area', # (GR III)
1159
- 8 => 'Select', # (GR III)
1160
- 9 => 'Pinpoint', # (GR III)
1161
- 10 => 'Tracking', # (GR III)
1162
- 11 => 'Continuous', # (GR III)
1163
- 12 => 'Snap', # (GR III)
1164
- 16 => 'AF-S (Focus-priority)', #17
1165
- 17 => 'AF-C (Focus-priority)', #17
1166
- 18 => 'AF-A (Focus-priority)', #PH (educated guess)
1167
- 32 => 'Contrast-detect (Focus-priority)', #PH (K-5)
1168
- 33 => 'Tracking Contrast-detect (Focus-priority)', #PH (K-5)
1157
+ 0x00 => 'Normal',
1158
+ 0x01 => 'Macro',
1159
+ 0x02 => 'Infinity',
1160
+ 0x03 => 'Manual',
1161
+ 0x04 => 'Super Macro', #JD
1162
+ 0x05 => 'Pan Focus',
1163
+ 0x06 => 'Auto-area', # (GR III)
1164
+ 0x07 => 'Zone Select', # (GR III)
1165
+ 0x08 => 'Select', # (GR III)
1166
+ 0x09 => 'Pinpoint', # (GR III)
1167
+ 0x0a => 'Tracking', # (GR III)
1168
+ 0x0b => 'Continuous', # (GR III)
1169
+ 0x0c => 'Snap', # (GR III)
1170
+ 0x10 => 'AF-S (Focus-priority)', #17
1171
+ 0x11 => 'AF-C (Focus-priority)', #17
1172
+ 0x12 => 'AF-A (Focus-priority)', #PH (educated guess)
1173
+ 0x20 => 'Contrast-detect (Focus-priority)', #PH (K-5)
1174
+ 0x21 => 'Tracking Contrast-detect (Focus-priority)', #PH (K-5)
1169
1175
  # bit 8 indicates release priority
1170
- 272 => 'AF-S (Release-priority)', #PH (K-5,K-3)
1171
- 273 => 'AF-C (Release-priority)', #PH (K-5,K-3)
1172
- 274 => 'AF-A (Release-priority)', #PH (K-3)
1173
- 288 => 'Contrast-detect (Release-priority)', #PH (K-01)
1174
- # 32777 (0x8009) - seen for Ricoh GR III
1175
- # 32779 (0x800b) - seen for Ricoh GR III
1176
+ 0x110 => 'AF-S (Release-priority)', #PH (K-5,K-3)
1177
+ 0x111 => 'AF-C (Release-priority)', #PH (K-5,K-3)
1178
+ 0x112 => 'AF-A (Release-priority)', #PH (K-3)
1179
+ 0x120 => 'Contrast-detect (Release-priority)', #PH (K-01)
1180
+ # bit 15 indicates macro mode (disabled for MF, and defaults to Select for Snap, Infinity)
1181
+ 0x8006 => 'Auto-area (Macro)', # (GR III)
1182
+ 0x8007 => 'Zone Select (Macro)', # (GR III)
1183
+ 0x8008 => 'Select (Macro)', # (GR III)
1184
+ 0x8009 => 'Pinpoint (Macro)', # (GR III)
1185
+ 0x800a => 'Tracking (Macro)', # (GR III)
1186
+ 0x800b => 'Continuous (Macro)', # (GR III)
1176
1187
  },
1177
1188
  },{
1178
1189
  Name => 'FocusMode',
@@ -1188,7 +1199,7 @@ my %binaryDataAttrs = (
1188
1199
  ],
1189
1200
  0x000e => [{ #29
1190
1201
  Name => 'AFPointSelected',
1191
- Condition => '$$self{Model} =~ /K-1\b/',
1202
+ Condition => '$$self{Model} =~ /(K-1|645Z)\b/', # (NC for 645Z)
1192
1203
  Writable => 'int16u',
1193
1204
  Notes => 'K-1',
1194
1205
  PrintConvColumns => 2,
@@ -1367,16 +1378,20 @@ my %binaryDataAttrs = (
1367
1378
  9 => 'Lower-left',
1368
1379
  10 => 'Bottom',
1369
1380
  11 => 'Lower-right',
1370
- },
1381
+ },{
1371
1382
  # (second number exists for K-5II(s) is usually 0, but is 1 for AF.C with
1372
1383
  # AFPointMode=='Select' and extended tracking focus points are enabled in the settings)
1373
- ],
1384
+ # -----
1385
+ #KG: for K-70 and older models with 11 PDAF points (K-S2, K-S1, K-50, K-500, K-30, K-5II(s) )
1386
+ 0 => 'Single Point', # Select AF (1-point) in both PDAF and CAF modes
1387
+ 1 => 'Expanded Area', # Expanded Area AF in AF-C
1388
+ }],
1374
1389
  }],
1375
1390
  0x000f => [{ #PH
1376
1391
  Name => 'AFPointsInFocus',
1377
- Condition => '$$self{Model} =~ /K-3\b/',
1392
+ Condition => '$$self{Model} =~ /K-(3|S1|S2)\b/', #KG: valid also for K-S1/S2
1378
1393
  Writable => 'int32u',
1379
- Notes => 'K-3 only',
1394
+ Notes => 'K-3, K-S1 and K-S2 only',
1380
1395
  PrintHex => 1,
1381
1396
  PrintConv => {
1382
1397
  0 => '(none)',
@@ -2169,7 +2184,7 @@ my %binaryDataAttrs = (
2169
2184
  11 => 'Flat', #31 (K-70)
2170
2185
  # the following values from GR III
2171
2186
  256 => 'Standard',
2172
- 257 => 'Vivid',
2187
+ 257 => 'Vivid',
2173
2188
  258 => 'Monotone',
2174
2189
  259 => 'Soft Monotone',
2175
2190
  260 => 'Hard Monotone',
@@ -3097,13 +3112,15 @@ my %binaryDataAttrs = (
3097
3112
  # 0x0406 - undef[4116] (K-5)
3098
3113
  # 0x0407 - undef[3072] (Q DNG)
3099
3114
  # 0x0408 - undef[1024] (Q DNG)
3115
+ 0x040c => {
3116
+ Name => 'AFInfoK3III',
3117
+ SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AFInfoK3III' },
3118
+ },
3100
3119
  0x0e00 => {
3101
3120
  Name => 'PrintIM',
3102
3121
  Description => 'Print Image Matching',
3103
3122
  Writable => 0,
3104
- SubDirectory => {
3105
- TagTable => 'Image::ExifTool::PrintIM::Main',
3106
- },
3123
+ SubDirectory => { TagTable => 'Image::ExifTool::PrintIM::Main' },
3107
3124
  },
3108
3125
  );
3109
3126
 
@@ -5006,11 +5023,11 @@ my %binaryDataAttrs = (
5006
5023
  # 0x0a - values: 00,05,0d,15,86,8e,a6,ae
5007
5024
  0x0b => { #JD
5008
5025
  Name => 'AFPointsInFocus',
5009
- Condition => '$$self{Model} !~ /(K-(1|3|70)|KP)\b/',
5026
+ Condition => '$$self{Model} !~ /(K-(1|3|70|S1|S2)|KP)\b/', #KG: valid also for K-S1/S2
5010
5027
  Notes => q{
5011
- models other than the K-1, K-3, K-70 and KP. May report two points in focus
5012
- even though a single AFPoint has been selected, in which case the selected
5013
- AFPoint is the first reported
5028
+ models other than the K-1, K-3, K-70, KP and K-S1/S2. May report two points
5029
+ in focus even though a single AFPoint has been selected, in which case the
5030
+ selected AFPoint is the first reported
5014
5031
  },
5015
5032
  PrintConvColumns => 2,
5016
5033
  PrintConv => {
@@ -5043,34 +5060,34 @@ my %binaryDataAttrs = (
5043
5060
  Format => 'int16uRev[69]',
5044
5061
  Unknown => 1,
5045
5062
  Notes => 'some unknown values related to each AFPoint',
5046
- # order is the same as AFPoints below, but there is an additional value for
5063
+ # order is the same as AFPointsSelected below, but there is an additional value for
5047
5064
  # each AF point starting at offset 28 in the array (yes, the range overlaps
5048
5065
  # with the 1st values)
5049
5066
  # (values are int16s stored in reversed byte order)
5050
5067
  ValueConv => 'my @a=split " ",$val;$_>32767 and $_-=65536 foreach @a;join " ",@a',
5051
- PrintConv => \&AFPointValues,
5068
+ PrintConv => \&AFPointValuesK3III,
5052
5069
  },
5053
5070
  0x12a => { # byte has a value of 2 if corresponding AF point is selected
5054
- Name => 'AFPointsSelected',
5071
+ Name => 'AFPointsSelected', # (should probably be "AFPointSelected", but the bitmask allows multiple points)
5055
5072
  Condition => '$$self{Model} eq "PENTAX K-3 Mark III"', # any other models?
5056
5073
  Notes => q{
5057
5074
  K-3III only. 41 selectable AF points from a total of 101 available in a 13x9
5058
5075
  grid. Columns are labelled A-M and rows are 1-9. The center point is G5
5059
5076
  },
5060
5077
  Format => 'int8u[41]',
5061
- PrintConv => 'Image::ExifTool::Pentax::AFPointsK3iii($val,$self,2)',
5078
+ PrintConv => 'Image::ExifTool::Pentax::AFPointNamesK3III($val,$self,2)',
5062
5079
  },
5063
5080
  #
5064
5081
  # (maybe not coincidentally, there are 60 unknown bytes
5065
5082
  # here, and there are also 60 non-selectable AF points)
5066
5083
  #
5067
5084
  0x18f => { # byte has a value of 1 if corresponding AF point is ... in focus maybe?
5068
- # usually the same points as AFPoints above, but not always
5085
+ # usually the same points as AFPointsSelected above, but not always
5069
5086
  Name => 'AFPointsUnknown',
5070
5087
  Condition => '$$self{Model} eq "PENTAX K-3 Mark III"', # any other models?
5071
5088
  Unknown => 1,
5072
5089
  Format => 'int8u[41]',
5073
- PrintConv => \&AFPointsK3iii,
5090
+ PrintConv => \&AFPointNamesK3III,
5074
5091
  },
5075
5092
  0x1fa => {
5076
5093
  Name => 'LiveView',
@@ -5097,7 +5114,7 @@ my %binaryDataAttrs = (
5097
5114
  Name => 'NumCAFPoints',
5098
5115
  RawConv => '$$self{NumCAFPoints} = ($val & 0x0f) * ($val >> 4); $val',
5099
5116
  ValueConv => '($val >> 4) * ($val & 0x0f)',
5100
- },
5117
+ },
5101
5118
  1.1 => {
5102
5119
  Name => 'CAFGridSize',
5103
5120
  ValueConv => '($val >> 4) . " " . ($val & 0x0f)', # (width x height)
@@ -5687,6 +5704,95 @@ my %binaryDataAttrs = (
5687
5704
  ValueConvInv => '-$val * 2',
5688
5705
  },
5689
5706
  );
5707
+
5708
+ %Image::ExifTool::Pentax::AFInfoK3III = (
5709
+ %binaryDataAttrs,
5710
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
5711
+ FORMAT => 'int16u',
5712
+ DATAMEMBER => [ 3 ],
5713
+ NOTES => 'AF tags written by the K-3 Mark III, GR III and GR IIIx.',
5714
+ 0 => {
5715
+ Name => 'AFInfo',
5716
+ Format => 'int16u[$size/2]',
5717
+ Notes => q{
5718
+ entire AFInfoK3III structure. Provides access to raw numerical values and
5719
+ facilitates the writing of the whole structure
5720
+ },
5721
+ Unknown => 1,
5722
+ },
5723
+ 0.1 => {
5724
+ Name => 'AFMode',
5725
+ PrintConv => {
5726
+ 0 => 'Phase Detect',
5727
+ 2 => 'Contrast Detect',
5728
+ 255 => 'Manual Focus',
5729
+ },
5730
+ },
5731
+ 1 => {
5732
+ Name => 'AFSelectionMode',
5733
+ PrintHex => 1,
5734
+ PrintConv => {
5735
+ 0 => 'Manual Focus',
5736
+ 1 => 'Spot',
5737
+ 2 => 'Select (5-points)',
5738
+ 3 => 'Expanded Area (S)',
5739
+ 4 => 'Expanded Area (M)',
5740
+ 5 => 'Expanded Area (L)',
5741
+ 6 => 'Select (S)',
5742
+ 7 => 'Zone Select (21-point)',
5743
+ 8 => 'Select XS',
5744
+ 0xff => 'Auto Area',
5745
+ # Contrast-detect modes
5746
+ 0x2001 => 'Contrast-detect Auto Area',
5747
+ 0x2002 => 'Contrast-detect Select', # (GR III)
5748
+ 0x2003 => 'Pinpoint', # (GR III)
5749
+ 0x2004 => 'Tracking',
5750
+ 0x2005 => 'Continuous', # (GR III)
5751
+ 0x2006 => 'Face Detection',
5752
+ 0x2007 => 'Contrast-detect Select (S)',
5753
+ 0x2008 => 'Contrast-detect Select (M)',
5754
+ 0x2009 => 'Contrast-detect Select (L)',
5755
+ 0x200a => 'Contrast-detect Zone Select', # (GR III)
5756
+ 0x200b => 'Contrast-detect Spot',
5757
+ },
5758
+ },
5759
+ 3 => {
5760
+ Name => 'NumAFPoints',
5761
+ RawConv => '$$self{NumAFPoints} = $val',
5762
+ },
5763
+ # the data for each AF point consists of 7 int16u values:
5764
+ # the frame width/height, the X/Y position of the focus area,
5765
+ # width/height of the focus area (0/0 for phase-detect modes),
5766
+ # followed by a flags word
5767
+ 7 => { # (the same for all areas in my samples, so only extract the first)
5768
+ Name => 'AFFrameSize',
5769
+ Condition => '$$self{NumAFPoints} > 0',
5770
+ Format => 'int16u[2]',
5771
+ Writable => 0,
5772
+ PrintConv => '$val=~s/ /x/; $val',
5773
+ },
5774
+ 7.1 => {
5775
+ Name => 'AFAreas',
5776
+ Format => 'int16u[7 * $val{3}]',
5777
+ Notes => q{
5778
+ X,Y position of each AF area, width, with "in-focus" for points in focus,
5779
+ "central" for the center of the selected area, or "peripheral" for points
5780
+ outside the selected area
5781
+ },
5782
+ Writable => 0,
5783
+ List => 1, # (for documentation purposes only)
5784
+ PrintConv => \&AFAreasK3III,
5785
+ },
5786
+ 11 => { # (the same for all areas in my samples, so only extract the first)
5787
+ Name => 'AFAreaSize',
5788
+ Condition => '$$self{NumAFPoints} > 0 and $$valPt !~ /^\0\0\0\0/',
5789
+ Notes => 'only for contrast-detect modes',
5790
+ Format => 'int16u[2]',
5791
+ Writable => 0,
5792
+ PrintConv => '$val=~s/ /x/; $val',
5793
+ },
5794
+ );
5795
+
5690
5796
  # white balance RGGB levels (ref 28)
5691
5797
  %Image::ExifTool::Pentax::WBLevels = (
5692
5798
  %binaryDataAttrs,
@@ -5750,7 +5856,7 @@ my %binaryDataAttrs = (
5750
5856
  },
5751
5857
  );
5752
5858
 
5753
- # lens information for Penax Q (ref PH)
5859
+ # lens information for Pentax Q (ref PH)
5754
5860
  # (306 bytes long, I wonder if this contains vignetting information too?)
5755
5861
  %Image::ExifTool::Pentax::LensInfoQ = (
5756
5862
  %binaryDataAttrs,
@@ -6461,9 +6567,9 @@ sub DecodeAFPoints($$$$;$)
6461
6567
  }
6462
6568
 
6463
6569
  #------------------------------------------------------------------------------
6464
- # Print AF Point names for K-3III (ref PH)
6570
+ # Print K-3III AF Point names (ref PH)
6465
6571
  # Inputs: 0) value, 1) ExifTool ref, 2) optional value to match
6466
- sub AFPointsK3iii($$;$)
6572
+ sub AFPointNamesK3III($$;$)
6467
6573
  {
6468
6574
  my @a = split ' ', $_[0];
6469
6575
  my $match = $_[2];
@@ -6477,10 +6583,10 @@ sub AFPointsK3iii($$;$)
6477
6583
  }
6478
6584
 
6479
6585
  #------------------------------------------------------------------------------
6480
- # Print AF point values for K-3III (ref PH)
6586
+ # Print K-3III AF point values (ref PH)
6481
6587
  # Inputs: 0) value, 1) ExifTool ref
6482
6588
  # Notes: this is experimental and not well understood
6483
- sub AFPointValues($$)
6589
+ sub AFPointValuesK3III($$)
6484
6590
  {
6485
6591
  my @a = split ' ', shift;
6486
6592
  my @vals;
@@ -6499,6 +6605,25 @@ sub AFPointValues($$)
6499
6605
  return @vals ? join ',', sort @vals : '(none)';
6500
6606
  }
6501
6607
 
6608
+ #------------------------------------------------------------------------------
6609
+ # Print K-3III AF point positions from tag 0x040c (ref KG)
6610
+ # Inputs: 0) raw value, 1) ExifTool ref
6611
+ sub AFAreasK3III($$)
6612
+ {
6613
+ my ($val, $et) = @_;
6614
+ return '(none)' unless $val;
6615
+ my @vals = split ' ', $val;
6616
+ # flags bits: [mask, value, description]
6617
+ my @flags = ([0x10,0x10,'central'],[0x08,0,'peripheral'],[0x04,0x04,'in-focus']);
6618
+ my ($i, @strs);
6619
+ for ($i=0; $i+7<=@vals; $i+=7) {
6620
+ my @a;
6621
+ ($vals[$i+6] & $$_[0]) == $$_[1] and push @a, $$_[2] foreach @flags;
6622
+ push @strs, $vals[$i+2] . ',' . $vals[$i+3] . (@a ? '(' . join(',',@a) . ')' : '');
6623
+ }
6624
+ return \@strs;
6625
+ }
6626
+
6502
6627
  #------------------------------------------------------------------------------
6503
6628
  # Convert Pentax hex-based EV (modulo 8) to real number
6504
6629
  # Inputs: 0) value to convert