exiftool_vendored 12.72.0 → 12.74.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +42 -0
  3. data/bin/META.json +1 -1
  4. data/bin/META.yml +1 -1
  5. data/bin/README +3 -3
  6. data/bin/exiftool +75 -53
  7. data/bin/lib/File/RandomAccess.pm +32 -6
  8. data/bin/lib/File/RandomAccess.pod +6 -6
  9. data/bin/lib/Image/ExifTool/7Z.pm +3 -3
  10. data/bin/lib/Image/ExifTool/AAC.pm +8 -6
  11. data/bin/lib/Image/ExifTool/AES.pm +1 -1
  12. data/bin/lib/Image/ExifTool/AFCP.pm +3 -3
  13. data/bin/lib/Image/ExifTool/AIFF.pm +1 -1
  14. data/bin/lib/Image/ExifTool/APE.pm +1 -1
  15. data/bin/lib/Image/ExifTool/APP12.pm +1 -1
  16. data/bin/lib/Image/ExifTool/ASF.pm +1 -1
  17. data/bin/lib/Image/ExifTool/Apple.pm +1 -1
  18. data/bin/lib/Image/ExifTool/Audible.pm +1 -1
  19. data/bin/lib/Image/ExifTool/BMP.pm +1 -1
  20. data/bin/lib/Image/ExifTool/BPG.pm +1 -1
  21. data/bin/lib/Image/ExifTool/BZZ.pm +3 -3
  22. data/bin/lib/Image/ExifTool/BigTIFF.pm +1 -1
  23. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +7 -7
  24. data/bin/lib/Image/ExifTool/CBOR.pm +1 -1
  25. data/bin/lib/Image/ExifTool/Canon.pm +4 -4
  26. data/bin/lib/Image/ExifTool/CanonCustom.pm +1 -1
  27. data/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  28. data/bin/lib/Image/ExifTool/CanonVRD.pm +3 -3
  29. data/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
  30. data/bin/lib/Image/ExifTool/Casio.pm +1 -1
  31. data/bin/lib/Image/ExifTool/Charset.pm +1 -1
  32. data/bin/lib/Image/ExifTool/DICOM.pm +3 -3
  33. data/bin/lib/Image/ExifTool/DJI.pm +1 -1
  34. data/bin/lib/Image/ExifTool/DNG.pm +5 -5
  35. data/bin/lib/Image/ExifTool/DPX.pm +1 -1
  36. data/bin/lib/Image/ExifTool/DV.pm +1 -1
  37. data/bin/lib/Image/ExifTool/DarwinCore.pm +1 -1
  38. data/bin/lib/Image/ExifTool/DjVu.pm +1 -1
  39. data/bin/lib/Image/ExifTool/EXE.pm +1 -1
  40. data/bin/lib/Image/ExifTool/Exif.pm +3 -3
  41. data/bin/lib/Image/ExifTool/FITS.pm +1 -1
  42. data/bin/lib/Image/ExifTool/FLAC.pm +1 -1
  43. data/bin/lib/Image/ExifTool/FLIF.pm +1 -1
  44. data/bin/lib/Image/ExifTool/FLIR.pm +3 -3
  45. data/bin/lib/Image/ExifTool/Fixup.pm +4 -4
  46. data/bin/lib/Image/ExifTool/Flash.pm +1 -1
  47. data/bin/lib/Image/ExifTool/FlashPix.pm +61 -8
  48. data/bin/lib/Image/ExifTool/Font.pm +1 -1
  49. data/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
  50. data/bin/lib/Image/ExifTool/FujiFilm.pm +9 -4
  51. data/bin/lib/Image/ExifTool/GE.pm +1 -1
  52. data/bin/lib/Image/ExifTool/GIF.pm +1 -1
  53. data/bin/lib/Image/ExifTool/GIMP.pm +1 -1
  54. data/bin/lib/Image/ExifTool/GPS.pm +1 -1
  55. data/bin/lib/Image/ExifTool/GeoTiff.pm +1 -1
  56. data/bin/lib/Image/ExifTool/Geotag.pm +4 -4
  57. data/bin/lib/Image/ExifTool/GoPro.pm +1 -1
  58. data/bin/lib/Image/ExifTool/H264.pm +1 -1
  59. data/bin/lib/Image/ExifTool/HP.pm +1 -1
  60. data/bin/lib/Image/ExifTool/HTML.pm +1 -1
  61. data/bin/lib/Image/ExifTool/HtmlDump.pm +3 -3
  62. data/bin/lib/Image/ExifTool/ICC_Profile.pm +1 -1
  63. data/bin/lib/Image/ExifTool/ICO.pm +1 -1
  64. data/bin/lib/Image/ExifTool/ID3.pm +3 -3
  65. data/bin/lib/Image/ExifTool/IPTC.pm +1 -1
  66. data/bin/lib/Image/ExifTool/ISO.pm +1 -1
  67. data/bin/lib/Image/ExifTool/ITC.pm +1 -1
  68. data/bin/lib/Image/ExifTool/Import.pm +6 -6
  69. data/bin/lib/Image/ExifTool/InDesign.pm +1 -1
  70. data/bin/lib/Image/ExifTool/InfiRay.pm +1 -1
  71. data/bin/lib/Image/ExifTool/JPEG.pm +5 -2
  72. data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  73. data/bin/lib/Image/ExifTool/JSON.pm +3 -3
  74. data/bin/lib/Image/ExifTool/JVC.pm +3 -3
  75. data/bin/lib/Image/ExifTool/Jpeg2000.pm +18 -7
  76. data/bin/lib/Image/ExifTool/Kodak.pm +1 -1
  77. data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  78. data/bin/lib/Image/ExifTool/LIF.pm +1 -1
  79. data/bin/lib/Image/ExifTool/LNK.pm +1 -1
  80. data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  81. data/bin/lib/Image/ExifTool/Lang/de.pm +1 -1
  82. data/bin/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
  83. data/bin/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
  84. data/bin/lib/Image/ExifTool/Lang/es.pm +4 -4
  85. data/bin/lib/Image/ExifTool/Lang/fi.pm +1 -1
  86. data/bin/lib/Image/ExifTool/Lang/fr.pm +4 -5
  87. data/bin/lib/Image/ExifTool/Lang/it.pm +3 -3
  88. data/bin/lib/Image/ExifTool/Lang/ja.pm +1 -1
  89. data/bin/lib/Image/ExifTool/Lang/ko.pm +1 -1
  90. data/bin/lib/Image/ExifTool/Lang/nl.pm +1 -1
  91. data/bin/lib/Image/ExifTool/Lang/pl.pm +1 -1
  92. data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  93. data/bin/lib/Image/ExifTool/Lang/sk.pm +1 -1
  94. data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  95. data/bin/lib/Image/ExifTool/Lang/tr.pm +1 -1
  96. data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  97. data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  98. data/bin/lib/Image/ExifTool/Leaf.pm +3 -3
  99. data/bin/lib/Image/ExifTool/Lytro.pm +1 -1
  100. data/bin/lib/Image/ExifTool/M2TS.pm +1 -1
  101. data/bin/lib/Image/ExifTool/MIE.pm +5 -5
  102. data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  103. data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  104. data/bin/lib/Image/ExifTool/MISB.pm +1 -1
  105. data/bin/lib/Image/ExifTool/MNG.pm +1 -1
  106. data/bin/lib/Image/ExifTool/MOI.pm +1 -1
  107. data/bin/lib/Image/ExifTool/MPC.pm +1 -1
  108. data/bin/lib/Image/ExifTool/MPEG.pm +1 -1
  109. data/bin/lib/Image/ExifTool/MPF.pm +1 -1
  110. data/bin/lib/Image/ExifTool/MRC.pm +1 -1
  111. data/bin/lib/Image/ExifTool/MWG.pm +1 -1
  112. data/bin/lib/Image/ExifTool/MXF.pm +1 -1
  113. data/bin/lib/Image/ExifTool/MacOS.pm +1 -1
  114. data/bin/lib/Image/ExifTool/MakerNotes.pm +1 -1
  115. data/bin/lib/Image/ExifTool/Matroska.pm +1 -1
  116. data/bin/lib/Image/ExifTool/Microsoft.pm +1 -1
  117. data/bin/lib/Image/ExifTool/Minolta.pm +1 -1
  118. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +3 -3
  119. data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  120. data/bin/lib/Image/ExifTool/Nikon.pm +11 -8
  121. data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  122. data/bin/lib/Image/ExifTool/NikonCustom.pm +4 -4
  123. data/bin/lib/Image/ExifTool/NikonSettings.pm +1 -1
  124. data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  125. data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
  126. data/bin/lib/Image/ExifTool/Ogg.pm +3 -3
  127. data/bin/lib/Image/ExifTool/Olympus.pm +1 -1
  128. data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  129. data/bin/lib/Image/ExifTool/Opus.pm +1 -1
  130. data/bin/lib/Image/ExifTool/Other.pm +1 -1
  131. data/bin/lib/Image/ExifTool/PCX.pm +1 -1
  132. data/bin/lib/Image/ExifTool/PDF.pm +1 -1
  133. data/bin/lib/Image/ExifTool/PGF.pm +1 -1
  134. data/bin/lib/Image/ExifTool/PICT.pm +1 -1
  135. data/bin/lib/Image/ExifTool/PLIST.pm +4 -4
  136. data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  137. data/bin/lib/Image/ExifTool/PNG.pm +24 -2
  138. data/bin/lib/Image/ExifTool/PPM.pm +1 -1
  139. data/bin/lib/Image/ExifTool/PSP.pm +1 -1
  140. data/bin/lib/Image/ExifTool/Palm.pm +1 -1
  141. data/bin/lib/Image/ExifTool/Panasonic.pm +27 -2
  142. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +4 -4
  143. data/bin/lib/Image/ExifTool/Parrot.pm +1 -1
  144. data/bin/lib/Image/ExifTool/Pentax.pm +32 -11
  145. data/bin/lib/Image/ExifTool/PhaseOne.pm +6 -6
  146. data/bin/lib/Image/ExifTool/PhotoCD.pm +1 -1
  147. data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  148. data/bin/lib/Image/ExifTool/Photoshop.pm +4 -4
  149. data/bin/lib/Image/ExifTool/PostScript.pm +3 -3
  150. data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  151. data/bin/lib/Image/ExifTool/Qualcomm.pm +1 -1
  152. data/bin/lib/Image/ExifTool/QuickTime.pm +54 -101
  153. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +97 -7
  154. data/bin/lib/Image/ExifTool/RIFF.pm +1 -1
  155. data/bin/lib/Image/ExifTool/RSRC.pm +3 -3
  156. data/bin/lib/Image/ExifTool/RTF.pm +1 -1
  157. data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  158. data/bin/lib/Image/ExifTool/Rawzor.pm +1 -1
  159. data/bin/lib/Image/ExifTool/Real.pm +1 -1
  160. data/bin/lib/Image/ExifTool/Reconyx.pm +1 -1
  161. data/bin/lib/Image/ExifTool/Red.pm +1 -1
  162. data/bin/lib/Image/ExifTool/Ricoh.pm +3 -3
  163. data/bin/lib/Image/ExifTool/Samsung.pm +5 -5
  164. data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  165. data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  166. data/bin/lib/Image/ExifTool/Shift.pl +2 -2
  167. data/bin/lib/Image/ExifTool/Shortcuts.pm +1 -1
  168. data/bin/lib/Image/ExifTool/Sigma.pm +1 -1
  169. data/bin/lib/Image/ExifTool/SigmaRaw.pm +4 -4
  170. data/bin/lib/Image/ExifTool/Sony.pm +5 -5
  171. data/bin/lib/Image/ExifTool/SonyIDC.pm +1 -1
  172. data/bin/lib/Image/ExifTool/Stim.pm +1 -1
  173. data/bin/lib/Image/ExifTool/TagInfoXML.pm +4 -4
  174. data/bin/lib/Image/ExifTool/TagLookup.pm +3876 -3862
  175. data/bin/lib/Image/ExifTool/TagNames.pod +11420 -11382
  176. data/bin/lib/Image/ExifTool/Text.pm +1 -1
  177. data/bin/lib/Image/ExifTool/Theora.pm +1 -1
  178. data/bin/lib/Image/ExifTool/Torrent.pm +1 -1
  179. data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  180. data/bin/lib/Image/ExifTool/VCard.pm +1 -1
  181. data/bin/lib/Image/ExifTool/Validate.pm +1 -1
  182. data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  183. data/bin/lib/Image/ExifTool/WPG.pm +1 -1
  184. data/bin/lib/Image/ExifTool/WTV.pm +1 -1
  185. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +2 -2
  186. data/bin/lib/Image/ExifTool/WriteExif.pl +16 -16
  187. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  188. data/bin/lib/Image/ExifTool/WritePDF.pl +2 -2
  189. data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  190. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  191. data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -1
  192. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +5 -2
  193. data/bin/lib/Image/ExifTool/WriteRIFF.pl +1 -1
  194. data/bin/lib/Image/ExifTool/WriteXMP.pl +9 -5
  195. data/bin/lib/Image/ExifTool/Writer.pl +72 -43
  196. data/bin/lib/Image/ExifTool/XISF.pm +1 -1
  197. data/bin/lib/Image/ExifTool/XMP.pm +19 -3
  198. data/bin/lib/Image/ExifTool/XMP2.pl +1 -1
  199. data/bin/lib/Image/ExifTool/XMPStruct.pl +1 -1
  200. data/bin/lib/Image/ExifTool/ZIP.pm +7 -7
  201. data/bin/lib/Image/ExifTool/ZISRAW.pm +1 -1
  202. data/bin/lib/Image/ExifTool/iWork.pm +1 -1
  203. data/bin/lib/Image/ExifTool.pm +44 -25
  204. data/bin/lib/Image/ExifTool.pod +12 -3
  205. data/bin/perl-Image-ExifTool.spec +1 -1
  206. data/lib/exiftool_vendored/version.rb +1 -1
  207. metadata +2 -2
@@ -26,6 +26,7 @@ sub RemoveNewValuesForGroup($$);
26
26
  sub GetWriteGroup1($$);
27
27
  sub Sanitize($$);
28
28
  sub ConvInv($$$$$;$$);
29
+ sub PushValue($$$;$);
29
30
 
30
31
  my $loadedAllTables; # flag indicating we loaded all tables
31
32
  my $advFmtSelf; # ExifTool object during evaluation of advanced formatting expr
@@ -1260,7 +1261,7 @@ sub SetNewValuesFromFile($$;@)
1260
1261
  }
1261
1262
  # expand shortcuts
1262
1263
  @setTags and ExpandShortcuts(\@setTags);
1263
- my $srcExifTool = new Image::ExifTool;
1264
+ my $srcExifTool = Image::ExifTool->new;
1264
1265
  # set flag to indicate we are being called from inside SetNewValuesFromFile()
1265
1266
  $$srcExifTool{TAGS_FROM_FILE} = 1;
1266
1267
  # synchronize and increment the file sequence number
@@ -1302,6 +1303,7 @@ sub SetNewValuesFromFile($$;@)
1302
1303
  ImageHashType => $$options{ImageHashType},
1303
1304
  Lang => $$options{Lang},
1304
1305
  LargeFileSupport=> $$options{LargeFileSupport},
1306
+ LimitLongValues => 10000000, # (10 MB)
1305
1307
  List => 1,
1306
1308
  ListItem => $$options{ListItem},
1307
1309
  ListSep => $$options{ListSep},
@@ -1581,7 +1583,7 @@ SET: foreach $set (@setList) {
1581
1583
  my $opts = $$set[3];
1582
1584
  # handle expressions
1583
1585
  if ($$opts{EXPR}) {
1584
- my $val = $srcExifTool->InsertTagValues(\@tags, $$set[1], 'Error');
1586
+ my $val = $srcExifTool->InsertTagValues($$set[1], \@tags, 'Error');
1585
1587
  my $err = $$srcExifTool{VALUE}{Error};
1586
1588
  if ($err) {
1587
1589
  # pass on any error as a warning unless it is suppressed
@@ -2431,7 +2433,7 @@ sub WriteInfo($$;$$)
2431
2433
  #
2432
2434
  until ($$self{VALUE}{Error}) {
2433
2435
  # create random access file object (disable seek test in case of straight copy)
2434
- $raf or $raf = new File::RandomAccess($inRef, 1);
2436
+ $raf or $raf = File::RandomAccess->new($inRef, 1);
2435
2437
  $raf->BinMode();
2436
2438
  if ($numNew == $numPseudo) {
2437
2439
  $rtnVal = 1;
@@ -2702,7 +2704,7 @@ sub GetAllTags(;$)
2702
2704
  my (%allTags, @groups);
2703
2705
  @groups = split ':', $group if $group;
2704
2706
 
2705
- my $et = new Image::ExifTool;
2707
+ my $et = Image::ExifTool->new;
2706
2708
  LoadAllTables(); # first load all our tables
2707
2709
  my @tableNames = keys %allTables;
2708
2710
 
@@ -2747,7 +2749,7 @@ sub GetWritableTags(;$)
2747
2749
  my (%writableTags, @groups);
2748
2750
  @groups = split ':', $group if $group;
2749
2751
 
2750
- my $et = new Image::ExifTool;
2752
+ my $et = Image::ExifTool->new;
2751
2753
  LoadAllTables();
2752
2754
  my @tableNames = keys %allTables;
2753
2755
 
@@ -3123,11 +3125,37 @@ Conv: for (;;) {
3123
3125
  return($val, $err);
3124
3126
  }
3125
3127
 
3128
+ #------------------------------------------------------------------------------
3129
+ # Dereference value and push onto list
3130
+ # Inputs: 0) ExifTool ref, 1) value, 2) list ref, 3) flag to push MissingTagValue for undef value
3131
+ sub PushValue($$$;$)
3132
+ {
3133
+ local $_;
3134
+ my ($self, $val, $list, $missing) = @_;
3135
+ if (ref $val eq 'ARRAY' and ref $$val[0] ne 'HASH') {
3136
+ $self->PushValue($_, $list, $missing) foreach @$val;
3137
+ } elsif (ref $val eq 'SCALAR') {
3138
+ if ($$self{OPTIONS}{Binary} or $$val =~ /^Binary data/) {
3139
+ push @$list, $$val;
3140
+ } else {
3141
+ push @$list, 'Binary data ' . length($$val) . ' bytes';
3142
+ }
3143
+ } elsif (ref $val eq 'HASH' or ref $val eq 'ARRAY') {
3144
+ require 'Image/ExifTool/XMPStruct.pl';
3145
+ push @$list, Image::ExifTool::XMP::SerializeStruct($self, $val);
3146
+ } elsif (not defined $val) {
3147
+ my $mval = $$self{OPTIONS}{MissingTagValue};
3148
+ push @$list, $mval if $missing and defined $mval;
3149
+ } else {
3150
+ push @$list, $val;
3151
+ }
3152
+ }
3153
+
3126
3154
  #------------------------------------------------------------------------------
3127
3155
  # Convert tag names to values or variables in a string
3128
3156
  # (eg. '${EXIF:ISO}x $$' --> '100x $' without hash ref, or "$info{'EXIF:ISO'}x $" with)
3129
- # Inputs: 0) ExifTool object ref, 1) reference to list of found tags
3130
- # 2) string with embedded tag names, 3) Options:
3157
+ # Inputs: 0) ExifTool object ref, 1) string with embedded tag names,
3158
+ # 2) reference to list of found tags or undef to use FOUND_TAGS, 3) Options:
3131
3159
  # undef - set missing tags to ''
3132
3160
  # 'Error' - issue minor error on missing tag (and return undef)
3133
3161
  # 'Warn' - issue minor warning on missing tag (and return undef)
@@ -3144,20 +3172,22 @@ Conv: for (;;) {
3144
3172
  # - advanced feature allows Perl expressions inside braces (eg. '${model;tr/ //d}')
3145
3173
  # - an error/warning in an advanced expression ("${TAG;EXPR}") generates an error
3146
3174
  # if option set to 'Error', or a warning otherwise
3147
- sub InsertTagValues($$$;$$$)
3175
+ sub InsertTagValues($$;$$$$)
3148
3176
  {
3149
3177
  local $_;
3150
- my ($self, $foundTags, $line, $opt, $docGrp, $cache) = @_;
3178
+ my ($self, $line, $foundTags, $opt, $docGrp, $cache) = @_;
3151
3179
  my $rtnStr = '';
3152
3180
  my ($docNum, $tag);
3181
+
3153
3182
  if ($docGrp) {
3154
3183
  $docNum = $docGrp =~ /(\d+)$/ ? $1 : 0;
3155
3184
  } else {
3156
3185
  undef $cache; # no cache if no document groups
3157
3186
  }
3187
+ $foundTags or $foundTags = $$self{FOUND_TAGS} || [];
3158
3188
  while ($line =~ s/(.*?)\$(\{\s*)?([-\w]*\w|\$|\/)//s) {
3159
3189
  my ($pre, $bra, $var) = ($1, $2, $3);
3160
- my (@tags, $val, $tg, @val, $type, $expr, $didExpr, $level, $asList);
3190
+ my (@tags, $tg, $val, @val, $type, $expr, $didExpr, $level, $asList);
3161
3191
  # "$$" represents a "$" symbol, and "$/" is a newline
3162
3192
  if ($var eq '$' or $var eq '/') {
3163
3193
  $line =~ s/^\s*\}// if $bra;
@@ -3260,15 +3290,24 @@ sub InsertTagValues($$$;$$$)
3260
3290
  } elsif (defined $$et{OPTIONS}{UserParam}{$lcTag}) {
3261
3291
  $val = $$et{OPTIONS}{UserParam}{$lcTag};
3262
3292
  } elsif ($tag =~ /(.*):(.+)/) {
3263
- my $group;
3293
+ my ($group, @matches);
3264
3294
  ($group, $tag) = ($1, $2);
3265
- if (lc $tag eq 'all') {
3266
- # see if any tag from the specified group exists
3267
- my $match = $et->GroupMatches($group, $fileTags);
3268
- $val = $match ? 1 : 0;
3295
+ # join values of all matching tags if "All" group is used
3296
+ # (and remove "All" from group prefix)
3297
+ if ($group =~ s/(^|:)(all|\*)(:|$)/$1 and $3/ei) {
3298
+ if (lc $tag eq 'all') {
3299
+ @matches = $group ? $et->GroupMatches($group, $fileTags) : @$fileTags;
3300
+ } else {
3301
+ @matches = grep /^$tag(\s|$)/i, @$fileTags;
3302
+ @matches = $et->GroupMatches($group, \@matches) if $group;
3303
+ }
3304
+ $self->PushValue(scalar $et->GetValue($_, $type), \@val) foreach @matches;
3305
+ } elsif (lc $tag eq 'all') {
3306
+ # return "1" if any tag from the specified group exists
3307
+ $val = $et->GroupMatches($group, $fileTags) ? 1 : 0;
3269
3308
  } else {
3270
3309
  # find the specified tag
3271
- my @matches = grep /^$tag(\s|$)/i, @$fileTags;
3310
+ @matches = grep /^$tag(\s|$)/i, @$fileTags;
3272
3311
  @matches = $et->GroupMatches($group, \@matches);
3273
3312
  foreach $tg (@matches) {
3274
3313
  if (defined $val and $tg =~ / \((\d+)\)$/) {
@@ -3297,31 +3336,15 @@ sub InsertTagValues($$$;$$$)
3297
3336
  }
3298
3337
  }
3299
3338
  $self->Options(ListJoin => $oldListJoin) if $asList;
3300
- if (ref $val eq 'ARRAY') {
3301
- push @val, @$val;
3302
- undef $val;
3303
- last unless @tags;
3304
- } elsif (ref $val eq 'SCALAR') {
3305
- if ($$self{OPTIONS}{Binary} or $$val =~ /^Binary data/) {
3306
- $val = $$val;
3307
- } else {
3308
- $val = 'Binary data ' . length($$val) . ' bytes';
3309
- }
3310
- } elsif (ref $val eq 'HASH') {
3311
- require 'Image/ExifTool/XMPStruct.pl';
3312
- $val = Image::ExifTool::XMP::SerializeStruct($self, $val);
3313
- } elsif (not defined $val) {
3314
- $val = $$self{OPTIONS}{MissingTagValue} if $asList;
3315
- }
3316
- last unless @tags;
3317
- push @val, $val if defined $val;
3339
+ $self->PushValue($val, \@val, $asList);
3318
3340
  undef $val;
3341
+ last unless @tags;
3319
3342
  }
3320
3343
  if (@val) {
3321
- push @val, $val if defined $val;
3344
+ $self->PushValue($val, \@val) if defined $val;
3322
3345
  $val = join $$self{OPTIONS}{ListSep}, @val;
3323
- } else {
3324
- push @val, $val if defined $val; # (so the eval has access to @val if required)
3346
+ } elsif (defined $val) {
3347
+ $self->PushValue($val, \@val); # (so the eval has access to @val if required)
3325
3348
  }
3326
3349
  # evaluate advanced formatting expression if given (eg. "${TAG;EXPR}")
3327
3350
  if (defined $expr and defined $val) {
@@ -3394,6 +3417,7 @@ sub InsertTagValues($$$;$$$)
3394
3417
  #------------------------------------------------------------------------------
3395
3418
  # Reformat date/time value in $_ based on specified format string
3396
3419
  # Inputs: 0) date/time format string
3420
+ # Returns: Reformatted date/time string
3397
3421
  sub DateFmt($)
3398
3422
  {
3399
3423
  my $et = bless { OPTIONS => { DateFormat => shift, StrictDate => 1 } };
@@ -3405,6 +3429,7 @@ sub DateFmt($)
3405
3429
  $_ = $et->ConvertDateTime($_);
3406
3430
  defined $_ or warn "Error converting date/time\n";
3407
3431
  $$advFmtSelf{GLOBAL_TIME_OFFSET} = $$et{GLOBAL_TIME_OFFSET} if $shift;
3432
+ return $_;
3408
3433
  }
3409
3434
 
3410
3435
  #------------------------------------------------------------------------------
@@ -3514,7 +3539,7 @@ sub CreateDirectory($$)
3514
3539
  }
3515
3540
  unless ($k32CreateDir) {
3516
3541
  return -1 if defined $k32CreateDir;
3517
- $k32CreateDir = new Win32::API('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
3542
+ $k32CreateDir = Win32::API->new('KERNEL32', 'CreateDirectoryW', 'PP', 'I');
3518
3543
  unless ($k32CreateDir) {
3519
3544
  $self->Warn('Error calling Win32::API::CreateDirectoryW');
3520
3545
  $k32CreateDir = 0;
@@ -4506,6 +4531,7 @@ sub HexDump($;$%)
4506
4531
  # Count => number of values
4507
4532
  # Extra => Extra Verbose=2 information to put after tag number
4508
4533
  # Table => Reference to tag table
4534
+ # Name => Name to use for unknown tag
4509
4535
  # --> plus any of these HexDump() options: Start, Addr, Width
4510
4536
  sub VerboseInfo($$$%)
4511
4537
  {
@@ -4523,6 +4549,9 @@ sub VerboseInfo($$$%)
4523
4549
  # get tag name
4524
4550
  if ($tagInfo and $$tagInfo{Name}) {
4525
4551
  $tag = $$tagInfo{Name};
4552
+ } elsif ($parms{Name}) { # (used for PNG Plus FPX tags)
4553
+ $tag = $parms{Name};
4554
+ undef $hexID;
4526
4555
  } else {
4527
4556
  my $prefix;
4528
4557
  $prefix = $parms{Table}{TAG_PREFIX} if $parms{Table};
@@ -6228,7 +6257,7 @@ sub WriteJPEG($$)
6228
6257
  last unless $$editDirs{CIFF};
6229
6258
  my $newData = '';
6230
6259
  my %dirInfo = (
6231
- RAF => new File::RandomAccess($segDataPt),
6260
+ RAF => File::RandomAccess->new($segDataPt),
6232
6261
  OutFile => \$newData,
6233
6262
  );
6234
6263
  require Image::ExifTool::CanonRaw;
@@ -6947,7 +6976,7 @@ sub SetFileTime($$;$$$$)
6947
6976
  }
6948
6977
  unless ($k32SetFileTime) {
6949
6978
  return 0 if defined $k32SetFileTime;
6950
- $k32SetFileTime = new Win32::API('KERNEL32', 'SetFileTime', 'NPPP', 'I');
6979
+ $k32SetFileTime = Win32::API->new('KERNEL32', 'SetFileTime', 'NPPP', 'I');
6951
6980
  unless ($k32SetFileTime) {
6952
6981
  $self->Warn('Error calling Win32::API::SetFileTime');
6953
6982
  $k32SetFileTime = 0;
@@ -7191,7 +7220,7 @@ sub WriteBinaryData($$$)
7191
7220
  $$self{HiddenData} = {
7192
7221
  Offset => $offset,
7193
7222
  Size => $size,
7194
- Fixup => new Image::ExifTool::Fixup,
7223
+ Fixup => Image::ExifTool::Fixup->new,
7195
7224
  Base => $$dirInfo{Base},
7196
7225
  };
7197
7226
  next;
@@ -7200,7 +7229,7 @@ sub WriteBinaryData($$$)
7200
7229
  next unless $$tagInfo{DataTag} eq 'PreviewImage' and $$self{FILE_TYPE} eq 'JPEG';
7201
7230
  my $previewInfo = $$self{PREVIEW_INFO};
7202
7231
  $previewInfo or $previewInfo = $$self{PREVIEW_INFO} = {
7203
- Fixup => new Image::ExifTool::Fixup,
7232
+ Fixup => Image::ExifTool::Fixup->new,
7204
7233
  };
7205
7234
  # set flag indicating we are using short pointers
7206
7235
  $$previewInfo{IsShort} = 1 unless $format eq 'int32u';
@@ -7304,7 +7333,7 @@ used routines.
7304
7333
 
7305
7334
  =head1 AUTHOR
7306
7335
 
7307
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
7336
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
7308
7337
 
7309
7338
  This library is free software; you can redistribute it and/or modify it
7310
7339
  under the same terms as Perl itself.
@@ -163,7 +163,7 @@ information from XISF (Extensible Image Serialization Format) images.
163
163
 
164
164
  =head1 AUTHOR
165
165
 
166
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
166
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
167
167
 
168
168
  This library is free software; you can redistribute it and/or modify it
169
169
  under the same terms as Perl itself.
@@ -50,7 +50,7 @@ use Image::ExifTool::Exif;
50
50
  use Image::ExifTool::GPS;
51
51
  require Exporter;
52
52
 
53
- $VERSION = '3.61';
53
+ $VERSION = '3.62';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -201,6 +201,7 @@ my %xmpNS = (
201
201
  nine => 'http://ns.nikon.com/nine/1.0/',
202
202
  hdr_metadata => 'http://ns.adobe.com/hdr-metadata/1.0/',
203
203
  hdrgm => 'http://ns.adobe.com/hdr-gain-map/1.0/',
204
+ xmpDSA => 'http://leica-camera.com/digital-shift-assistant/1.0/',
204
205
  # Note: Not included due to namespace prefix conflict with Device:Container
205
206
  # Container => 'http://ns.google.com/photos/1.0/container/',
206
207
  );
@@ -921,6 +922,10 @@ my %sRangeMask = (
921
922
  Name => 'hdrgm',
922
923
  SubDirectory => { TagTable => 'Image::ExifTool::XMP::hdrgm' },
923
924
  },
925
+ xmpDSA => {
926
+ Name => 'xmpDSA',
927
+ SubDirectory => { TagTable => 'Image::ExifTool::Panasonic::DSA' },
928
+ },
924
929
  # Note: Note included due to namespace prefix conflict with Device:Container
925
930
  # Container => {
926
931
  # Name => 'Container',
@@ -4158,7 +4163,18 @@ sub ProcessXMP($$;$)
4158
4163
  $dataLen = $$dirInfo{DataLen} || length($$dataPt);
4159
4164
  # check leading BOM (may indicate double-encoded UTF)
4160
4165
  pos($$dataPt) = $dirStart;
4161
- $double = $1 if $$dataPt =~ /\G((\0\0)?\xfe\xff|\xff\xfe(\0\0)?|\xef\xbb\xbf)\0*<\0*\?\0*x\0*p\0*a\0*c\0*k\0*e\0*t/g;
4166
+ if ($$dataPt =~ /\G((\0\0)?\xfe\xff|\xff\xfe(\0\0)?|\xef\xbb\xbf)\0*<\0*\?\0*x\0*p\0*a\0*c\0*k\0*e\0*t/g) {
4167
+ $double = $1
4168
+ } else {
4169
+ # handle UTF-16/32 XML
4170
+ pos($$dataPt) = $dirStart;
4171
+ if ($$dataPt =~ /\G((\0\0)?\xfe\xff|\xff\xfe(\0\0)?|\xef\xbb\xbf)\0*<\0*\?\0*x\0*m\0*l\0* /g) {
4172
+ my $tmp = $1;
4173
+ $fmt = $tmp =~ /\xfe\xff/ ? 'n' : 'v';
4174
+ $fmt = uc($fmt) if $tmp =~ /\0\0/;
4175
+ $isXML = 1;
4176
+ }
4177
+ }
4162
4178
  } else {
4163
4179
  my ($type, $mime, $buf2, $buf3);
4164
4180
  # read information from XMP file
@@ -4516,7 +4532,7 @@ information.
4516
4532
 
4517
4533
  =head1 AUTHOR
4518
4534
 
4519
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
4535
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
4520
4536
 
4521
4537
  This library is free software; you can redistribute it and/or modify it
4522
4538
  under the same terms as Perl itself.
@@ -2228,7 +2228,7 @@ This file contains definitions for less common XMP namespaces.
2228
2228
 
2229
2229
  =head1 AUTHOR
2230
2230
 
2231
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
2231
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
2232
2232
 
2233
2233
  This library is free software; you can redistribute it and/or modify it
2234
2234
  under the same terms as Perl itself.
@@ -937,7 +937,7 @@ information.
937
937
 
938
938
  =head1 AUTHOR
939
939
 
940
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
940
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
941
941
 
942
942
  This library is free software; you can redistribute it and/or modify it
943
943
  under the same terms as Perl itself.
@@ -20,7 +20,7 @@ use strict;
20
20
  use vars qw($VERSION $warnString);
21
21
  use Image::ExifTool qw(:DataAccess :Utils);
22
22
 
23
- $VERSION = '1.30';
23
+ $VERSION = '1.31';
24
24
 
25
25
  sub WarnProc($) { $warnString = $_[0]; }
26
26
 
@@ -367,7 +367,7 @@ sub ProcessRAR($$)
367
367
  # read the header and create new RAF object for reading it
368
368
  my $header;
369
369
  $raf->Read($header, $headSize) == $headSize or last;
370
- my $rafHdr = new File::RandomAccess(\$header);
370
+ my $rafHdr = File::RandomAccess->new(\$header);
371
371
  my $headType = ReadULEB($rafHdr); # get header type
372
372
 
373
373
  if ($headType == 4) { # encryption block
@@ -550,14 +550,14 @@ sub ProcessZIP($$)
550
550
  } elsif (eval { require IO::String }) {
551
551
  # read the whole file into memory (what else can I do?)
552
552
  $raf->Slurp();
553
- $fh = new IO::String ${$raf->{BUFF_PT}};
553
+ $fh = IO::String->new(${$raf->{BUFF_PT}});
554
554
  } else {
555
555
  my $type = $raf->{FILE_PT} ? 'pipe or socket' : 'scalar reference';
556
556
  $et->Warn("Install IO::String to decode compressed ZIP information from a $type");
557
557
  last;
558
558
  }
559
559
  $et->VPrint(1, " --- using Archive::Zip ---\n");
560
- $zip = new Archive::Zip;
560
+ $zip = Archive::Zip->new;
561
561
  # catch all warnings! (Archive::Zip is bad for this)
562
562
  local $SIG{'__WARN__'} = \&WarnProc;
563
563
  my $status = $zip->readFromFileHandle($fh);
@@ -568,8 +568,8 @@ sub ProcessZIP($$)
568
568
  # a failed test with Perl 5.6.2 GNU/Linux 2.6.32-5-686 i686-linux-64int-ld
569
569
  $raf->Seek(0,0);
570
570
  $raf->Slurp();
571
- $fh = new IO::String ${$raf->{BUFF_PT}};
572
- $zip = new Archive::Zip;
571
+ $fh = IO::String->new(${$raf->{BUFF_PT}});
572
+ $zip = Archive::Zip->new;
573
573
  $status = $zip->readFromFileHandle($fh);
574
574
  }
575
575
  if ($status) {
@@ -836,7 +836,7 @@ Electronic Publication (EPUB), and Sketch design files (SKETCH).
836
836
 
837
837
  =head1 AUTHOR
838
838
 
839
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
839
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
840
840
 
841
841
  This library is free software; you can redistribute it and/or modify it
842
842
  under the same terms as Perl itself.
@@ -220,7 +220,7 @@ metadata from Zeiss Integrated Software RAW (ZISRAW) CZI files.
220
220
 
221
221
  =head1 AUTHOR
222
222
 
223
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
223
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
224
224
 
225
225
  This library is free software; you can redistribute it and/or modify it
226
226
  under the same terms as Perl itself.
@@ -215,7 +215,7 @@ information from Apple iWork '09 XML+ZIP files.
215
215
 
216
216
  =head1 AUTHOR
217
217
 
218
- Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
218
+ Copyright 2003-2024, Phil Harvey (philharvey66 at gmail.com)
219
219
 
220
220
  This library is free software; you can redistribute it and/or modify it
221
221
  under the same terms as Perl itself.
@@ -8,7 +8,7 @@
8
8
  # Revisions: Nov. 12/2003 - P. Harvey Created
9
9
  # (See html/history.html for revision history)
10
10
  #
11
- # Legal: Copyright (c) 2003-2023, Phil Harvey (philharvey66 at gmail.com)
11
+ # Legal: Copyright (c) 2003-2024, Phil Harvey (philharvey66 at gmail.com)
12
12
  # This library is free software; you can redistribute it and/or
13
13
  # modify it under the same terms as Perl itself.
14
14
  #------------------------------------------------------------------------------
@@ -29,7 +29,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
30
30
  %static_vars);
31
31
 
32
- $VERSION = '12.72';
32
+ $VERSION = '12.74';
33
33
  $RELEASE = '';
34
34
  @ISA = qw(Exporter);
35
35
  %EXPORT_TAGS = (
@@ -77,7 +77,7 @@ sub GetDeleteGroups();
77
77
  sub AddUserDefinedTags($%);
78
78
  sub SetAlternateFile($$$);
79
79
  # non-public routines below
80
- sub InsertTagValues($$$;$$$);
80
+ sub InsertTagValues($$;$$$$);
81
81
  sub IsWritable($);
82
82
  sub IsSameFile($$$);
83
83
  sub IsRawType($);
@@ -1111,6 +1111,7 @@ my @availableOptions = (
1111
1111
  [ 'ImageHashType', 'MD5', 'image hash algorithm' ],
1112
1112
  [ 'Lang', $defaultLang, 'localized language for descriptions etc' ],
1113
1113
  [ 'LargeFileSupport', undef, 'flag indicating support of 64-bit file offsets' ],
1114
+ [ 'LimitLongValues', 60, 'length limit for long values' ],
1114
1115
  [ 'List', undef, '[deprecated, use ListSplit and ListJoin instead]' ],
1115
1116
  [ 'ListItem', undef, 'used to return a specific item from lists' ],
1116
1117
  [ 'ListJoin', ', ', 'join lists together with this separator' ],
@@ -2195,7 +2196,7 @@ sub new
2195
2196
  # use Image::ExifTool 'ImageInfo';
2196
2197
  # my $info = ImageInfo($file, 'DateTimeOriginal', 'ImageSize');
2197
2198
  # - or -
2198
- # my $et = new Image::ExifTool;
2199
+ # my $et = Image::ExifTool->new;
2199
2200
  # my $info = $et->ImageInfo($file, \@tagList, {Sort=>'Group0'} );
2200
2201
  sub ImageInfo($;@)
2201
2202
  {
@@ -2205,7 +2206,7 @@ sub ImageInfo($;@)
2205
2206
  if (ref $_[0] and UNIVERSAL::isa($_[0],'Image::ExifTool')) {
2206
2207
  $self = shift;
2207
2208
  } else {
2208
- $self = new Image::ExifTool;
2209
+ $self = Image::ExifTool->new;
2209
2210
  }
2210
2211
  my %saveOptions = %{$$self{OPTIONS}}; # save original options
2211
2212
 
@@ -2528,7 +2529,7 @@ sub ExtractInfo($;@)
2528
2529
  FILE_TYPE => $$self{FILE_TYPE},
2529
2530
  };
2530
2531
  $saveOrder = GetByteOrder(),
2531
- $$self{RAF} = new File::RandomAccess($_[0]);
2532
+ $$self{RAF} = File::RandomAccess->new($_[0]);
2532
2533
  $$self{PROCESSED} = { };
2533
2534
  delete $$self{EXIF_DATA};
2534
2535
  delete $$self{EXIF_POS};
@@ -2635,7 +2636,7 @@ sub ExtractInfo($;@)
2635
2636
  # open the file
2636
2637
  if ($self->Open(\*EXIFTOOL_FILE, $filename)) {
2637
2638
  # create random access file object
2638
- $raf = new File::RandomAccess(\*EXIFTOOL_FILE);
2639
+ $raf = File::RandomAccess->new(\*EXIFTOOL_FILE);
2639
2640
  # patch to force pipe to be buffered because seek returns success
2640
2641
  # in Windows cmd shell pipe even though it really failed
2641
2642
  $$raf{TESTED} = -1 if $filename eq '-' or $filename =~ /\|$/;
@@ -2766,12 +2767,16 @@ sub ExtractInfo($;@)
2766
2767
  $raf->BinMode(); # set binary mode before we start reading
2767
2768
  my $pos = $raf->Tell(); # get file position so we can rewind
2768
2769
  # loop through list of file types to test
2769
- my ($buff, $seekErr);
2770
+ my ($buff, $err);
2770
2771
  my %dirInfo = ( RAF => $raf, Base => $pos, TestBuff => \$buff );
2771
2772
  # read start of file for testing
2772
- $raf->Read($buff, $testLen) or $buff = '';
2773
- $raf->Seek($pos, 0) or $seekErr = 1;
2774
- until ($seekErr) {
2773
+ if ($raf->Read($buff, $testLen)) {
2774
+ $raf->Seek($pos, 0) or $err = 'Error seeking in file';
2775
+ } else {
2776
+ $err = $$raf{ERROR};
2777
+ $buff = '';
2778
+ }
2779
+ until ($err) {
2775
2780
  my $unkHeader;
2776
2781
  $type = shift @fileTypeList;
2777
2782
  if ($type) {
@@ -2794,7 +2799,7 @@ sub ExtractInfo($;@)
2794
2799
  $type = ($1 eq "\xff\xd8\xff") ? 'JPEG' : 'TIFF';
2795
2800
  my $skip = pos($buff) - length($1);
2796
2801
  $dirInfo{Base} = $pos + $skip;
2797
- $raf->Seek($pos + $skip, 0) or $seekErr = 1, last;
2802
+ $raf->Seek($pos + $skip, 0) or $err = 'Error seeking in file', last;
2798
2803
  $self->Warn("Processing $type-like data after unknown $skip-byte header");
2799
2804
  $unkHeader = 1 unless $$self{DOC_NUM};
2800
2805
  }
@@ -2840,14 +2845,13 @@ sub ExtractInfo($;@)
2840
2845
  last;
2841
2846
  }
2842
2847
  # seek back to try again from the same position in the file
2843
- $raf->Seek($pos, 0) or $seekErr = 1, last;
2848
+ $raf->Seek($pos, 0) or $err = 'Error seeking in file';
2844
2849
  }
2845
- if (not defined $type and not $$self{DOC_NUM}) {
2850
+ if (not $err and not defined $type and not $$self{DOC_NUM}) {
2846
2851
  # if we were given a single image with a known type there
2847
2852
  # must be a format error since we couldn't read it, otherwise
2848
2853
  # it is likely we don't support images of this type
2849
2854
  my $fileType = GetFileType($realname) || '';
2850
- my $err;
2851
2855
  if (not length $buff) {
2852
2856
  $err = 'File is empty';
2853
2857
  } else {
@@ -2888,10 +2892,9 @@ sub ExtractInfo($;@)
2888
2892
  }
2889
2893
  }
2890
2894
  }
2891
- $self->Error($err);
2892
2895
  }
2893
- if ($seekErr) {
2894
- $self->Error('Error seeking in file');
2896
+ if ($err) {
2897
+ $self->Error($err);
2895
2898
  } elsif ($self->Options('ScanForXMP') and (not defined $type or
2896
2899
  (not $fast and not $$self{FoundXMP})))
2897
2900
  {
@@ -4113,7 +4116,7 @@ sub Init($)
4113
4116
  $$self{FileType} = ''; # identified file type
4114
4117
  if ($self->Options('HtmlDump')) {
4115
4118
  require Image::ExifTool::HtmlDump;
4116
- $$self{HTML_DUMP} = new Image::ExifTool::HtmlDump;
4119
+ $$self{HTML_DUMP} = Image::ExifTool::HtmlDump->new;
4117
4120
  }
4118
4121
  # make sure our TextOut is a file reference
4119
4122
  $$self{OPTIONS}{TextOut} = \*STDOUT unless ref $$self{OPTIONS}{TextOut};
@@ -4176,7 +4179,7 @@ sub ExtractAltInfo($)
4176
4179
  # (eg. -file1 '$originalfilename')
4177
4180
  if ($fileName =~ /\$/) {
4178
4181
  my @tags = reverse sort keys %{$$self{VALUE}};
4179
- $fileName = $self->InsertTagValues(\@tags, $fileName, 'Warn');
4182
+ $fileName = $self->InsertTagValues($fileName, \@tags, 'Warn');
4180
4183
  next unless defined $fileName;
4181
4184
  }
4182
4185
  $altExifTool->ExtractInfo($fileName);
@@ -4503,7 +4506,7 @@ sub GetFileTime($$)
4503
4506
  $atime = $mtime = $ctime = pack 'LL', 0, 0;
4504
4507
  unless ($k32GetFileTime) {
4505
4508
  return () if defined $k32GetFileTime;
4506
- $k32GetFileTime = new Win32::API('KERNEL32', 'GetFileTime', 'NPPP', 'I');
4509
+ $k32GetFileTime = Win32::API->new('KERNEL32', 'GetFileTime', 'NPPP', 'I');
4507
4510
  unless ($k32GetFileTime) {
4508
4511
  $self->Warn('Error calling Win32::API::GetFileTime');
4509
4512
  $k32GetFileTime = 0;
@@ -4582,7 +4585,7 @@ sub ParseArguments($;@)
4582
4585
  my $buff = $@ ? pack('C*',unpack($] < 5.010000 ? 'U0C*' : 'C0C*',$$arg)) : Encode::encode('utf8',$$arg);
4583
4586
  $arg = \$buff;
4584
4587
  }
4585
- $$self{RAF} = new File::RandomAccess($arg);
4588
+ $$self{RAF} = File::RandomAccess->new($arg);
4586
4589
  # set filename to empty string to indicate that
4587
4590
  # we have a file but we didn't open it
4588
4591
  $$self{FILENAME} = '';
@@ -6317,6 +6320,20 @@ sub InverseFileName($$)
6317
6320
  return $val;
6318
6321
  }
6319
6322
 
6323
+ #------------------------------------------------------------------------------
6324
+ # Limit length of long values (to be used in PrintConv)
6325
+ # Inputs: 0) string value, 1) ExifTool ref
6326
+ # Returns: length-limited value
6327
+ sub LimitLongValues($$)
6328
+ {
6329
+ my ($str, $self) = @_;
6330
+ my $lim = $$self{OPTIONS}{LimitLongValues};
6331
+ if (length($str) > $lim and $lim >= 5) {
6332
+ $str = substr($str,0,$lim-5) . "[...]";
6333
+ }
6334
+ return $str;
6335
+ }
6336
+
6320
6337
  #------------------------------------------------------------------------------
6321
6338
  # Save information for HTML dump
6322
6339
  # Inputs: 0) ExifTool hash ref, 1) start offset, 2) data size
@@ -6966,7 +6983,7 @@ sub ProcessJPEG($$)
6966
6983
  } elsif ($$segDataPt =~ /^(II|MM).{4}HEAPJPGM/s) {
6967
6984
  next if $fast > 1; # skip processing for very fast
6968
6985
  $dumpType = 'CIFF';
6969
- my %dirInfo = ( RAF => new File::RandomAccess($segDataPt) );
6986
+ my %dirInfo = ( RAF => File::RandomAccess->new($segDataPt) );
6970
6987
  $$self{SET_GROUP1} = 'CIFF';
6971
6988
  push @{$$self{PATH}}, 'CIFF';
6972
6989
  require Image::ExifTool::CanonRaw;
@@ -7491,6 +7508,8 @@ sub ProcessJPEG($$)
7491
7508
  } elsif ($$segDataPt =~ /^AROT\0/ and $length > 10) {
7492
7509
  # iPhone "AROT" segment containing integrated intensity per 16 scan lines
7493
7510
  # (with number of elements N = ImageHeight / 16 - 1, ref PH/NealKrawetz)
7511
+ # "Absolute ROTational difference between two frames"
7512
+ # (see https://www.hackerfactor.com/blog/index.php?/archives/822-Apple-Rot.html)
7494
7513
  $xtra = 'segment (N=' . unpack('x6N', $$segDataPt) . ')';
7495
7514
  }
7496
7515
  } elsif ($marker == 0xeb) { # APP11 (JPEG-HDR, JUMBF)
@@ -7990,7 +8009,7 @@ sub DoProcessTIFF($$;$)
7990
8009
  }
7991
8010
  }
7992
8011
  # update FileType if necessary now that we know more about the file
7993
- if ($$self{DNGVersion} and $$self{FileType} !~ /^(DNG|GPR)$/) {
8012
+ if ($$self{DNGVersion} and $$self{FILE_TYPE} eq 'TIFF' and $$self{FileType} !~ /^(DNG|GPR)$/) {
7994
8013
  # override whatever FileType we set since we now know it is DNG
7995
8014
  $self->OverrideFileType($$self{TIFF_TYPE} = 'DNG');
7996
8015
  }
@@ -8428,7 +8447,7 @@ sub GetTagInfo($$$;$$$)
8428
8447
  $printConv = $$tagTablePtr{PRINT_CONV};
8429
8448
  } else {
8430
8449
  # limit length of printout (can be very long)
8431
- $printConv = 'length($val) > 60 ? substr($val,0,55) . "[...]" : $val';
8450
+ $printConv = \&LimitLongValues;
8432
8451
  }
8433
8452
  my $hex = sprintf("0x%.4x", $tagID);
8434
8453
  my $prefix = $$tagTablePtr{TAG_PREFIX};