exiftool-vendored.pl 13.34.0 → 13.35.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/README.md CHANGED
@@ -6,7 +6,7 @@ files are omitted, as they almost double the size of the package and more than
6
6
  triple the number of files in the package.
7
7
 
8
8
  [![npm version](https://img.shields.io/npm/v/exiftool-vendored.pl.svg)](https://www.npmjs.com/package/exiftool-vendored.pl)
9
- [![Node.js CI](https://github.com/photostructure/exiftool-vendored.pl/actions/workflows/node.js.yml/badge.svg)](https://github.com/photostructure/exiftool-vendored.pl/actions/workflows/node.js.yml)
9
+ [![Build](https://github.com/photostructure/exiftool-vendored.pl/actions/workflows/build.yml/badge.svg)](https://github.com/photostructure/exiftool-vendored.pl/actions/workflows/build.yml)
10
10
 
11
11
  ## Usage
12
12
 
@@ -23,4 +23,4 @@ number, if necessary, to follow SemVer.
23
23
  1. The `check-updates` workflow automatically detects new ExifTool versions and creates PRs
24
24
  2. Update PRs use a `-pre` suffix during development (e.g., `13.26.0-pre`)
25
25
  3. The `release` workflow removes the `-pre` suffix when publishing to npm
26
- 4. Final npm package versions match the vendored ExifTool version exactly
26
+ 4. Final npm package versions match the vendored ExifTool version exactly
package/bin/Changes CHANGED
@@ -4,9 +4,32 @@ ExifTool Version History
4
4
 
5
5
  RSS feed: https://exiftool.org/rss.xml
6
6
 
7
- Note: The most recent production release is Version 13.30. (Other versions are
7
+ Note: The most recent production release is Version 13.35. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Sept. 6, 2025 - Version 13.35 (production release)
11
+
12
+ - Added a new CanonModelID
13
+ - Added new Olympus PictureMode and LensType values (thanks Michael Meissner)
14
+ - Decode GPS from another DJI protobuf format (DJI Neo)
15
+ - Decode a few new FujiFilm tags
16
+ - Enhanced -ee option to extract M-RAW information from all images in FujiFilm
17
+ RAF files
18
+ - Improved handling of standard-format unknown XMP date/time tags when the API
19
+ XMPAutoConv option is set (which is the default) to put them in the "Time"
20
+ group and apply the -d date/time formatting
21
+ - Improved -fileNUM option so it may be used to access tags from alternate
22
+ files when the specified target FILE doesn't exist
23
+ - Improved print conversions for some Canon tags to handle "n/a" values
24
+ - Enhanced JSON long output (-j -l) so the API SaveBin option also returns the
25
+ Rational ("rat") value if available
26
+ - Changed -if option so the expression is evaluated even when the source file
27
+ doesn't exist (to allow more flexibily when using -fileNUM option or when
28
+ creating the output file when writing)
29
+ - Fixed decoding of a few new Pentax tags (thanks Karsten Gieselmann)
30
+ - Fixed -diff feature to report differences in binary-data values and to be
31
+ consistent with handling of backslashes in Windows path names
32
+
10
33
  Aug. 18, 2025 - Version 13.34
11
34
 
12
35
  - Decode a number of new Pentax tags (thanks Karsten Gieselmann)
package/bin/META.json CHANGED
@@ -50,6 +50,6 @@
50
50
  }
51
51
  },
52
52
  "release_status" : "stable",
53
- "version" : "13.34",
53
+ "version" : "13.35",
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.34'
34
+ version: '13.35'
35
35
  x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
package/bin/README CHANGED
@@ -110,8 +110,8 @@ your home directory, then you would type the following commands in a
110
110
  terminal window to extract and run ExifTool:
111
111
 
112
112
  cd ~/Desktop
113
- gzip -dc Image-ExifTool-13.34.tar.gz | tar -xf -
114
- cd Image-ExifTool-13.34
113
+ gzip -dc Image-ExifTool-13.35.tar.gz | tar -xf -
114
+ cd Image-ExifTool-13.35
115
115
  ./exiftool t/images/ExifTool.jpg
116
116
 
117
117
  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.34';
14
+ my $version = '13.35';
15
15
 
16
16
  $^W = 1; # enable global warnings
17
17
 
@@ -57,7 +57,7 @@ sub FormatJSON($$$;$);
57
57
  sub PrintCSV(;$);
58
58
  sub AddGroups($$$$);
59
59
  sub ConvertBinary($);
60
- sub IsEqual($$);
60
+ sub IsEqual($$;$);
61
61
  sub Printable($);
62
62
  sub LengthUTF8($);
63
63
  sub Infile($;$);
@@ -969,6 +969,7 @@ for (;;) {
969
969
  if (/^diff$/i) {
970
970
  $diff = shift;
971
971
  defined $diff or Error("Expecting file name for -$_ option\n"), $badCmd=1;
972
+ CleanFilename($diff); # change to forward slashes if necessary
972
973
  next;
973
974
  }
974
975
  /^delete_original(!?)$/i and $deleteOrig = ($1 ? 2 : 1), next;
@@ -2150,10 +2151,12 @@ sub GetImageInfo($$)
2150
2151
  # set alternate file names
2151
2152
  foreach $g8 (sort keys %altFile) {
2152
2153
  my $altName = $orig;
2153
- # must double any '$' symbols in the original file name because
2154
- # they are used for tag names in a -fileNUM argument
2155
- $altName =~ s/\$/\$\$/g;
2156
- $altName = FilenameSPrintf($altFile{$g8}, $altName);
2154
+ unless ($altFile{$g8} eq '@') {
2155
+ # must double any '$' symbols in the original file name because
2156
+ # they are used for tag names in a -fileNUM argument
2157
+ $altName =~ s/\$/\$\$/g;
2158
+ $altName = FilenameSPrintf($altFile{$g8}, $altName);
2159
+ }
2157
2160
  $et->SetAlternateFile($g8, $altName);
2158
2161
  }
2159
2162
 
@@ -2178,15 +2181,7 @@ sub GetImageInfo($$)
2178
2181
  }
2179
2182
  # evaluate -if expression for conditional processing
2180
2183
  if (@condition) {
2181
- unless ($file eq '-' or $et->Exists($file)) {
2182
- Warn "Error: File not found - $file\n";
2183
- EFile($file);
2184
- FileNotFound($file);
2185
- ++$countBad;
2186
- return;
2187
- }
2188
2184
  my $result;
2189
-
2190
2185
  unless ($failCondition) {
2191
2186
  # catch run time errors as well as compile errors
2192
2187
  undef $evalWarning;
@@ -2225,7 +2220,10 @@ sub GetImageInfo($$)
2225
2220
  }
2226
2221
  undef @foundTags if $fastCondition; # ignore if we didn't get all tags
2227
2222
  }
2228
- unless ($result) {
2223
+ if ($result) {
2224
+ # discard $info for non-existent file
2225
+ undef $info unless $file eq '-' or $et->Exists($file);
2226
+ } else {
2229
2227
  Progress($vout, "-------- $file (failed condition)") if $verbose;
2230
2228
  EFile($file, 2);
2231
2229
  ++$countFailed;
@@ -2922,7 +2920,7 @@ TAG: foreach $tag (@foundTags) {
2922
2920
  $val = $et->GetValue($tag, 'ValueConv');
2923
2921
  $val = '' unless defined $val;
2924
2922
  # go back to print ValueConv value only if different
2925
- next unless IsEqual($val, $lastVal);
2923
+ next unless IsEqual($val, $lastVal, 1);
2926
2924
  print $fp "$descClose\n </$tok>";
2927
2925
  last;
2928
2926
  }
@@ -2959,7 +2957,7 @@ TAG: foreach $tag (@foundTags) {
2959
2957
  $$val{desc} = $desc;
2960
2958
  if ($printConv) {
2961
2959
  my $num = $et->GetValue($tag, 'ValueConv');
2962
- $$val{num} = $num if defined $num and not IsEqual($num, $$val{val});
2960
+ $$val{num} = $num if defined $num and not IsEqual($num, $$val{val}, 1);
2963
2961
  }
2964
2962
  my $ex = $$et{TAG_EXTRA}{$tag};
2965
2963
  $$val{'fmt'} = $$ex{G6} if defined $$ex{G6};
@@ -2972,6 +2970,7 @@ TAG: foreach $tag (@foundTags) {
2972
2970
  $$val{'hex'} = join ' ', unpack '(H2)*', $$ex{BinVal};
2973
2971
  }
2974
2972
  }
2973
+ $$val{rat} = $$ex{Rational} if defined $$ex{Rational} and $$et{OPTIONS}{SaveBin};
2975
2974
  }
2976
2975
  }
2977
2976
  FormatJSON($fp, $val, $ind, $quote);
@@ -3945,24 +3944,29 @@ sub ConvertBinary($)
3945
3944
 
3946
3945
  #------------------------------------------------------------------------------
3947
3946
  # Compare ValueConv and PrintConv values of a tag to see if they are equal
3948
- # Inputs: 0) value1, 1) value2
3947
+ # Inputs: 0) value1, 1) value2, 2) flag to return true for any scalar references
3949
3948
  # Returns: true if they are equal
3950
- sub IsEqual($$)
3949
+ sub IsEqual($$;$)
3951
3950
  {
3952
- my ($a, $b) = @_;
3951
+ my ($a, $b, $trueScalar) = @_;
3953
3952
  # (scalar values are not print-converted)
3954
- return 1 if $a eq $b or ref $a eq 'SCALAR';
3953
+ return 1 if $a eq $b;
3954
+ if (ref $a eq 'SCALAR') {
3955
+ return 1 if $trueScalar;
3956
+ return 1 if ref $b eq 'SCALAR' and $$a eq $$b;
3957
+ return 0;
3958
+ }
3955
3959
  if (ref $a eq 'HASH' and ref $b eq 'HASH') {
3956
3960
  return 0 if scalar(keys %$a) != scalar(keys %$b);
3957
3961
  my $key;
3958
3962
  foreach $key (keys %$a) {
3959
- return 0 unless IsEqual($$a{$key}, $$b{$key});
3963
+ return 0 unless IsEqual($$a{$key}, $$b{$key}, $trueScalar);
3960
3964
  }
3961
3965
  } else {
3962
3966
  return 0 if ref $a ne 'ARRAY' or ref $b ne 'ARRAY' or @$a != @$b;
3963
3967
  my $i;
3964
3968
  for ($i=0; $i<scalar(@$a); ++$i) {
3965
- return 0 unless IsEqual($$a[$i], $$b[$i]);
3969
+ return 0 unless IsEqual($$a[$i], $$b[$i], $trueScalar);
3966
3970
  }
3967
3971
  }
3968
3972
  return 1;
@@ -4380,7 +4384,7 @@ sub FindFileWindows($$)
4380
4384
  # recode file name as UTF-8 if necessary
4381
4385
  my $enc = $et->Options('CharsetFileName');
4382
4386
  $wildfile = $et->Decode($wildfile, $enc, undef, 'UTF8') if $enc and $enc ne 'UTF8';
4383
- $wildfile =~ tr/\\/\//; # use forward slashes
4387
+ CleanFilename($wildfile); # use forward slashes
4384
4388
  my ($dir, $wildname) = ($wildfile =~ m{(.*[:/])(.*)}) ? ($1, $2) : ('', $wildfile);
4385
4389
  if (HasWildcards($dir)) {
4386
4390
  Warn "Wildcards don't work in the directory specification\n";
@@ -4460,7 +4464,7 @@ sub AbsPath($)
4460
4464
  local $SIG{'__WARN__'} = sub { };
4461
4465
  $path = eval { Cwd::abs_path($file) };
4462
4466
  }
4463
- $path =~ tr/\\/\// if $^O eq 'MSWin32' and defined $path; # use forward slashes
4467
+ CleanFilename($path) if defined $path; # use forward slashes
4464
4468
  }
4465
4469
  return $path;
4466
4470
  }
@@ -5901,13 +5905,15 @@ Adding the B<-D> or B<-H> option changes tag values to JSON objects with
5901
5905
  "val" and "id" fields. Adding B<-l> adds a "desc" field, and a "num" field
5902
5906
  if the numerical value is different from the converted "val", and "fmt" and
5903
5907
  "hex" fields for EXIF metadata if the API SaveFormat and SaveBin options are
5904
- set respectively, and the length of the "hex" output is limited by the API
5905
- LimitLongValues setting. The B<-b> option may be added to output binary
5906
- data, encoded in base64 if necessary (indicated by ASCII "base64:" as the
5907
- first 7 bytes of the value), and B<-t> may be added to include tag table
5908
- information (see B<-t> for details). The JSON output is UTF-8 regardless of
5909
- any B<-L> or B<-charset> option setting, but the UTF-8 validation is
5910
- disabled if a character set other than UTF-8 is specified.
5908
+ set respectively. The length of the "hex" output is limited by the API
5909
+ LimitLongValues setting. Setting the SaveBin option also causes the
5910
+ original values of Rational tags to be returned in string form as an extra
5911
+ "rat" field. The B<-b> option may be added to output binary data, encoded
5912
+ in base64 if necessary (indicated by ASCII "base64:" as the first 7 bytes of
5913
+ the value), and B<-t> may be added to include tag table information (see
5914
+ B<-t> for details). The JSON output is UTF-8 regardless of any B<-L> or
5915
+ B<-charset> option setting, but the UTF-8 validation is disabled if a
5916
+ character set other than UTF-8 is specified.
5911
5917
 
5912
5918
  Note that ExifTool quotes JSON values only if they don't look like numbers
5913
5919
  (regardless of the original storage format or the relevant metadata
@@ -6076,7 +6082,7 @@ with this command:
6076
6082
 
6077
6083
  produces output like this:
6078
6084
 
6079
- -- Generated by ExifTool 13.34 --
6085
+ -- Generated by ExifTool 13.35 --
6080
6086
  File: a.jpg - 2003:10:31 15:44:19
6081
6087
  (f/5.6, 1/60s, ISO 100)
6082
6088
  File: b.jpg - 2006:05:23 11:57:38
@@ -7173,6 +7179,10 @@ Subtle note: If a B<-tagsFromFile> option is used, tags in the I<ALTFILE>
7173
7179
  argument come from the I<SRCFILE> that applies to the first argument
7174
7180
  accessing tags from the corresponding C<FileNUM> group.
7175
7181
 
7182
+ I<ALTFILE> may also be C<@> to access tags from the specified I<FILE>, which
7183
+ may be useful when the B<-srcfile> option is used to process a different
7184
+ source file.
7185
+
7176
7186
  User-defined Composite tags may access tags from alternate files using the
7177
7187
  appropriate (case-sensitive) family 8 group name.
7178
7188
 
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
88
88
  sub ProcessExifInfo($$$);
89
89
  sub SwapWords($);
90
90
 
91
- $VERSION = '4.95';
91
+ $VERSION = '4.96';
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)
@@ -1006,6 +1006,7 @@ $VERSION = '4.95';
1006
1006
  0x80000491 => 'PowerShot V10', #25
1007
1007
  0x80000495 => 'EOS R1', #PH
1008
1008
  0x80000496 => 'R5 Mark II', #forum16406
1009
+ 0x80000497 => 'PowerShot V1', #PH
1009
1010
  0x80000498 => 'EOS R100', #25
1010
1011
  0x80000516 => 'EOS R50 V', #42
1011
1012
  0x80000520 => 'EOS D2000C', #IB
@@ -9172,15 +9173,37 @@ my %filterConv = (
9172
9173
  Name => 'AFConfigTool',
9173
9174
  ValueConv => '$val + 1',
9174
9175
  ValueConvInv => '$val - 1',
9175
- PrintConv => '"Case $val"',
9176
- PrintConvInv => '$val=~/(\d+)/ ? $1 : undef',
9176
+ PrintHex => 1,
9177
+ PrintConv => {
9178
+ 0x80000000 => 'n/a',
9179
+ OTHER => sub { 'Case ' . shift },
9180
+ },
9181
+ PrintConvInv => '$val=~/(\d+)/ ? $1 : 0x80000000',
9182
+ },
9183
+ 2 => {
9184
+ Name => 'AFTrackingSensitivity',
9185
+ PrintHex => 1,
9186
+ PrintConv => {
9187
+ 0x7fffffff => 'n/a',
9188
+ OTHER => sub { shift },
9189
+ },
9177
9190
  },
9178
- 2 => 'AFTrackingSensitivity',
9179
9191
  3 => {
9180
9192
  Name => 'AFAccelDecelTracking',
9181
9193
  Description => 'AF Accel/Decel Tracking',
9194
+ PrintHex => 1,
9195
+ PrintConv => {
9196
+ 0x7fffffff => 'n/a',
9197
+ OTHER => sub { shift },
9198
+ },
9199
+ },
9200
+ 4 => {
9201
+ Name => 'AFPointSwitching',
9202
+ PrintConv => {
9203
+ 0x7fffffff => 'n/a',
9204
+ OTHER => sub { shift },
9205
+ },
9182
9206
  },
9183
- 4 => 'AFPointSwitching',
9184
9207
  5 => { #52
9185
9208
  Name => 'AIServoFirstImage',
9186
9209
  PrintConv => {
@@ -18,7 +18,7 @@ use Image::ExifTool::XMP;
18
18
  use Image::ExifTool::GPS;
19
19
  use Image::ExifTool::Protobuf;
20
20
 
21
- $VERSION = '1.14';
21
+ $VERSION = '1.15';
22
22
 
23
23
  sub ProcessDJIInfo($$$);
24
24
  sub ProcessSettings($$$);
@@ -30,6 +30,8 @@ sub ProcessSettings($$$);
30
30
  'dvtm_wm265e.proto' => 1, # Mavic 3
31
31
  'dvtm_pm320.proto' => 1, # Matrice 30
32
32
  'dvtm_Mini4_Pro.proto' => 1, # Matrice 30
33
+ 'dvtm_Mini4_Pro.proto' => 1, # Matrice 30
34
+ 'dvtm_dji_neo.proto' => 1, # Neo
33
35
  );
34
36
 
35
37
  my %convFloat2 = (
@@ -234,13 +236,14 @@ my %convFloat2 = (
234
236
  ExifTool currently extracts timed GPS plus a few other tags from DJI devices
235
237
  which use the following protocols: dvtm_AVATA2.proto (Avata 2),
236
238
  dvtm_ac203.proto (Osmo Action 4), dvtm_ac204.proto (Osmo Action 5),
237
- dvtm_wm265e.proto (Mavic 3), dvtm_pm320.proto (Matrice 30) and
238
- dvtm_pm320.proto (Mini 4 Pro).
239
+ dvtm_wm265e.proto (Mavic 3), dvtm_pm320.proto (Matrice 30),
240
+ dvtm_Mini4_Pro.proto (Mini 4 Pro) and dvtm_dji_neo.proto (DJI Neo).
239
241
 
240
242
  Note that with the protobuf format, numerical tags missing from the output
241
243
  for a given protocol should be considered to have the default value of 0.
242
244
  },
243
245
  Protocol => {
246
+ Notes => "typically protobuf field 1-1-1, but ExifTool doesn't rely on this",
244
247
  RawConv => q{
245
248
  unless ($Image::ExifTool::DJI::knownProtocol{$val}) {
246
249
  $self->Warn("Unknown protocol $val (please submit sample for testing)");
@@ -475,6 +478,53 @@ my %convFloat2 = (
475
478
  Name => 'GimbalInfo',
476
479
  SubDirectory => { TagTable => 'Image::ExifTool::DJI::GimbalInfo' },
477
480
  },
481
+ #
482
+ # DJI Neo (very similar to AVATA2)
483
+ #
484
+ # dvtm_dji_neo_1-1-2 - some version number
485
+ # dvtm_dji_neo_1-1-3 - some version number
486
+ 'dvtm_dji_neo_1-1-5' => { Name => 'SerialNumber', Notes => 'DJI Neo' }, # (NC)
487
+ 'dvtm_dji_neo_1-1-10' => 'Model',
488
+ # dvtm_dji_neo_2-2-1-4 - model code?
489
+ # dvtm_dji_neo_2-2-2-1 - some firmware version?
490
+ # dvtm_dji_neo_2-2-2-2 - some version number?
491
+ 'dvtm_dji_neo_2-2-3-1' => 'SerialNumber2', # (NC)
492
+ 'dvtm_dji_neo_2-3' => {
493
+ Name => 'FrameInfo',
494
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::FrameInfo' },
495
+ },
496
+ # dvtm_dji_neo_3-1-1 - frame number (starting at 1)
497
+ 'dvtm_dji_neo_3-1-2' => { # (also 3-2-1-6 and 3-4-1-6)
498
+ Name => 'TimeStamp',
499
+ Groups => { 2 => 'Time' },
500
+ Format => 'unsigned',
501
+ # milliseconds, but I don't know what the zero is
502
+ ValueConv => '$val / 1e6',
503
+ },
504
+ # dvtm_dji_neo_3-2-1-4 - model code?
505
+ # dvtm_dji_neo_3-2-1-5 - frame rate?
506
+ 'dvtm_dji_neo_3-2-2-1' => { Name => 'ISO', Format => 'float' }, # (NC)
507
+ 'dvtm_dji_neo_3-2-4-1' => {
508
+ Name => 'ShutterSpeed',
509
+ Format => 'rational',
510
+ PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
511
+ },
512
+ 'dvtm_dji_neo_3-2-6-1' => { Name => 'ColorTemperature', Format => 'unsigned' }, # (NC)
513
+ 'dvtm_dji_neo_3-2-10-1' => { # (NC)
514
+ Name => 'FNumber',
515
+ Format => 'rational',
516
+ PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
517
+ },
518
+ # dvtm_dji_neo_3-4-1-4 - model code?
519
+ 'dvtm_dji_neo_3-4-3' => { # (NC)
520
+ Name => 'DroneInfo',
521
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::DroneInfo' },
522
+ },
523
+ 'dvtm_dji_neo_3-4-4-1' => {
524
+ Name => 'GPSInfo',
525
+ SubDirectory => { TagTable => 'Image::ExifTool::DJI::GPSInfo' },
526
+ },
527
+ 'dvtm_dji_neo_3-4-4-2' => { Name => 'AbsoluteAltitude', Format => 'int64s', ValueConv => '$val / 1000' }, # (NC)
478
528
  );
479
529
 
480
530
  %Image::ExifTool::DJI::DroneInfo = (
@@ -502,6 +552,7 @@ my %convFloat2 = (
502
552
  1 => { Name => 'FrameWidth', Format => 'unsigned' },
503
553
  2 => { Name => 'FrameHeight', Format => 'unsigned' },
504
554
  3 => { Name => 'FrameRate', Format => 'float' },
555
+ # 4-8: seen these values respectively for DJI Neo: 1,8,4,1,4
505
556
  );
506
557
 
507
558
  %Image::ExifTool::DJI::GPSInfo = (
@@ -31,7 +31,7 @@ use vars qw($VERSION);
31
31
  use Image::ExifTool qw(:DataAccess :Utils);
32
32
  use Image::ExifTool::Exif;
33
33
 
34
- $VERSION = '1.98';
34
+ $VERSION = '1.99';
35
35
 
36
36
  sub ProcessFujiDir($$$);
37
37
  sub ProcessFaceRec($$$);
@@ -426,6 +426,16 @@ my %faceCategories = (
426
426
  0x300 => 'DR (Dynamic Range priority)',
427
427
  },
428
428
  },
429
+ 0x1037 => { #forum17591
430
+ Name => 'MultipleExposure',
431
+ Writable => 'int16u', # (NC)
432
+ PrintConv => {
433
+ 1 => 'Additive',
434
+ 2 => 'Average',
435
+ 3 => 'Light',
436
+ 4 => 'Dark',
437
+ },
438
+ },
429
439
  0x1040 => { #8
430
440
  Name => 'ShadowTone',
431
441
  Writable => 'int32s',
@@ -586,16 +596,44 @@ my %faceCategories = (
586
596
  Name => 'SequenceNumber',
587
597
  Writable => 'int16u',
588
598
  },
599
+ 0x1102 => { #forum17602
600
+ Name => 'WhiteBalanceBracketing',
601
+ Writable => 'int16u', # (NC)
602
+ PrintHex => 1,
603
+ PrintConv => {
604
+ 0x01ff => '+/- 1',
605
+ 0x02ff => '+/- 2',
606
+ 0x03ff => '+/- 3',
607
+ },
608
+ },
589
609
  0x1103 => {
590
610
  Name => 'DriveSettings',
591
611
  SubDirectory => { TagTable => 'Image::ExifTool::FujiFilm::DriveSettings' },
592
612
  },
593
613
  0x1105 => { Name => 'PixelShiftShots', Writable => 'int16u' }, #IB
594
614
  0x1106 => { Name => 'PixelShiftOffset', Writable => 'rational64s', Count => 2 }, #IB
595
- # (0x1150-0x1152 exist only for Pro Low-light and Pro Focus PictureModes)
596
- # 0x1150 - Pro Low-light - val=1; Pro Focus - val=2 (ref 7); HDR - val=128 (forum10799)
597
- # 0x1151 - Pro Low-light - val=4 (number of pictures taken?); Pro Focus - val=2,3 (ref 7); HDR - val=3 (forum10799)
598
- # 0x1152 - Pro Low-light - val=1,3,4 (stacked pictures used?); Pro Focus - val=1,2 (ref 7); HDR - val=3 (forum10799)
615
+ 0x1150 => {
616
+ Name => 'CompositeImageMode',
617
+ Writable => 'int32u',
618
+ PrintConv => {
619
+ 0 => 'n/a', #PH
620
+ 1 => 'Pro Low-light', #7
621
+ 2 => 'Pro Focus', #7
622
+ 32 => 'Panorama', #PH
623
+ 128 => 'HDR', #forum10799
624
+ 1024 => 'Multi-exposure', #forum17591
625
+ },
626
+ },
627
+ 0x1151 => {
628
+ Name => 'CompositeImageCount1',
629
+ Writable => 'int16u',
630
+ # Pro Low-light - val=4 (number of pictures taken?); Pro Focus - val=2,3 (ref 7); HDR - val=3 (forum10799)
631
+ },
632
+ 0x1152 => {
633
+ Name => 'CompositeImageCount2',
634
+ Writable => 'int16u',
635
+ # Pro Low-light - val=1,3,4 (stacked pictures used?); Pro Focus - val=1,2 (ref 7); HDR - val=3 (forum10799)
636
+ },
599
637
  0x1153 => { #forum7668
600
638
  Name => 'PanoramaAngle',
601
639
  Writable => 'int16u',
@@ -1558,20 +1596,21 @@ my %faceCategories = (
1558
1596
  TAG_PREFIX => 'MRAW',
1559
1597
  NOTES => q{
1560
1598
  Tags extracted from the M-RAW header of multi-image RAF files. The family 1
1561
- group name for these tags is "M-RAW".
1562
- },
1563
- 1 => { Name => 'RawImageNumber', Format => 'int32u' },
1564
- # 3 - seen "0 100", "-300 100" and "300 100" for a sequence of 3 images
1565
- 3 => { Name => 'ExposureCompensation', Format => 'rational32s', Unknown => 1, Hidden => 1, PrintConv => 'sprintf("%+.2f",$val)' },
1566
- # 4 - (same value as 3 in all my samples)
1567
- 4 => { Name => 'ExposureCompensation2', Format => 'rational32s', Unknown => 1, Hidden => 1, PrintConv => 'sprintf("%+.2f",$val)' },
1568
- # 5 - seen "10 1600", "10 6800", "10 200", "10 35000" etc
1569
- 5 => { Name => 'ExposureTime', Format => 'rational64u', PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)' },
1570
- # 6 - seen "450 100", "400 100" (all images in RAF have same value)
1571
- 6 => { Name => 'FNumber', Format => 'rational64u', PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)' },
1572
- # 7 - seen 200, 125, 250, 2000
1573
- 7 => 'ISO',
1574
- # 8 - seen 0, 65536
1599
+ group name for these tags is "M-RAW". Additional metadata may be extracted
1600
+ from the embedded RAW images with the ExtractEmbedded option.
1601
+ },
1602
+ 0x2001 => { Name => 'RawImageNumber', Format => 'int32u' },
1603
+ # 0x2003 - seen "0 100", "-300 100" and "300 100" for a sequence of 3 images
1604
+ 0x2003 => { Name => 'ExposureCompensation', Format => 'rational32s', Unknown => 1, Hidden => 1, PrintConv => 'sprintf("%+.2f",$val)' },
1605
+ # 0x2004 - (same value as 3 in all my samples)
1606
+ 0x2004 => { Name => 'ExposureCompensation2', Format => 'rational32s', Unknown => 1, Hidden => 1, PrintConv => 'sprintf("%+.2f",$val)' },
1607
+ # 0x2005 - seen "10 1600", "10 6800", "10 200", "10 35000" etc
1608
+ 0x2005 => { Name => 'ExposureTime', Format => 'rational64u', PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)' },
1609
+ # 0x2006 - seen "450 100", "400 100" (all images in RAF have same value)
1610
+ 0x2006 => { Name => 'FNumber', Format => 'rational64u', PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)' },
1611
+ # 0x2007 - seen 200, 125, 250, 2000
1612
+ 0x2007 => 'ISO',
1613
+ # 0x2008 - seen 0, 65536
1575
1614
  );
1576
1615
 
1577
1616
  #------------------------------------------------------------------------------
@@ -1684,6 +1723,7 @@ sub ProcessFujiDir($$$)
1684
1723
  sub ProcessMRAW($$$)
1685
1724
  {
1686
1725
  my ($et, $dirInfo, $tagTablePtr) = @_;
1726
+ return 1 if $$et{DOC_NUM};
1687
1727
  my $dataPt = $$dirInfo{DataPt};
1688
1728
  my $dataPos = $$dirInfo{DataPos};
1689
1729
  my $dataLen = length $$dataPt;
@@ -1697,15 +1737,16 @@ sub ProcessMRAW($$$)
1697
1737
  my $pos = 44;
1698
1738
  my ($i, $n);
1699
1739
  for ($n=0; ; ++$n) {
1700
- $pos += 16; # skip offset/size fields
1701
- my $end = $pos + $size;
1740
+ my $end = $pos + 16 + $size;
1702
1741
  last if $end > $dataLen;
1742
+ my $rafStart = Get64u($dataPt, $pos);
1743
+ my $rafLen = Get64u($dataPt, $pos+8);
1744
+ $pos += 16; # skip offset/size fields
1703
1745
  $$et{DOC_NUM} = ++$$et{DOC_COUNT} if $pos > 60;
1704
1746
  $et->VPrint(0, "$$et{INDENT}(Raw image $n parameters: $size bytes, $num entries)\n");
1705
1747
  for ($i=0; $i<$num; ++$i) {
1706
1748
  last if $pos + 4 > $end;
1707
- # (don't know what the byte at the current $pos is for, value = 0x20)
1708
- my $tag = Get8u($dataPt, $pos+1);
1749
+ my $tag = Get16u($dataPt, $pos);
1709
1750
  my $size = Get16u($dataPt, $pos+2);
1710
1751
  $pos += 4;
1711
1752
  last if $pos + $size > $end;
@@ -1717,6 +1758,21 @@ sub ProcessMRAW($$$)
1717
1758
  );
1718
1759
  $pos += $size;
1719
1760
  }
1761
+ if ($rafStart and $et->Options('ExtractEmbedded')) {
1762
+ if ($et->Options('Verbose')) {
1763
+ my $msg = sprintf("$$et{INDENT}(RAW image $n data: Start=0x%x, Length=0x%x)\n",$rafStart,$rafLen);
1764
+ $et->VPrint(0, $msg);
1765
+ }
1766
+ my $raf = $$et{RAF};
1767
+ my $tell = $raf->Tell();
1768
+ my $order = GetByteOrder();
1769
+ my $fujiWidth = $$et{FujiWidth};
1770
+ $raf->Seek($rafStart, 0) or next;
1771
+ ProcessRAF($et, { RAF => $raf, Base => $rafStart });
1772
+ $$et{FujiWidth} = $fujiWidth;
1773
+ SetByteOrder($order);
1774
+ $raf->Seek($tell, 0);
1775
+ }
1720
1776
  }
1721
1777
  delete $$et{DOC_NUM};
1722
1778
  return 1;
@@ -1816,7 +1872,6 @@ sub WriteRAF($$)
1816
1872
  # make sure padding is only zero bytes (can be >100k for HS10)
1817
1873
  # (have seen non-null padding in X-Pro1)
1818
1874
  if ($buff =~ /[^\0]/) {
1819
- HexDump(\$buff);
1820
1875
  return 1 if $et->Error('Non-null bytes found in padding', 2);
1821
1876
  }
1822
1877
  }
@@ -1871,6 +1926,7 @@ sub ProcessRAF($$)
1871
1926
  my ($buff, $jpeg, $warn, $offset);
1872
1927
 
1873
1928
  my $raf = $$dirInfo{RAF};
1929
+ my $base = $$dirInfo{Base} || 0;
1874
1930
  $raf->Read($buff,0x70) == 0x70 or return 0;
1875
1931
  $buff =~ /^FUJIFILM/ or return 0;
1876
1932
  # get position and size of M-RAW header and jpeg preview
@@ -1878,13 +1934,13 @@ sub ProcessRAF($$)
1878
1934
  my ($jpos, $jlen) = unpack('x84NN', $buff);
1879
1935
  $jpos & 0x8000 and return 0;
1880
1936
  if ($jpos) {
1881
- $raf->Seek($jpos, 0) or return 0;
1937
+ $raf->Seek($jpos+$base, 0) or return 0;
1882
1938
  $raf->Read($jpeg, $jlen) == $jlen or return 0;
1883
1939
  }
1884
1940
  SetByteOrder('MM');
1885
- $et->SetFileType();
1941
+ $et->SetFileType() unless $$et{DOC_NUM};
1886
1942
  my $tbl = GetTagTable('Image::ExifTool::FujiFilm::RAFHeader');
1887
- $et->ProcessDirectory({ DataPt => \$buff, DirName => 'RAFHeader' }, $tbl);
1943
+ $et->ProcessDirectory({ DataPt => \$buff, DirName => 'RAFHeader', Base => $base }, $tbl);
1888
1944
 
1889
1945
  # extract information from embedded JPEG
1890
1946
  my %dirInfo = (
@@ -1892,21 +1948,22 @@ sub ProcessRAF($$)
1892
1948
  RAF => File::RandomAccess->new(\$jpeg),
1893
1949
  );
1894
1950
  if ($jpos) {
1895
- $$et{BASE} += $jpos;
1951
+ $$et{BASE} += $jpos + $base;
1896
1952
  my $ok = $et->ProcessJPEG(\%dirInfo);
1897
- $$et{BASE} -= $jpos;
1953
+ $$et{BASE} -= $jpos + $base;
1898
1954
  $et->FoundTag('PreviewImage', \$jpeg) if $ok;
1899
1955
  }
1900
1956
  # extract information from Fuji RAF and TIFF directories
1901
1957
  my ($rafNum, $ifdNum) = ('','');
1902
1958
  foreach $offset (0x48, 0x5c, 0x64, 0x78, 0x80) {
1903
1959
  last if $jpos and $offset >= $jpos;
1904
- unless ($raf->Seek($offset, 0) and $raf->Read($buff, 8)) {
1960
+ unless ($raf->Seek($offset+$base, 0) and $raf->Read($buff, 8)) {
1905
1961
  $warn = 1;
1906
1962
  last;
1907
1963
  }
1908
1964
  my ($start, $len) = unpack('N2',$buff);
1909
1965
  next unless $start;
1966
+ $start += $base;
1910
1967
  if ($offset == 0x64 or $offset == 0x80) {
1911
1968
  # parse FujiIFD directory
1912
1969
  %dirInfo = (