exiftool_vendored 12.59.0 → 12.61.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a40c897eadb8162344b81eedcedd1888cfac911d28c1e5542f8e3d323af06768
4
- data.tar.gz: a761f6527a380e369e78c34d2c061a9652ae63a3da0b7e70be1854fb8b728ee6
3
+ metadata.gz: e42c8004f68374320f592b26a0d8ceaa0d44e09331c9be1f66986d2fe94ad7d0
4
+ data.tar.gz: eab311e1d2c27c522ed174ae054adc3d44e31c91992fdacbb6c6fb02e965da20
5
5
  SHA512:
6
- metadata.gz: 7edad248448957b58317b1621b2ae5b0c67276ee988ec1fb043403f299d6b0476ab7e79f4a15c345f9c655ff79518235350797b65b4b94cc5f80759511a44759
7
- data.tar.gz: a4cec80d9709c1145958d4c6590349bdf6b0fc18f041e62962fc736a660d0243a29abc5c68e481198c9b42e584cedc7f1536081c0c59ffd57f90caac704fb0ad
6
+ metadata.gz: 27e28a24360bd3651900c9db4b30ddff5517d777a8d6fa9723b80e758b71947697ca80e2149107be7ed6aac3c8b9ae37364d16126ddb2ee1a6c8aeaf8034e11a
7
+ data.tar.gz: 4845253fe922519e454c45d5e35e89b75a242ddf21183de8a6f5a32417d5cf814280161e46d2c722934175b4293f83ee1b0a2878bc6ea1c6fbd139cd105a6b25
data/bin/Changes CHANGED
@@ -4,9 +4,50 @@ 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 12.50. (Other versions are
7
+ Note: The most recent production release is Version 12.60. (Other versions are
8
8
  considered development releases, and are not uploaded to MetaCPAN.)
9
9
 
10
+ Apr. 24, 2023 - Version 12.61
11
+
12
+ - Added ImageDataMD5 support for J2C and JXL images
13
+ - Added support for PDF 2.0 (specification is finally freely available)
14
+ - Added ability to extract timed Accelerometer data from Azdome GS63H MP4
15
+ videos which don't contain GPS
16
+ - Added some new Sony lenses (thanks Jos Roost)
17
+ - Decode some new tags for the Sony ZV-E1 (thanks Jos Roost)
18
+ - Decode more tags for the Nikon Z30 (thanks Xavier)
19
+ - Enhanced -fileNUM option to allow tags from the main file to be used in the
20
+ file name string
21
+ - Validate sample offset and size when calculating ImageDataMD5 for MP4 videos
22
+ (note: may change ImageDataMD5 value for videos where audio data runs past
23
+ end of media data)
24
+ - Return error when attempting to write a fragmented JXL file
25
+ - Improved robustness for determining image size for corrupted JPEG
26
+ - Patched to allow Insta360 GPS records of unexpected length and tweaked
27
+ verification algorithm to determine validity of these records
28
+ - Fixed bug introduced in 12.57 where -progress:%f gave runtime warnings
29
+ - Fixed "--" option to ignore subsequent -common_args option
30
+ - Fixed incorrect ImageDataMD5 for Sony A100 ARW images
31
+ - Fixed problem reading new XMP-et:OriginalImageMD5 tag
32
+
33
+ Apr. 5, 2023 - Version 12.60 (production release)
34
+
35
+ - Added a new Sony FileFormat value
36
+ - Added Validate warning about duplicate EXIF
37
+ - Added ability to edit JPEG APP1 EXIF segment with incorrect header
38
+ - Decode a few new Sony ARW tags
39
+ - Improved -htmldump of non-EXIF-based maker notes
40
+ - Enhanced -geotag from CSV files support GPSSpeed (with variable units),
41
+ "bearing" for GPSTrack, and GPSDateTime in format "dd.mm.YYYY HH:MM:SS"
42
+ - Enhanced ImageDataMD5 to also support CRW, RAF, X3F and AVIF images
43
+ - Enhanced -efile option to also record updated and created file names
44
+ - Family 8 group names may now also be used in Composite Require/Desire tags
45
+ - Fixed handling of undefined tags in -if conditions to conform with
46
+ documentation and match -p and -tagsFromFile behaviour when -m or -f option
47
+ is used
48
+ - Fixed problem where setting the Geotime value didn't work when using an
49
+ advanced-formatting expression containing a greater-than symbol (>)
50
+
10
51
  Mar. 28, 2023 - Version 12.59
11
52
 
12
53
  - COMPATIBILITY WARNING: Changed the calculated ImageDataMD5 for JPEG images
@@ -20,14 +61,13 @@ Mar. 28, 2023 - Version 12.59
20
61
  - Decode a new Olympus tag and improved decoding of another (thanks Herb)
21
62
  - Decode a couple of new PanasonicRaw tags
22
63
  - Decode image coordinates for a couple more VNT object types
23
- - Enhanced ImageDataMD5 to also support MRW, CR3, PNG, MOV/MP4 and RIFF-based
24
- files
64
+ - Enhanced ImageDataMD5 to also support MRW, CR3, IIQ, PNG, MOV/MP4 and some
65
+ RIFF-based files
25
66
  - Improved verbose messages when deleting NikonApp trailer
26
67
  - Patched to avoid structure warnings when copying tags from Nikon files
27
68
  containing NKSC metadata
28
69
  - Fixed %-C filename format code to work properly with the -fileOrder and
29
70
  -progress options
30
- - Fixed new ImageDataMD5 tag to work properly with PhaseOne IIQ files
31
71
  - Fixed potential ValueConv warning when reading LIF files
32
72
  - API Changes:
33
73
  - Added SetAlternateFile method
@@ -196,6 +236,8 @@ Nov. 8, 2022 - Version 12.50 (production release)
196
236
  - Fixed inconsistent year and time zone for Kenwood dashcam timed GPS in MP4
197
237
  videos
198
238
 
239
+ History of older versions (back to Nov. 19, 2003 - Version 1.00) -->
240
+
199
241
  Oct. 19, 2022 - Version 12.49
200
242
 
201
243
  - Added read support for Windows ICO and CUR files
@@ -363,8 +405,6 @@ June 1, 2022 - Version 12.42 (production release)
363
405
  - Patched to allow PDF Encrypt object to be "null"
364
406
  - Fixed bug reading ICC_Profile 'meta' tags
365
407
 
366
- History of older versions (back to Nov. 19, 2003 - Version 1.00) -->
367
-
368
408
  Apr. 7, 2022 - Version 12.41
369
409
 
370
410
  - Added support for "OM SYSTEM" maker notes
data/bin/MANIFEST CHANGED
@@ -532,6 +532,7 @@ t/ExifTool_31.out
532
532
  t/ExifTool_32.out
533
533
  t/ExifTool_33.out
534
534
  t/ExifTool_34.out
535
+ t/ExifTool_35.out
535
536
  t/ExifTool_4.out
536
537
  t/ExifTool_5.out
537
538
  t/ExifTool_6.out
data/bin/META.json CHANGED
@@ -47,5 +47,5 @@
47
47
  }
48
48
  },
49
49
  "release_status" : "stable",
50
- "version" : "12.59"
50
+ "version" : "12.61"
51
51
  }
data/bin/META.yml CHANGED
@@ -28,4 +28,4 @@ recommends:
28
28
  Time::HiRes: 0
29
29
  requires:
30
30
  perl: 5.004
31
- version: 12.59
31
+ version: 12.61
data/bin/README CHANGED
@@ -107,8 +107,8 @@ your home directory, then you would type the following commands in a
107
107
  terminal window to extract and run ExifTool:
108
108
 
109
109
  cd ~/Desktop
110
- gzip -dc Image-ExifTool-12.59.tar.gz | tar -xf -
111
- cd Image-ExifTool-12.59
110
+ gzip -dc Image-ExifTool-12.61.tar.gz | tar -xf -
111
+ cd Image-ExifTool-12.61
112
112
  ./exiftool t/images/ExifTool.jpg
113
113
 
114
114
  Note: These commands extract meta information from one of the test images.
data/bin/exiftool CHANGED
@@ -11,7 +11,7 @@ use strict;
11
11
  use warnings;
12
12
  require 5.004;
13
13
 
14
- my $version = '12.59';
14
+ my $version = '12.61';
15
15
 
16
16
  # add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
17
17
  BEGIN {
@@ -365,13 +365,14 @@ sub Cleanup() {
365
365
 
366
366
  # isolate arguments common to all commands
367
367
  if (grep /^-common_args$/i, @ARGV) {
368
- my (@newArgs, $common);
368
+ my (@newArgs, $common, $end);
369
369
  foreach (@ARGV) {
370
- if (/^-common_args$/i) {
370
+ if (/^-common_args$/i and not $end) {
371
371
  $common = 1;
372
372
  } elsif ($common) {
373
373
  push @commonArgs, $_;
374
374
  } else {
375
+ $end = 1 if $_ eq '--';
375
376
  push @newArgs, $_;
376
377
  }
377
378
  }
@@ -922,12 +923,14 @@ for (;;) {
922
923
  $mt->Options(Duplicates => 1);
923
924
  next;
924
925
  }
925
- if (/^efile(\d)?(!)?$/i) {
926
+ if (/^efile(\d+)?(!)?$/i) {
926
927
  my $arg = shift;
927
928
  defined $arg or Error("Expecting file name for -$_ option\n"), $badCmd=1, next;
928
- $efile[0] = $arg if not $1 or $1 & 0x01;
929
- $efile[1] = $arg if $1 and $1 & 0x02;
930
- $efile[2] = $arg if $1 and $1 & 0x04;
929
+ $efile[0] = $arg if not $1 or $1 & 0x01;# error
930
+ $efile[1] = $arg if $1 and $1 & 0x02; # unchanged
931
+ $efile[2] = $arg if $1 and $1 & 0x04; # failed -if condition
932
+ $efile[3] = $arg if $1 and $1 & 0x08; # updated
933
+ $efile[4] = $arg if $1 and $1 & 0x016; # created
931
934
  unlink $arg if $2;
932
935
  next;
933
936
  }
@@ -1337,7 +1340,7 @@ for (;;) {
1337
1340
  AddSetTagsFile($setTagsFile = '@') if not $setTagsFile and /(<|>)/;
1338
1341
  if ($setTagsFile) {
1339
1342
  push @{$setTags{$setTagsFile}}, $_;
1340
- if (/>/) {
1343
+ if ($1 eq '>') {
1341
1344
  $useMWG = 1 if /^(.*>\s*)?mwg:/si;
1342
1345
  if (/\b(filename|directory|testname)#?$/i) {
1343
1346
  $doSetFileName = 1;
@@ -1949,23 +1952,31 @@ sub GetImageInfo($$)
1949
1952
  my (@foundTags, $info, $file, $ind, $g8);
1950
1953
 
1951
1954
  # set window title for this file if necessary
1952
- if (defined $windowTitle and $progressCount >= $progressNext) {
1953
- my $prog = $progressMax ? "$progressCount/$progressMax" : '0/0';
1954
- my $title = $windowTitle;
1955
- my ($num, $denom) = split '/', $prog;
1956
- my $frac = $num / ($denom || 1);
1957
- my $n = $title =~ s/%(\d+)b/%b/ ? $1 : 20; # length of bar
1958
- my $bar = int($frac * $n + 0.5);
1959
- my %lkup = (
1960
- b => ('I' x $bar) . ('.' x ($n - $bar)), # (undocumented)
1961
- f => $orig,
1962
- p => int(100 * $frac + 0.5),
1963
- r => $prog,
1964
- '%'=> '%',
1965
- );
1966
- $title =~ s/%([%bfpr])/$lkup{$1}/eg;
1967
- SetWindowTitle($title);
1968
- undef $progressNext;
1955
+ if (defined $windowTitle) {
1956
+ if ($progressCount >= $progressNext) {
1957
+ my $prog = $progressMax ? "$progressCount/$progressMax" : '0/0';
1958
+ my $title = $windowTitle;
1959
+ my ($num, $denom) = split '/', $prog;
1960
+ my $frac = $num / ($denom || 1);
1961
+ my $n = $title =~ s/%(\d+)b/%b/ ? $1 : 20; # length of bar
1962
+ my $bar = int($frac * $n + 0.5);
1963
+ my %lkup = (
1964
+ b => ('I' x $bar) . ('.' x ($n - $bar)),
1965
+ f => $orig,
1966
+ p => int(100 * $frac + 0.5),
1967
+ r => $prog,
1968
+ '%'=> '%',
1969
+ );
1970
+ $title =~ s/%([%bfpr])/$lkup{$1}/eg;
1971
+ SetWindowTitle($title);
1972
+ if (defined $progressMax) {
1973
+ undef $progressNext;
1974
+ } else {
1975
+ $progressNext += $progressIncr;
1976
+ }
1977
+ }
1978
+ # ($progressMax is not defined for "-progress:%f")
1979
+ ++$progressCount unless defined $progressMax;
1969
1980
  }
1970
1981
  unless (length $orig or $outOpt) {
1971
1982
  Warn qq(Error: Zero-length file name - ""\n);
@@ -1991,7 +2002,11 @@ sub GetImageInfo($$)
1991
2002
  }
1992
2003
  # set alternate file names
1993
2004
  foreach $g8 (sort keys %altFile) {
1994
- my $altName = FilenameSPrintf($altFile{$g8}, $orig);
2005
+ my $altName = $orig;
2006
+ # must double any '$' symbols in the original file name because
2007
+ # they are used for tag names in a -fileNUM argument
2008
+ $altName =~ s/\$/\$\$/g;
2009
+ $altName = FilenameSPrintf($altFile{$g8}, $altName);
1995
2010
  $et->SetAlternateFile($g8, $altName);
1996
2011
  }
1997
2012
 
@@ -2083,6 +2098,7 @@ sub GetImageInfo($$)
2083
2098
  push @delFiles, $original;
2084
2099
  } elsif ($et->Rename($original, $file)) {
2085
2100
  $verbose and print $vout "Restored from $original\n";
2101
+ EFile($file, 3);
2086
2102
  ++$countGoodWr;
2087
2103
  } else {
2088
2104
  Warn "Error renaming $original\n";
@@ -2533,6 +2549,7 @@ TAG: foreach $tag (@foundTags) {
2533
2549
  $xtra .= " et:table='${table}'";
2534
2550
  $xtra .= " et:index='${index}'" if defined $index;
2535
2551
  }
2552
+ # Note: New $xtra attributes must be added to %ignoreEtProp in XMP.pm!
2536
2553
  my $lastVal = $val;
2537
2554
  for ($valNum=0; $valNum<2; ++$valNum) {
2538
2555
  $val = FormatXML($val, $ind, $group);
@@ -3042,6 +3059,7 @@ sub SetImageInfo($$$)
3042
3059
  $r3 = $et->SetSystemTags($file);
3043
3060
  }
3044
3061
  if ($r0 > 0 or $r1 > 0 or $r2 > 0 or $r3 > 0) {
3062
+ EFile($infile, 3);
3045
3063
  ++$countGoodWr;
3046
3064
  } elsif ($r0 < 0 or $r1 < 0 or $r2 < 0 or $r3 < 0) {
3047
3065
  EFile($infile);
@@ -3156,6 +3174,7 @@ sub SetImageInfo($$$)
3156
3174
  $preserveTime{$file} = [ $aTime, $mTime, $cTime ];
3157
3175
  }
3158
3176
  }
3177
+ EFile($infile, 3);
3159
3178
  ++$countGoodWr;
3160
3179
  } else {
3161
3180
  close(NEW_FILE);
@@ -3171,6 +3190,7 @@ sub SetImageInfo($$$)
3171
3190
  # simply rename temporary file to replace original
3172
3191
  # (if we didn't already rename it to add "_original")
3173
3192
  } elsif ($et->Rename($tmpFile, $dstFile)) {
3193
+ EFile($infile, 3);
3174
3194
  ++$countGoodWr;
3175
3195
  } else {
3176
3196
  my $newFile = $tmpFile;
@@ -3188,21 +3208,26 @@ sub SetImageInfo($$$)
3188
3208
  # (don't delete tmp file now because it is all we have left)
3189
3209
  ++$countBadWr;
3190
3210
  } else {
3211
+ EFile($infile, 3);
3191
3212
  ++$countGoodWr;
3192
3213
  }
3193
3214
  }
3194
3215
  } elsif ($overwriteOrig) {
3195
3216
  # erase original file
3217
+ EFile($infile, 3);
3196
3218
  $et->Unlink($file) or Warn "Error erasing original $file\n";
3197
3219
  ++$countGoodWr;
3198
3220
  } else {
3221
+ EFile($infile, 4);
3199
3222
  ++$countGoodCr;
3200
3223
  }
3201
3224
  } else {
3202
3225
  # this file was created from scratch, not edited
3226
+ EFile($infile, 4);
3203
3227
  ++$countGoodCr;
3204
3228
  }
3205
3229
  } else {
3230
+ EFile($infile, 3);
3206
3231
  ++$countGoodWr;
3207
3232
  }
3208
3233
  } elsif ($success) {
@@ -3689,7 +3714,7 @@ sub ProcessFiles($;$)
3689
3714
  if (defined $progressMax) {
3690
3715
  unless (defined $progressNext) {
3691
3716
  $progressNext = $progressCount + $progressIncr;
3692
- $progressNext -= $progressNext % $progressIncr;
3717
+ $progressNext -= $progressNext % $progressIncr; # (show even multiples)
3693
3718
  $progressNext = $progressMax if $progressNext > $progressMax;
3694
3719
  }
3695
3720
  ++$progressCount;
@@ -4439,7 +4464,7 @@ sub ReadStayOpen($)
4439
4464
 
4440
4465
  #------------------------------------------------------------------------------
4441
4466
  # Add new entry to -efile output file
4442
- # Inputs: 0) file name, 1) -efile option number (0=error, 1=same, 2=failed)
4467
+ # Inputs: 0) file name, 1) -efile option number (0=error, 1=same, 2=failed, 3=updated, 4=created)
4443
4468
  sub EFile($$)
4444
4469
  {
4445
4470
  my $entry = shift;
@@ -4468,7 +4493,7 @@ sub Progress($$)
4468
4493
  my ($file, $msg) = @_;
4469
4494
  if (defined $progStr) {
4470
4495
  print $file $msg, $progStr, "\n";
4471
- undef $progressNext;
4496
+ undef $progressNext if defined $progressMax;
4472
4497
  }
4473
4498
  }
4474
4499
 
@@ -4658,7 +4683,7 @@ L<Tag operations|/Tag operations>
4658
4683
  -TAG or --TAG Extract or exclude specified tag
4659
4684
  -TAG[+-^]=[VALUE] Write new value for tag
4660
4685
  -TAG[+-]<=DATFILE Write tag value from contents of file
4661
- -TAG[+-]<SRCTAG Copy tag value (see -tagsFromFile)
4686
+ -[+]TAG[+-]<SRCTAG Copy tag value (see -tagsFromFile)
4662
4687
 
4663
4688
  -tagsFromFile SRCFILE Copy tag values from file
4664
4689
  -x TAG (-exclude) Exclude specified tag
@@ -5301,12 +5326,12 @@ escaped. The inverse conversion is applied when writing tags.
5301
5326
 
5302
5327
  =item B<-f> (B<-forcePrint>)
5303
5328
 
5304
- Force printing of tags even if their values are not found. This option only
5305
- applies when specific tags are requested on the command line (ie. not with
5306
- wildcards or by C<-all>). With this option, a dash (C<->) is printed for
5307
- the value of any missing tag, but the dash may be changed via the API
5308
- MissingTagValue option. May also be used to add a 'flags' attribute to the
5309
- B<-listx> output, or to allow tags to be deleted when writing with the
5329
+ Force printing of tags even if they don't exist. This option applies to
5330
+ tags specified on the command line, or with the B<-p>, B<-if> or
5331
+ B<-tagsFromFile> options. When B<-f> is used, the value of any missing tag
5332
+ is set to a dash (C<->) by default, but this may be configured via the API
5333
+ MissingTagValue option. B<-f> is also used to add a 'flags' attribute to
5334
+ the B<-listx> output, or to allow tags to be deleted when writing with the
5310
5335
  B<-csv>=I<CSVFILE> feature.
5311
5336
 
5312
5337
  =item B<-g>[I<NUM>][:I<NUM>...] (B<-groupHeadings>)
@@ -5530,7 +5555,7 @@ with this command:
5530
5555
 
5531
5556
  produces output like this:
5532
5557
 
5533
- -- Generated by ExifTool 12.59 --
5558
+ -- Generated by ExifTool 12.61 --
5534
5559
  File: a.jpg - 2003:10:31 15:44:19
5535
5560
  (f/5.6, 1/60s, ISO 100)
5536
5561
  File: b.jpg - 2006:05:23 11:57:38
@@ -6512,10 +6537,11 @@ exit status of the command (see L</EXIT STATUS>).
6512
6537
 
6513
6538
  Save the names of files giving errors (I<NUM> missing or 1), files that were
6514
6539
  unchanged (I<NUM> is 2), files that fail the B<-if> condition (I<NUM> is 4),
6515
- or any combination thereof by summing I<NUM> (eg. B<-efile3> is the same
6516
- has having both B<-efile> and B<-efile2> options with the same I<ERRFILE>).
6517
- By default, file names are appended to any existing I<ERRFILE>, but
6518
- I<ERRFILE> is overwritten if an exclamation point is added to the option
6540
+ files that were updated (I<NUM> is 8), files that were created (I<NUM> is
6541
+ 16), or any combination thereof by summing I<NUM> (eg. B<-efile3> is the
6542
+ same has having both B<-efile> and B<-efile2> options with the same
6543
+ I<ERRFILE>). By default, file names are appended to any existing I<ERRFILE>,
6544
+ but I<ERRFILE> is overwritten if an exclamation point is added to the option
6519
6545
  (eg. B<-efile!>). Saves the name of the file specified by the B<-srcfile>
6520
6546
  option if applicable.
6521
6547
 
@@ -6532,11 +6558,22 @@ option no longer suppresses the output "{readyNUM}" message.
6532
6558
 
6533
6559
  =item B<-file>I<NUM> I<ALTFILE>
6534
6560
 
6535
- Read tags from an alternate source file. These tags are accessed via the
6536
- family 8 group name (eg. C<File1:TAG>, C<File2:TAG>, etc). I<ALTFILE> may
6537
- contain filename formatting codes %d, %f and %e. Among other things, this
6538
- allows tags from different files to be compared and combined using the
6539
- B<-if> and B<-p> options.
6561
+ Read tags from an alternate source file. Among other things, this allows
6562
+ tags from different files to be compared and combined using the B<-if> and
6563
+ B<-p> options. Tags from alternate files are accessed via the corresponding
6564
+ family 8 group name (eg. C<File1:TAG> for the B<-file1> option, C<File2:TAG>
6565
+ for B<-file2>, etc). I<ALTFILE> may contain filename formatting codes like
6566
+ the B<-w> option (%d, %f, etc) , and/or tag names with a leading C<$> symbol
6567
+ in the same way as the B<-p> option (so any other dollar symbol in the file
6568
+ name must be doubled, eg. C<money$$.jpg>). For example, assuming that the
6569
+ OriginalFileName tag has been set in the edited file, a command to copy
6570
+ Rights from the original file could look like this:
6571
+
6572
+ exiftool -file1 '$originalfilename' '-rights<file1:rights' edited.jpg
6573
+
6574
+ Tag names in a B<-fileNUM> argument may access any tag from the original
6575
+ file except for Composite tags, and any tag from earlier (alphabetically
6576
+ sorted) B<-fileNUM> options (including Composite tags).
6540
6577
 
6541
6578
  =item B<-list_dir>
6542
6579
 
@@ -21,7 +21,7 @@ use Image::ExifTool qw(:DataAccess :Utils);
21
21
  use Image::ExifTool::Exif;
22
22
  use Image::ExifTool::Canon;
23
23
 
24
- $VERSION = '1.59';
24
+ $VERSION = '1.60';
25
25
 
26
26
  sub WriteCRW($$);
27
27
  sub ProcessCanonRaw($$$);
@@ -698,6 +698,10 @@ sub ProcessCanonRaw($$$)
698
698
  $format ne 'string' and not $subdir;
699
699
  } else {
700
700
  $valueDataPos = $ptr;
701
+ # do MD5 of image data if requested
702
+ if ($$et{ImageDataMD5} and $tagID == 0x2005) {
703
+ $raf->Seek($ptr, 0) and $et->ImageDataMD5($raf, $size, 'raw');
704
+ }
701
705
  if ($size <= 512 or ($verbose > 2 and $size <= 65536)
702
706
  or ($tagInfo and ($$tagInfo{SubDirectory}
703
707
  or grep(/^$$tagInfo{Name}$/i, $et->GetRequestedTags()) )))
@@ -56,7 +56,7 @@ use vars qw($VERSION $AUTOLOAD @formatSize @formatName %formatNumber %intFormat
56
56
  use Image::ExifTool qw(:DataAccess :Utils);
57
57
  use Image::ExifTool::MakerNotes;
58
58
 
59
- $VERSION = '4.43';
59
+ $VERSION = '4.44';
60
60
 
61
61
  sub ProcessExif($$$);
62
62
  sub WriteExif($$$);
@@ -1511,9 +1511,10 @@ my %opcodeInfo = (
1511
1511
  0x7031 => {
1512
1512
  Name => 'VignettingCorrection',
1513
1513
  Notes => 'found in Sony ARW images',
1514
- Protected => 1,
1515
1514
  Writable => 'int16s',
1516
1515
  WriteGroup => 'SubIFD',
1516
+ Permanent => 1,
1517
+ Protected => 1,
1517
1518
  PrintConv => {
1518
1519
  256 => 'Off',
1519
1520
  257 => 'Auto',
@@ -1524,17 +1525,19 @@ my %opcodeInfo = (
1524
1525
  0x7032 => {
1525
1526
  Name => 'VignettingCorrParams', #forum7640
1526
1527
  Notes => 'found in Sony ARW images',
1527
- Protected => 1,
1528
1528
  Writable => 'int16s',
1529
1529
  WriteGroup => 'SubIFD',
1530
1530
  Count => 17,
1531
+ Permanent => 1,
1532
+ Protected => 1,
1531
1533
  },
1532
1534
  0x7034 => {
1533
1535
  Name => 'ChromaticAberrationCorrection',
1534
1536
  Notes => 'found in Sony ARW images',
1535
- Protected => 1,
1536
1537
  Writable => 'int16s',
1537
1538
  WriteGroup => 'SubIFD',
1539
+ Permanent => 1,
1540
+ Protected => 1,
1538
1541
  PrintConv => {
1539
1542
  0 => 'Off',
1540
1543
  1 => 'Auto',
@@ -1544,17 +1547,19 @@ my %opcodeInfo = (
1544
1547
  0x7035 => {
1545
1548
  Name => 'ChromaticAberrationCorrParams', #forum6509
1546
1549
  Notes => 'found in Sony ARW images',
1547
- Protected => 1,
1548
1550
  Writable => 'int16s',
1549
1551
  WriteGroup => 'SubIFD',
1550
1552
  Count => 33,
1553
+ Permanent => 1,
1554
+ Protected => 1,
1551
1555
  },
1552
1556
  0x7036 => {
1553
1557
  Name => 'DistortionCorrection',
1554
1558
  Notes => 'found in Sony ARW images',
1555
- Protected => 1,
1556
1559
  Writable => 'int16s',
1557
1560
  WriteGroup => 'SubIFD',
1561
+ Permanent => 1,
1562
+ Protected => 1,
1558
1563
  PrintConv => {
1559
1564
  0 => 'Off',
1560
1565
  1 => 'Auto',
@@ -1565,10 +1570,38 @@ my %opcodeInfo = (
1565
1570
  0x7037 => {
1566
1571
  Name => 'DistortionCorrParams', #forum6509
1567
1572
  Notes => 'found in Sony ARW images',
1568
- Protected => 1,
1569
1573
  Writable => 'int16s',
1570
1574
  WriteGroup => 'SubIFD',
1571
1575
  Count => 17,
1576
+ Permanent => 1,
1577
+ Protected => 1,
1578
+ },
1579
+ 0x7038 => { #github#195 (Sony ARW)
1580
+ Name => 'SonyRawImageSize',
1581
+ Notes => 'size of actual image in Sony ARW files',
1582
+ Writable => 'int32u',
1583
+ WriteGroup => 'SubIFD',
1584
+ Count => 2,
1585
+ Permanent => 1,
1586
+ Protected => 1,
1587
+ },
1588
+ 0x7310 => { #github#195 (Sony ARW)
1589
+ Name => 'BlackLevel',
1590
+ Notes => 'found in Sony ARW images',
1591
+ Writable => 'int16u',
1592
+ WriteGroup => 'SubIFD',
1593
+ Count => 4,
1594
+ Permanent => 1,
1595
+ Protected => 1,
1596
+ },
1597
+ 0x7313 => { #github#195 (Sony ARW)
1598
+ Name => 'WB_RGGBLevels',
1599
+ Notes => 'found in Sony ARW images',
1600
+ Writable => 'int16s',
1601
+ WriteGroup => 'SubIFD',
1602
+ Count => 4,
1603
+ Permanent => 1,
1604
+ Protected => 1,
1572
1605
  },
1573
1606
  0x74c7 => { #IB (in ARW images from some Sony cameras)
1574
1607
  Name => 'SonyCropTopLeft',
@@ -5893,9 +5926,7 @@ sub ProcessExif($$$)
5893
5926
  my $base = $$dirInfo{Base} || 0;
5894
5927
  my $firstBase = $base;
5895
5928
  my $raf = $$dirInfo{RAF};
5896
- my $verbose = $et->Options('Verbose');
5897
- my $validate = $et->Options('Validate');
5898
- my $saveFormat = $et->Options('SaveFormat');
5929
+ my ($verbose,$validate,$saveFormat) = @{$$et{OPTIONS}}{qw(Verbose Validate SaveFormat)};
5899
5930
  my $htmlDump = $$et{HTML_DUMP};
5900
5931
  my $success = 1;
5901
5932
  my ($tagKey, $dirSize, $makerAddr, $strEnc, %offsetInfo, $offName, $nextOffName, $doMD5);
@@ -5914,7 +5945,12 @@ sub ProcessExif($$$)
5914
5945
  $isExif and $$et{FILE_TYPE} =~ /^(JPEG|TIFF|PSD)$/)
5915
5946
  {
5916
5947
  my $path = $et->MetadataPath();
5917
- unless ($path =~ /^(JPEG-APP1-IFD0|TIFF-IFD0|PSD-EXIFInfo-IFD0)$/) {
5948
+ if ($path =~ /^(JPEG-APP1-IFD0|TIFF-IFD0|PSD-EXIFInfo-IFD0)$/) {
5949
+ unless ($$et{DOC_NUM}) {
5950
+ $et->Warn("Duplicate EXIF at $path") if $$et{HasExif};
5951
+ $$et{HasExif} = 1;
5952
+ }
5953
+ } else {
5918
5954
  if ($Image::ExifTool::MWG::strict) {
5919
5955
  $et->Warn("Ignored non-standard EXIF at $path");
5920
5956
  return 0;
@@ -6378,10 +6414,10 @@ sub ProcessExif($$$)
6378
6414
  $tval .= " ($rational)" if defined $rational;
6379
6415
  if ($htmlDump) {
6380
6416
  my ($tagName, $colName);
6381
- if ($tagID == 0x927c and $dirName eq 'ExifIFD') {
6382
- $tagName = 'MakerNotes';
6383
- } elsif ($tagInfo) {
6417
+ if ($tagInfo) {
6384
6418
  $tagName = $$tagInfo{Name};
6419
+ } elsif ($tagID == 0x927c and $dirName eq 'ExifIFD') {
6420
+ $tagName = 'MakerNotes';
6385
6421
  } else {
6386
6422
  $tagName = sprintf("Tag 0x%.4x",$tagID);
6387
6423
  }
@@ -6456,6 +6492,9 @@ sub ProcessExif($$$)
6456
6492
  }
6457
6493
  # add value data block (underlining maker notes data)
6458
6494
  $et->HDump($exifDumpPos,$size,"$tagName value",'SAME', $flag, $sid);
6495
+ if ($subdir and $$tagInfo{MakerNotes} and $$tagInfo{NotIFD}) {
6496
+ $et->HDump($exifDumpPos,$size,"$tagName value",undef,undef,$$dirInfo{OffsetName});
6497
+ }
6459
6498
  }
6460
6499
  } else {
6461
6500
  if ($tagID <= $lastID and not $inMakerNotes) {
@@ -1671,11 +1671,11 @@ sub ProcessRAF($$)
1671
1671
  my ($rafNum, $ifdNum) = ('','');
1672
1672
  foreach $offset (0x5c, 0x64, 0x78, 0x80) {
1673
1673
  last if $offset >= $jpos;
1674
- unless ($raf->Seek($offset, 0) and $raf->Read($buff, 4)) {
1674
+ unless ($raf->Seek($offset, 0) and $raf->Read($buff, 8)) {
1675
1675
  $warn = 1;
1676
1676
  last;
1677
1677
  }
1678
- my $start = unpack('N',$buff);
1678
+ my ($start, $len) = unpack('N2',$buff);
1679
1679
  next unless $start;
1680
1680
  if ($offset == 0x64 or $offset == 0x80) {
1681
1681
  # parse FujiIFD directory
@@ -1686,7 +1686,10 @@ sub ProcessRAF($$)
1686
1686
  $$et{SET_GROUP1} = "FujiIFD$ifdNum";
1687
1687
  my $tagTablePtr = GetTagTable('Image::ExifTool::FujiFilm::IFD');
1688
1688
  # this is TIFF-format data only for some models, so no warning if it fails
1689
- $et->ProcessTIFF(\%dirInfo, $tagTablePtr, \&Image::ExifTool::ProcessTIFF);
1689
+ unless ($et->ProcessTIFF(\%dirInfo, $tagTablePtr, \&Image::ExifTool::ProcessTIFF)) {
1690
+ # do MD5 of image data if necessary
1691
+ $et->ImageDataMD5($raf, $len, 'raw') if $$et{ImageDataMD5} and $raf->Seek($start,0);
1692
+ }
1690
1693
  delete $$et{SET_GROUP1};
1691
1694
  $ifdNum = ($ifdNum || 1) + 1;
1692
1695
  } else {