exiftool_vendored 13.29.0 → 13.31.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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +43 -1
  3. data/bin/META.json +4 -3
  4. data/bin/META.yml +3 -2
  5. data/bin/README +2 -2
  6. data/bin/config_files/pix4d.config +9 -8
  7. data/bin/exiftool +14 -8
  8. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +1 -1
  9. data/bin/lib/Image/ExifTool/Canon.pm +8 -3
  10. data/bin/lib/Image/ExifTool/Exif.pm +5 -2
  11. data/bin/lib/Image/ExifTool/FujiFilm.pm +5 -1
  12. data/bin/lib/Image/ExifTool/Geolocation.dat +0 -0
  13. data/bin/lib/Image/ExifTool/GoPro.pm +10 -3
  14. data/bin/lib/Image/ExifTool/LNK.pm +21 -3
  15. data/bin/lib/Image/ExifTool/Lang/de.pm +2 -1
  16. data/bin/lib/Image/ExifTool/Lang/fr.pm +2 -1
  17. data/bin/lib/Image/ExifTool/LigoGPS.pm +15 -7
  18. data/bin/lib/Image/ExifTool/MakerNotes.pm +3 -3
  19. data/bin/lib/Image/ExifTool/Nikon.pm +10 -3
  20. data/bin/lib/Image/ExifTool/Olympus.pm +5 -1
  21. data/bin/lib/Image/ExifTool/PDF.pm +1 -0
  22. data/bin/lib/Image/ExifTool/Panasonic.pm +1 -1
  23. data/bin/lib/Image/ExifTool/Parrot.pm +1 -1
  24. data/bin/lib/Image/ExifTool/Pentax.pm +56 -14
  25. data/bin/lib/Image/ExifTool/Plot.pm +2 -3
  26. data/bin/lib/Image/ExifTool/QuickTime.pm +23 -3
  27. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +51 -17
  28. data/bin/lib/Image/ExifTool/Sigma.pm +30 -4
  29. data/bin/lib/Image/ExifTool/Sony.pm +3 -3
  30. data/bin/lib/Image/ExifTool/TagLookup.pm +3738 -3729
  31. data/bin/lib/Image/ExifTool/TagNames.pod +27 -9
  32. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
  33. data/bin/lib/Image/ExifTool/Writer.pl +128 -129
  34. data/bin/lib/Image/ExifTool.pm +11 -8
  35. data/bin/perl-Image-ExifTool.spec +1 -1
  36. data/lib/exiftool_vendored/version.rb +1 -1
  37. metadata +2 -2
@@ -12,7 +12,7 @@ meta information extracted from or written to a file.
12
12
  =head1 TAG TABLES
13
13
 
14
14
  The tables listed below give the names of all tags recognized by ExifTool.
15
- They contain a total of 28445 tags, with 17669 unique tag names.
15
+ They contain a total of 28455 tags, with 17676 unique tag names.
16
16
 
17
17
  B<Tag ID>, B<Index#> or B<Sequence> is given in the first column of each
18
18
  table. A B<Tag ID> is the computer-readable equivalent of a tag name, and
@@ -20349,6 +20349,7 @@ These tags are used in Pentax/Asahi cameras.
20349
20349
  0x0230 FirmwareVersion string
20350
20350
  0x0231 ContrastDetectAFArea int16u[4]
20351
20351
  0x0235 CrossProcessParams undef[10]
20352
+ 0x0238 CAFPointInfo Pentax CAFPointInfo
20352
20353
  0x0239 LensInfoQ Pentax LensInfoQ
20353
20354
  0x023f Model string
20354
20355
  0x0243 PixelShiftInfo Pentax PixelShiftInfo
@@ -20873,6 +20874,17 @@ valid for other models.
20873
20874
  83 WB_RGGBLevelsUnknown? int16u[4]
20874
20875
  92 WB_RGGBLevelsUserSelected int16u[4]
20875
20876
 
20877
+ =head3 Pentax CAFPointInfo Tags
20878
+
20879
+ Contrast-detect AF-point information for the K-01 and later models.
20880
+
20881
+ Index1 Tag Name Writable
20882
+ ------ -------- --------
20883
+ 1 NumCAFPoints no
20884
+ 1.1 CAFGridSize no
20885
+ 2 CAFPointsInFocus no
20886
+ 2.1 CAFPointsSelected no
20887
+
20876
20888
  =head3 Pentax LensInfoQ Tags
20877
20889
 
20878
20890
  More lens information stored by the Pentax Q.
@@ -20897,9 +20909,9 @@ AF point information written by the K-1.
20897
20909
  Index1 Tag Name Writable
20898
20910
  ------ -------- --------
20899
20911
  2 NumAFPoints int16u
20900
- 4 AFPointsInFocus int8u[9]~
20901
- 4.1 AFPointsSelected int8u[9]~
20902
- 4.2 AFPointsSpecial int8u[9]~
20912
+ 4 AFPointsInFocus no
20913
+ 4.1 AFPointsSelected no
20914
+ 4.2 AFPointsSpecial no
20903
20915
 
20904
20916
  =head3 Pentax TempInfo Tags
20905
20917
 
@@ -21799,6 +21811,7 @@ are less than consistent about their metadata formats.
21799
21811
  0x003b Firmware string
21800
21812
  0x003c WhiteBalance string
21801
21813
  0x003d PictureMode string
21814
+ 0x0047 ExposureCompensation rational64s
21802
21815
  0x0048 LensApertureRange string
21803
21816
  0x0049 FNumber rational64u
21804
21817
  0x004a ExposureTime rational64u
@@ -21814,9 +21827,12 @@ are less than consistent about their metadata formats.
21814
21827
  0x0087 ResolutionMode string
21815
21828
  0x0088 WhiteBalance string
21816
21829
  0x008c Firmware string
21830
+ 0x0113 PictureModeStrength int32s
21817
21831
  0x011f CameraCalibration float[9]
21818
21832
  0x0120 WBSettings Sigma WBSettings
21819
21833
  0x0121 WBSettings2 Sigma WBSettings2
21834
+ 0x0138 Fade rational64u
21835
+ 0x0139 Vignette rational64u
21820
21836
 
21821
21837
  =head3 Sigma WBSettings Tags
21822
21838
 
@@ -29652,10 +29668,11 @@ C2PA JUMBF metadata extracted from "/C2PA_Manifest" file.
29652
29668
 
29653
29669
  =head3 PDF Pages Tags
29654
29670
 
29655
- Tag ID Tag Name Writable
29656
- ------ -------- --------
29657
- 'Count' PageCount no
29658
- 'Kids' Kids PDF Kids
29671
+ Tag ID Tag Name Writable
29672
+ ------ -------- --------
29673
+ 'Count' PageCount no
29674
+ 'Kids' Kids PDF Kids
29675
+ 'MediaBox' MediaBox no+
29659
29676
 
29660
29677
  =head3 PDF Kids Tags
29661
29678
 
@@ -30368,7 +30385,7 @@ for the official QuickTime specification.
30368
30385
  The tags below are extracted from timed metadata in QuickTime and other
30369
30386
  formats of video files when the ExtractEmbedded option is used. Although
30370
30387
  most of these tags are combined into the single table below, ExifTool
30371
- currently reads 107 different types of timed GPS metadata from video files.
30388
+ currently reads 110 different types of timed GPS metadata from video files.
30372
30389
 
30373
30390
  Tag ID Tag Name Writable
30374
30391
  ------ -------- --------
@@ -31655,6 +31672,7 @@ the config file.
31655
31672
  'RMKN' RicohRMKN EXIF
31656
31673
  'RTHU' PreviewImage no
31657
31674
  'SDLN' PlayMode string
31675
+ 'SIGM' PreviewImage no
31658
31676
  'SNum' SerialNumber string/
31659
31677
  'SelO' PlaySelection int8u
31660
31678
  'TAGS' FujiFilmTags FujiFilm MOV
@@ -81,6 +81,7 @@ sub WritePDFValue($$$)
81
81
  EncodeString(\$val);
82
82
  } elsif ($format eq 'date') {
83
83
  # convert date to "D:YYYYmmddHHMMSS+-HH'MM'" format
84
+ $val =~ s/(:\d{2})\.\d*/$1/; # remove sub-seconds
84
85
  $val =~ s/([-+]\d{2}):(\d{2})/${1}'${2}'/; # change timezone delimiters if necessary
85
86
  $val =~ tr/ ://d; # remove spaces and colons
86
87
  $val = "D:$val"; # add leading "D:"
@@ -3410,7 +3410,7 @@ sub InsertTagValues($$;$$$$)
3410
3410
  my $msg = $didExpr ? "Advanced formatting expression returned undef for '$g3${var}'" :
3411
3411
  "Tag '$g3${var}' not defined";
3412
3412
  if (ref $opt) {
3413
- $self->Warn($msg,2) or $val = '';
3413
+ $val = '' if $$self{OPTIONS}{IgnoreMinorErrors};
3414
3414
  } elsif ($opt) {
3415
3415
  no strict 'refs';
3416
3416
  ($opt eq 'Silent' or &$opt($self, $msg, 2)) and return $$self{FMT_EXPR} = undef;
@@ -4741,10 +4741,11 @@ sub DumpUnknownTrailer($$)
4741
4741
  my $pos = $$dirInfo{DataPos};
4742
4742
  my $endPos = $pos + $$dirInfo{DirLen};
4743
4743
  # account for preview/MPF image trailer
4744
- my $prePos = $$self{VALUE}{PreviewImageStart} || $$self{PreviewImageStart};
4745
- my $preLen = $$self{VALUE}{PreviewImageLength} || $$self{PreviewImageLength};
4746
- my $hidPos = $$self{VALUE}{HiddenDataOffset};
4747
- my $hidLen = $$self{VALUE}{HiddenDataLength};
4744
+ my $value = $$self{VALUE};
4745
+ my $prePos = $$value{PreviewImageStart} || $$self{PreviewImageStart};
4746
+ my $preLen = $$value{PreviewImageLength} || $$self{PreviewImageLength};
4747
+ my $hidPos = $$value{HiddenDataOffset};
4748
+ my $hidLen = $$value{HiddenDataLength};
4748
4749
  my $tag = 'PreviewImage';
4749
4750
  my $mpImageNum = 0;
4750
4751
  my (%image, $lastOne);
@@ -4761,12 +4762,12 @@ sub DumpUnknownTrailer($$)
4761
4762
  last if $lastOne; # checked all images
4762
4763
  # look for MPF images (in the proper order)
4763
4764
  ++$mpImageNum;
4764
- $prePos = $$self{VALUE}{"MPImageStart ($mpImageNum)"};
4765
+ $prePos = $$value{"MPImageStart ($mpImageNum)"};
4765
4766
  if (defined $prePos) {
4766
- $preLen = $$self{VALUE}{"MPImageLength ($mpImageNum)"};
4767
+ $preLen = $$value{"MPImageLength ($mpImageNum)"};
4767
4768
  } else {
4768
- $prePos = $$self{VALUE}{'MPImageStart'};
4769
- $preLen = $$self{VALUE}{'MPImageLength'};
4769
+ $prePos = $$value{MPImageStart};
4770
+ $preLen = $$value{MPImageLength};
4770
4771
  $lastOne = 1;
4771
4772
  }
4772
4773
  $tag = "MPImage$mpImageNum";
@@ -5887,10 +5888,10 @@ sub WriteJPEG($$)
5887
5888
  $writeBuffer = '';
5888
5889
  $oldOutfile = $outfile;
5889
5890
  $outfile = \$writeBuffer;
5890
- # account for segment, EXIF and TIFF headers
5891
- $$self{PREVIEW_INFO}{Fixup}{Start} += 18 if $$self{PREVIEW_INFO};
5892
- $$self{LeicaTrailer}{Fixup}{Start} += 18 if $$self{LeicaTrailer};
5893
- $$self{HiddenData}{Fixup}{Start} += 18 if $$self{HiddenData};
5891
+ # must account for segment, EXIF and TIFF headers
5892
+ foreach (qw(PREVIEW_INFO LeicaTrailer HiddenData)) {
5893
+ $$self{$_}{Fixup}{Start} += 18 if $$self{$_};
5894
+ }
5894
5895
  }
5895
5896
  # write as multi-segment
5896
5897
  my $n = WriteMultiSegment($outfile, 0xe1, $exifAPP1hdr, \$buff, 'EXIF');
@@ -6036,8 +6037,8 @@ sub WriteJPEG($$)
6036
6037
  my $delPreview = $$self{DEL_PREVIEW};
6037
6038
  $trailInfo = $self->IdentifyTrailer($raf) unless $$delGroup{Trailer};
6038
6039
  my $nvTrail = $self->GetNewValueHash($Image::ExifTool::Extra{Trailer});
6039
- unless ($oldOutfile or $delPreview or $trailInfo or $$delGroup{Trailer} or $nvTrail or
6040
- $$self{HiddenData})
6040
+ unless ($oldOutfile or $delPreview or $trailInfo or $$delGroup{Trailer} or
6041
+ $nvTrail or $$self{HiddenData})
6041
6042
  {
6042
6043
  # blindly copy the rest of the file
6043
6044
  while ($raf->Read($buff, 65536)) {
@@ -6082,35 +6083,7 @@ sub WriteJPEG($$)
6082
6083
  }
6083
6084
  last; # all done
6084
6085
  }
6085
- # copy HiddenData if necessary
6086
- if ($$self{HiddenData}) {
6087
- my $pad;
6088
- my $hd = $$self{HiddenData};
6089
- my $hdOff = $$hd{Offset} + $$hd{Base};
6090
- require Image::ExifTool::Sony;
6091
- # read HiddenData, updating $hdOff with actual offset if necessary
6092
- my $dataPt = Image::ExifTool::Sony::ReadHiddenData($self, $hdOff, $$hd{Size});
6093
- if ($dataPt) {
6094
- # preserve padding to avoid invalidating MPF pointers (yuk!)
6095
- my $padLen = $hdOff - $endPos;
6096
- unless ($padLen >= 0 and $raf->Seek($endPos,0) and $raf->Read($pad,$padLen)==$padLen) {
6097
- $self->Error('Error reading HiddenData padding',1);
6098
- $pad = '';
6099
- }
6100
- $endPos += length($pad) + length($$dataPt); # update end position
6101
- } else {
6102
- $$dataPt = $pad = '';
6103
- }
6104
- my $fixup = $$self{HiddenData}{Fixup};
6105
- # set MakerNote pointer and size (subtract 10 for segment and EXIF headers)
6106
- $fixup->SetMarkerPointers($outfile, 'HiddenData', length($$outfile) + length($pad) - 10);
6107
- # clean up and write the buffered data
6108
- $outfile = $oldOutfile;
6109
- undef $oldOutfile;
6110
- Write($outfile, $writeBuffer, $pad, $$dataPt) or $err = 1;
6111
- undef $writeBuffer;
6112
- }
6113
- # rewrite existing trailers
6086
+ # rewrite existing trailers into buffer
6114
6087
  if ($trailInfo) {
6115
6088
  my $tbuf = '';
6116
6089
  $raf->Seek(-length($buff), 1); # seek back to just after EOI
@@ -6118,100 +6091,126 @@ sub WriteJPEG($$)
6118
6091
  $$trailInfo{ScanForTrailer} = 1;# scan if necessary
6119
6092
  $self->ProcessTrailers($trailInfo) or undef $trailInfo;
6120
6093
  }
6121
- if (not $oldOutfile) {
6122
- # do nothing special
6123
- } elsif ($$self{LeicaTrailer}) {
6124
- my $trailLen;
6125
- if ($trailInfo) {
6126
- $trailLen = $$trailInfo{DataPos} - $endPos;
6127
- } else {
6128
- $raf->Seek(0, 2) or $err = 1;
6129
- $trailLen = $raf->Tell() - $endPos;
6130
- }
6131
- my $fixup = $$self{LeicaTrailer}{Fixup};
6132
- $$self{LeicaTrailer}{TrailPos} = $endPos;
6133
- $$self{LeicaTrailer}{TrailLen} = $trailLen;
6134
- # get _absolute_ position of new Leica trailer
6135
- my $absPos = Tell($oldOutfile) + length($$outfile);
6136
- require Image::ExifTool::Panasonic;
6137
- my $dat = Image::ExifTool::Panasonic::ProcessLeicaTrailer($self, $absPos);
6138
- # allow some junk before Leica trailer (just in case)
6139
- my $junk = $$self{LeicaTrailerPos} - $endPos;
6140
- # set MakerNote pointer and size (subtract 10 for segment and EXIF headers)
6141
- $fixup->SetMarkerPointers($outfile, 'LeicaTrailer', length($$outfile) - 10 + $junk);
6142
- # use this fixup to set the size too (sneaky)
6143
- my $trailSize = defined($dat) ? length($dat) - $junk : $$self{LeicaTrailer}{Size};
6144
- $$fixup{Start} -= 4; $$fixup{Shift} += 4;
6145
- $fixup->SetMarkerPointers($outfile, 'LeicaTrailer', $trailSize) if defined $trailSize;
6146
- $$fixup{Start} += 4; $$fixup{Shift} -= 4;
6147
- # clean up and write the buffered data
6148
- $outfile = $oldOutfile;
6149
- undef $oldOutfile;
6150
- Write($outfile, $writeBuffer) or $err = 1;
6151
- undef $writeBuffer;
6152
- if (defined $dat) {
6153
- Write($outfile, $dat) or $err = 1; # write new Leica trailer
6154
- $delPreview = 1; # delete existing Leica trailer
6094
+ if ($oldOutfile) {
6095
+ my $previewInfo;
6096
+ # copy HiddenData if necessary
6097
+ if ($$self{HiddenData}) {
6098
+ my $pad;
6099
+ my $hd = $$self{HiddenData};
6100
+ my $hdOff = $$hd{Offset} + $$hd{Base};
6101
+ require Image::ExifTool::Sony;
6102
+ # read HiddenData, updating $hdOff with actual offset if necessary
6103
+ my $dataPt = Image::ExifTool::Sony::ReadHiddenData($self, $hdOff, $$hd{Size});
6104
+ if ($dataPt) {
6105
+ # preserve padding to avoid invalidating MPF pointers (yuk!)
6106
+ my $padLen = $hdOff - $endPos;
6107
+ unless ($padLen >= 0 and $raf->Seek($endPos,0) and $raf->Read($pad,$padLen)==$padLen) {
6108
+ $self->Error('Error reading HiddenData padding',1);
6109
+ $pad = '';
6110
+ }
6111
+ $endPos += length($pad) + length($$dataPt); # update end position
6112
+ } else {
6113
+ $$dataPt = $pad = '';
6114
+ }
6115
+ my $fixup = $$self{HiddenData}{Fixup};
6116
+ # set MakerNote pointer and size (subtract 10 for segment and EXIF headers)
6117
+ $fixup->SetMarkerPointers($outfile, 'HiddenData', length($$outfile) + length($pad) - 10);
6118
+ $writeBuffer .= $pad . $$dataPt; # keep padding for now
6155
6119
  }
6156
- } else {
6157
- # locate preview image and fix up preview offsets
6158
- my $scanLen = $$self{Make} =~ /^SONY/i ? 65536 : 1024;
6159
- if (length($buff) < $scanLen) { # make sure we have enough trailer to scan
6160
- my $buf2;
6161
- $buff .= $buf2 if $raf->Read($buf2, $scanLen - length($buff));
6120
+ if ($$self{LeicaTrailer}) {
6121
+ my $trailLen;
6122
+ if ($trailInfo) {
6123
+ $trailLen = $$trailInfo{DataPos} - $endPos;
6124
+ } else {
6125
+ $raf->Seek(0, 2) or $err = 1;
6126
+ $trailLen = $raf->Tell() - $endPos;
6127
+ }
6128
+ my $fixup = $$self{LeicaTrailer}{Fixup};
6129
+ $$self{LeicaTrailer}{TrailPos} = $endPos;
6130
+ $$self{LeicaTrailer}{TrailLen} = $trailLen;
6131
+ # get _absolute_ position of new Leica trailer
6132
+ my $absPos = Tell($oldOutfile) + length($$outfile);
6133
+ require Image::ExifTool::Panasonic;
6134
+ my $dat = Image::ExifTool::Panasonic::ProcessLeicaTrailer($self, $absPos);
6135
+ # allow some junk before Leica trailer (just in case)
6136
+ my $junk = $$self{LeicaTrailerPos} - $endPos;
6137
+ # set MakerNote pointer and size (subtract 10 for segment and EXIF headers)
6138
+ $fixup->SetMarkerPointers($outfile, 'LeicaTrailer', length($$outfile) - 10 + $junk);
6139
+ # use this fixup to set the size too (sneaky)
6140
+ my $trailSize = defined($dat) ? length($dat) - $junk : $$self{LeicaTrailer}{Size};
6141
+ $$fixup{Start} -= 4; $$fixup{Shift} += 4;
6142
+ $fixup->SetMarkerPointers($outfile, 'LeicaTrailer', $trailSize) if defined $trailSize;
6143
+ $$fixup{Start} += 4; $$fixup{Shift} -= 4;
6144
+ if (defined $dat) {
6145
+ Write($outfile, $dat) or $err = 1; # write new Leica trailer
6146
+ $delPreview = 1; # delete existing Leica trailer
6147
+ }
6162
6148
  }
6163
- # get new preview image position, relative to EXIF base
6164
- my $newPos = length($$outfile) - 10; # (subtract 10 for segment and EXIF headers)
6165
- my $junkLen;
6166
- # adjust position if image isn't at the start (eg. Olympus E-1/E-300)
6167
- if ($buff =~ /(\xff\xd8\xff.|.\xd8\xff\xdb)(..)/sg) {
6168
- my ($jpegHdr, $segLen) = ($1, $2);
6169
- $junkLen = pos($buff) - 6;
6170
- # Sony previewimage trailer has a 32 byte header
6171
- if ($$self{Make} =~ /^SONY/i and $junkLen > 32) {
6172
- # with some newer Sony models, the makernotes preview pointer
6173
- # points to JPEG at end of EXIF inside MPImage preview (what a pain!)
6174
- if ($jpegHdr eq "\xff\xd8\xff\xe1") { # is the first segment EXIF?
6175
- $segLen = unpack('n', $segLen); # the EXIF segment length
6176
- # Sony PreviewImage starts with last 2 bytes of EXIF segment
6177
- # (and first byte is usually "\0", not "\xff", so don't check this)
6178
- if (length($buff) > $junkLen + $segLen + 6 and
6179
- substr($buff, $junkLen + $segLen + 3, 3) eq "\xd8\xff\xdb")
6180
- {
6181
- $junkLen += $segLen + 2;
6182
- # (note: this will not copy the trailer after PreviewImage,
6183
- # which is a 14kB block full of zeros for the A77)
6149
+ # handle preview image last
6150
+ if ($$self{PREVIEW_INFO}) {
6151
+ # locate preview image and fix up preview offsets
6152
+ my $scanLen = $$self{Make} =~ /^SONY/i ? 65536 : 1024;
6153
+ if (length($buff) < $scanLen) { # make sure we have enough trailer to scan
6154
+ my $buf2;
6155
+ $buff .= $buf2 if $raf->Read($buf2, $scanLen - length($buff));
6156
+ }
6157
+ # get new preview image position, relative to EXIF base
6158
+ my $newPos = length($$outfile) - 10; # (subtract 10 for segment and EXIF headers)
6159
+ my $junkLen;
6160
+ # adjust position if image isn't at the start (eg. Olympus E-1/E-300)
6161
+ if ($buff =~ /(\xff\xd8\xff.|.\xd8\xff\xdb)(..)/sg) {
6162
+ my ($jpegHdr, $segLen) = ($1, $2);
6163
+ $junkLen = pos($buff) - 6;
6164
+ # Sony previewimage trailer has a 32 byte header
6165
+ if ($$self{Make} =~ /^SONY/i and $junkLen > 32) {
6166
+ # with some newer Sony models, the makernotes preview pointer
6167
+ # points to JPEG at end of EXIF inside MPImage preview (what a pain!)
6168
+ if ($jpegHdr eq "\xff\xd8\xff\xe1") { # is the first segment EXIF?
6169
+ $segLen = unpack('n', $segLen); # the EXIF segment length
6170
+ # Sony PreviewImage starts with last 2 bytes of EXIF segment
6171
+ # (and first byte is usually "\0", not "\xff", so don't check this)
6172
+ if (length($buff) > $junkLen + $segLen + 6 and
6173
+ substr($buff, $junkLen + $segLen + 3, 3) eq "\xd8\xff\xdb")
6174
+ {
6175
+ $junkLen += $segLen + 2;
6176
+ # (note: this will not copy the trailer after PreviewImage,
6177
+ # which is a 14kB block full of zeros for the A77)
6178
+ }
6184
6179
  }
6180
+ $junkLen -= 32;
6185
6181
  }
6186
- $junkLen -= 32;
6182
+ $newPos += $junkLen;
6183
+ }
6184
+ # fix up the preview offsets to point to the start of the new image
6185
+ $previewInfo = $$self{PREVIEW_INFO};
6186
+ delete $$self{PREVIEW_INFO};
6187
+ my $fixup = $$previewInfo{Fixup};
6188
+ $newPos += ($$previewInfo{BaseShift} || 0);
6189
+ # adjust to absolute file offset if necessary (Samsung STMN)
6190
+ $newPos += Tell($oldOutfile) + 10 if $$previewInfo{Absolute};
6191
+ if ($$previewInfo{Relative}) {
6192
+ # adjust for our base by looking at how far the pointer got shifted
6193
+ $newPos -= ($fixup->GetMarkerPointers($outfile, 'PreviewImage') || 0);
6194
+ } elsif ($$previewInfo{ChangeBase}) {
6195
+ # Leica S2 uses relative offsets for the preview only (leica sucks)
6196
+ my $makerOffset = $fixup->GetMarkerPointers($outfile, 'LeicaTrailer');
6197
+ $newPos -= $makerOffset if $makerOffset;
6198
+ }
6199
+ $fixup->SetMarkerPointers($outfile, 'PreviewImage', $newPos);
6200
+ if ($$previewInfo{Data} ne 'LOAD_PREVIEW') {
6201
+ # write any junk that existed before the preview image
6202
+ $$previewInfo{Junk} = substr($buff,0,$junkLen) if $junkLen;
6187
6203
  }
6188
- $newPos += $junkLen;
6189
- }
6190
- # fix up the preview offsets to point to the start of the new image
6191
- my $previewInfo = $$self{PREVIEW_INFO};
6192
- delete $$self{PREVIEW_INFO};
6193
- my $fixup = $$previewInfo{Fixup};
6194
- $newPos += ($$previewInfo{BaseShift} || 0);
6195
- # adjust to absolute file offset if necessary (Samsung STMN)
6196
- $newPos += Tell($oldOutfile) + 10 if $$previewInfo{Absolute};
6197
- if ($$previewInfo{Relative}) {
6198
- # adjust for our base by looking at how far the pointer got shifted
6199
- $newPos -= ($fixup->GetMarkerPointers($outfile, 'PreviewImage') || 0);
6200
- } elsif ($$previewInfo{ChangeBase}) {
6201
- # Leica S2 uses relative offsets for the preview only (leica sucks)
6202
- my $makerOffset = $fixup->GetMarkerPointers($outfile, 'LeicaTrailer');
6203
- $newPos -= $makerOffset if $makerOffset;
6204
6204
  }
6205
- $fixup->SetMarkerPointers($outfile, 'PreviewImage', $newPos);
6206
6205
  # clean up and write the buffered data
6207
6206
  $outfile = $oldOutfile;
6208
6207
  undef $oldOutfile;
6209
6208
  Write($outfile, $writeBuffer) or $err = 1;
6210
6209
  undef $writeBuffer;
6211
6210
  # write preview image
6212
- if ($$previewInfo{Data} ne 'LOAD_PREVIEW') {
6211
+ if ($previewInfo and $$previewInfo{Data} ne 'LOAD_PREVIEW') {
6213
6212
  # write any junk that existed before the preview image
6214
- Write($outfile, substr($buff,0,$junkLen)) or $err = 1 if $junkLen;
6213
+ Write($outfile, $$previewInfo{Junk}) or $err = 1 if defined $$previewInfo{Junk};
6215
6214
  # write the saved preview image
6216
6215
  Write($outfile, $$previewInfo{Data}) or $err = 1;
6217
6216
  delete $$previewInfo{Data};
@@ -6224,7 +6223,7 @@ sub WriteJPEG($$)
6224
6223
  my $extra;
6225
6224
  if ($trailInfo) {
6226
6225
  # copy everything up to start of first processed trailer
6227
- $extra = $$trailInfo{DataPos} - $endPos;
6226
+ $extra = defined $$trailInfo{DataPos} ? ($$trailInfo{DataPos} - $endPos) : 0;
6228
6227
  } else {
6229
6228
  # copy everything up to end of file
6230
6229
  $raf->Seek(0, 2) or $err = 1;
@@ -6393,9 +6392,9 @@ sub WriteJPEG($$)
6393
6392
  $oldOutfile = $outfile;
6394
6393
  $outfile = \$writeBuffer;
6395
6394
  # must account for segment, EXIF and TIFF headers
6396
- $$self{PREVIEW_INFO}{Fixup}{Start} += 18 if $$self{PREVIEW_INFO};
6397
- $$self{LeicaTrailer}{Fixup}{Start} += 18 if $$self{LeicaTrailer};
6398
- $$self{HiddenData}{Fixup}{Start} += 18 if $$self{HiddenData};
6395
+ foreach (qw(PREVIEW_INFO LeicaTrailer HiddenData)) {
6396
+ $$self{$_}{Fixup}{Start} += 18 if $$self{$_};
6397
+ }
6399
6398
  }
6400
6399
  # write as multi-segment
6401
6400
  my $n = WriteMultiSegment($outfile, $marker, $exifAPP1hdr, $segDataPt, 'EXIF');
@@ -27,9 +27,9 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
27
27
  %noWriteFile %magicNumber @langs $defaultLang %langName %charsetName
28
28
  %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
30
- %static_vars $advFmtSelf);
30
+ %static_vars $advFmtSelf $configFile @configFiles $noConfig);
31
31
 
32
- $VERSION = '13.29';
32
+ $VERSION = '13.31';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -42,7 +42,7 @@ $RELEASE = '';
42
42
  # exports not part of the public API, but used by ExifTool modules:
43
43
  DataAccess => [qw(
44
44
  ReadValue GetByteOrder SetByteOrder ToggleByteOrder Get8u Get8s Get16u
45
- Get16s Get32u Get32s Get64u GetFloat GetDouble GetFixed32s Write
45
+ Get16s Get32u Get32s Get64u Get64s GetFloat GetDouble GetFixed32s Write
46
46
  WriteValue Tell Set8u Set8s Set16u Set32u Set64u Set64s
47
47
  )],
48
48
  Utils => [qw(GetTagTable TagTableKeys GetTagInfoList AddTagToTable HexDump)],
@@ -9719,8 +9719,10 @@ sub ExtractBinary($$$;$)
9719
9719
  $isPreview = 1;
9720
9720
  }
9721
9721
  my $lcTag = lc $tag;
9722
- if ((not $$self{OPTIONS}{Binary} or $$self{EXCL_TAG_LOOKUP}{$lcTag}) and
9723
- not $$self{OPTIONS}{Verbose} and not $$self{REQ_TAG_LOOKUP}{$lcTag})
9722
+ my $options = $$self{OPTIONS};
9723
+ if ((not $$options{Binary} or $$self{EXCL_TAG_LOOKUP}{$lcTag}) and
9724
+ not $$options{Verbose} and not $$options{Validate} and
9725
+ not $$self{REQ_TAG_LOOKUP}{$lcTag})
9724
9726
  {
9725
9727
  return "Binary data $length bytes";
9726
9728
  }
@@ -10047,8 +10049,9 @@ sub ProcessBinaryData($$$)
10047
10049
  #..............................................................................
10048
10050
  # Load .ExifTool_config file from user's home directory
10049
10051
  # (use of noConfig is now deprecated, use configFile = '' instead)
10050
- until ($Image::ExifTool::noConfig) {
10051
- my $config = $Image::ExifTool::configFile;
10052
+ push @configFiles, $configFile if defined $configFile;
10053
+ until ($noConfig) {
10054
+ my $config = shift @configFiles;
10052
10055
  my $file;
10053
10056
  if (not defined $config) {
10054
10057
  $config = '.ExifTool_config';
@@ -10073,7 +10076,7 @@ until ($Image::ExifTool::noConfig) {
10073
10076
  shift @INC;
10074
10077
  # print warning (minus "Compilation failed" part)
10075
10078
  $@ and $_=$@, s/Compilation failed.*//s, warn $_;
10076
- last;
10079
+ last unless @configFiles;
10077
10080
  }
10078
10081
  # read user-defined lenses (may have been defined by script instead of config file)
10079
10082
  if (@Image::ExifTool::UserDefined::Lenses) {
@@ -1,6 +1,6 @@
1
1
  Summary: perl module for image data extraction
2
2
  Name: perl-Image-ExifTool
3
- Version: 13.29
3
+ Version: 13.31
4
4
  Release: 1
5
5
  License: Artistic/GPL
6
6
  Group: Development/Libraries/Perl
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ExiftoolVendored
4
- VERSION = Gem::Version.new('13.29.0')
4
+ VERSION = Gem::Version.new('13.31.0')
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exiftool_vendored
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.29.0
4
+ version: 13.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew McEachen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-04-28 00:00:00.000000000 Z
12
+ date: 2025-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: exiftool