exiftool_vendored 12.50.0 → 12.54.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +69 -3
  3. data/bin/MANIFEST +2 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +3 -3
  7. data/bin/exiftool +12 -9
  8. data/bin/lib/File/RandomAccess.pm +1 -1
  9. data/bin/lib/File/RandomAccess.pod +2 -2
  10. data/bin/lib/Image/ExifTool/AES.pm +1 -1
  11. data/bin/lib/Image/ExifTool/AFCP.pm +1 -1
  12. data/bin/lib/Image/ExifTool/AIFF.pm +1 -1
  13. data/bin/lib/Image/ExifTool/APE.pm +1 -1
  14. data/bin/lib/Image/ExifTool/APP12.pm +1 -1
  15. data/bin/lib/Image/ExifTool/ASF.pm +1 -1
  16. data/bin/lib/Image/ExifTool/Apple.pm +197 -27
  17. data/bin/lib/Image/ExifTool/Audible.pm +1 -1
  18. data/bin/lib/Image/ExifTool/BMP.pm +1 -1
  19. data/bin/lib/Image/ExifTool/BPG.pm +1 -1
  20. data/bin/lib/Image/ExifTool/BZZ.pm +1 -1
  21. data/bin/lib/Image/ExifTool/BigTIFF.pm +1 -1
  22. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +3 -3
  23. data/bin/lib/Image/ExifTool/CBOR.pm +1 -1
  24. data/bin/lib/Image/ExifTool/Canon.pm +14 -2
  25. data/bin/lib/Image/ExifTool/CanonCustom.pm +1 -1
  26. data/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  27. data/bin/lib/Image/ExifTool/CanonVRD.pm +9 -9
  28. data/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
  29. data/bin/lib/Image/ExifTool/Casio.pm +4 -4
  30. data/bin/lib/Image/ExifTool/Charset.pm +1 -1
  31. data/bin/lib/Image/ExifTool/DICOM.pm +1 -1
  32. data/bin/lib/Image/ExifTool/DJI.pm +1 -1
  33. data/bin/lib/Image/ExifTool/DNG.pm +1 -1
  34. data/bin/lib/Image/ExifTool/DPX.pm +1 -1
  35. data/bin/lib/Image/ExifTool/DV.pm +1 -1
  36. data/bin/lib/Image/ExifTool/DarwinCore.pm +1 -1
  37. data/bin/lib/Image/ExifTool/DjVu.pm +1 -1
  38. data/bin/lib/Image/ExifTool/EXE.pm +1 -1
  39. data/bin/lib/Image/ExifTool/Exif.pm +5 -16
  40. data/bin/lib/Image/ExifTool/FITS.pm +1 -1
  41. data/bin/lib/Image/ExifTool/FLAC.pm +1 -1
  42. data/bin/lib/Image/ExifTool/FLIF.pm +1 -1
  43. data/bin/lib/Image/ExifTool/FLIR.pm +7 -6
  44. data/bin/lib/Image/ExifTool/Fixup.pm +1 -1
  45. data/bin/lib/Image/ExifTool/Flash.pm +1 -1
  46. data/bin/lib/Image/ExifTool/FlashPix.pm +1 -1
  47. data/bin/lib/Image/ExifTool/Font.pm +1 -1
  48. data/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
  49. data/bin/lib/Image/ExifTool/FujiFilm.pm +20 -13
  50. data/bin/lib/Image/ExifTool/GE.pm +1 -1
  51. data/bin/lib/Image/ExifTool/GIF.pm +1 -1
  52. data/bin/lib/Image/ExifTool/GIMP.pm +1 -1
  53. data/bin/lib/Image/ExifTool/GPS.pm +12 -6
  54. data/bin/lib/Image/ExifTool/GeoTiff.pm +1 -1
  55. data/bin/lib/Image/ExifTool/Geotag.pm +13 -5
  56. data/bin/lib/Image/ExifTool/GoPro.pm +1 -1
  57. data/bin/lib/Image/ExifTool/H264.pm +1 -1
  58. data/bin/lib/Image/ExifTool/HP.pm +1 -1
  59. data/bin/lib/Image/ExifTool/HTML.pm +1 -1
  60. data/bin/lib/Image/ExifTool/HtmlDump.pm +1 -1
  61. data/bin/lib/Image/ExifTool/ICC_Profile.pm +1 -1
  62. data/bin/lib/Image/ExifTool/ICO.pm +1 -1
  63. data/bin/lib/Image/ExifTool/ID3.pm +1 -1
  64. data/bin/lib/Image/ExifTool/IPTC.pm +1 -1
  65. data/bin/lib/Image/ExifTool/ISO.pm +1 -1
  66. data/bin/lib/Image/ExifTool/ITC.pm +1 -1
  67. data/bin/lib/Image/ExifTool/Import.pm +1 -1
  68. data/bin/lib/Image/ExifTool/InDesign.pm +1 -1
  69. data/bin/lib/Image/ExifTool/JPEG.pm +2 -1
  70. data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  71. data/bin/lib/Image/ExifTool/JSON.pm +1 -1
  72. data/bin/lib/Image/ExifTool/JVC.pm +1 -1
  73. data/bin/lib/Image/ExifTool/Jpeg2000.pm +35 -8
  74. data/bin/lib/Image/ExifTool/Kodak.pm +1 -1
  75. data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  76. data/bin/lib/Image/ExifTool/LIF.pm +1 -1
  77. data/bin/lib/Image/ExifTool/LNK.pm +1 -1
  78. data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  79. data/bin/lib/Image/ExifTool/Lang/de.pm +2 -2
  80. data/bin/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
  81. data/bin/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
  82. data/bin/lib/Image/ExifTool/Lang/es.pm +1 -1
  83. data/bin/lib/Image/ExifTool/Lang/fi.pm +1 -1
  84. data/bin/lib/Image/ExifTool/Lang/fr.pm +6016 -760
  85. data/bin/lib/Image/ExifTool/Lang/it.pm +1 -1
  86. data/bin/lib/Image/ExifTool/Lang/ja.pm +1 -1
  87. data/bin/lib/Image/ExifTool/Lang/ko.pm +1 -1
  88. data/bin/lib/Image/ExifTool/Lang/nl.pm +1 -1
  89. data/bin/lib/Image/ExifTool/Lang/pl.pm +1 -1
  90. data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  91. data/bin/lib/Image/ExifTool/Lang/sk.pm +1806 -0
  92. data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  93. data/bin/lib/Image/ExifTool/Lang/tr.pm +1 -1
  94. data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  95. data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  96. data/bin/lib/Image/ExifTool/Leaf.pm +1 -1
  97. data/bin/lib/Image/ExifTool/Lytro.pm +1 -1
  98. data/bin/lib/Image/ExifTool/M2TS.pm +1 -1
  99. data/bin/lib/Image/ExifTool/MIE.pm +1 -1
  100. data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  101. data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  102. data/bin/lib/Image/ExifTool/MISB.pm +1 -1
  103. data/bin/lib/Image/ExifTool/MNG.pm +1 -1
  104. data/bin/lib/Image/ExifTool/MOI.pm +1 -1
  105. data/bin/lib/Image/ExifTool/MPC.pm +1 -1
  106. data/bin/lib/Image/ExifTool/MPEG.pm +1 -1
  107. data/bin/lib/Image/ExifTool/MPF.pm +1 -1
  108. data/bin/lib/Image/ExifTool/MRC.pm +1 -1
  109. data/bin/lib/Image/ExifTool/MWG.pm +1 -1
  110. data/bin/lib/Image/ExifTool/MXF.pm +1 -1
  111. data/bin/lib/Image/ExifTool/MacOS.pm +1 -1
  112. data/bin/lib/Image/ExifTool/MakerNotes.pm +1 -1
  113. data/bin/lib/Image/ExifTool/Matroska.pm +262 -46
  114. data/bin/lib/Image/ExifTool/Microsoft.pm +1 -1
  115. data/bin/lib/Image/ExifTool/Minolta.pm +1 -1
  116. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
  117. data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  118. data/bin/lib/Image/ExifTool/Nikon.pm +658 -276
  119. data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  120. data/bin/lib/Image/ExifTool/NikonCustom.pm +140 -107
  121. data/bin/lib/Image/ExifTool/NikonSettings.pm +1 -1
  122. data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  123. data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
  124. data/bin/lib/Image/ExifTool/Ogg.pm +1 -1
  125. data/bin/lib/Image/ExifTool/Olympus.pm +4 -3
  126. data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  127. data/bin/lib/Image/ExifTool/Opus.pm +1 -1
  128. data/bin/lib/Image/ExifTool/Other.pm +1 -1
  129. data/bin/lib/Image/ExifTool/PCX.pm +1 -1
  130. data/bin/lib/Image/ExifTool/PDF.pm +1 -1
  131. data/bin/lib/Image/ExifTool/PGF.pm +1 -1
  132. data/bin/lib/Image/ExifTool/PICT.pm +1 -1
  133. data/bin/lib/Image/ExifTool/PLIST.pm +12 -7
  134. data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  135. data/bin/lib/Image/ExifTool/PNG.pm +9 -2
  136. data/bin/lib/Image/ExifTool/PPM.pm +1 -1
  137. data/bin/lib/Image/ExifTool/PSP.pm +1 -1
  138. data/bin/lib/Image/ExifTool/Palm.pm +1 -1
  139. data/bin/lib/Image/ExifTool/Panasonic.pm +1 -1
  140. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +1 -1
  141. data/bin/lib/Image/ExifTool/Parrot.pm +1 -1
  142. data/bin/lib/Image/ExifTool/Pentax.pm +1 -1
  143. data/bin/lib/Image/ExifTool/PhaseOne.pm +1 -1
  144. data/bin/lib/Image/ExifTool/PhotoCD.pm +1 -1
  145. data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  146. data/bin/lib/Image/ExifTool/Photoshop.pm +1 -1
  147. data/bin/lib/Image/ExifTool/PostScript.pm +1 -1
  148. data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  149. data/bin/lib/Image/ExifTool/Qualcomm.pm +1 -1
  150. data/bin/lib/Image/ExifTool/QuickTime.pm +8 -4
  151. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +63 -15
  152. data/bin/lib/Image/ExifTool/README +2 -1
  153. data/bin/lib/Image/ExifTool/RIFF.pm +1 -1
  154. data/bin/lib/Image/ExifTool/RSRC.pm +1 -1
  155. data/bin/lib/Image/ExifTool/RTF.pm +1 -1
  156. data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  157. data/bin/lib/Image/ExifTool/Rawzor.pm +1 -1
  158. data/bin/lib/Image/ExifTool/Real.pm +1 -1
  159. data/bin/lib/Image/ExifTool/Reconyx.pm +1 -1
  160. data/bin/lib/Image/ExifTool/Red.pm +1 -1
  161. data/bin/lib/Image/ExifTool/Ricoh.pm +1 -1
  162. data/bin/lib/Image/ExifTool/Samsung.pm +3 -1
  163. data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  164. data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  165. data/bin/lib/Image/ExifTool/Shift.pl +1 -1
  166. data/bin/lib/Image/ExifTool/Shortcuts.pm +1 -1
  167. data/bin/lib/Image/ExifTool/Sigma.pm +1 -1
  168. data/bin/lib/Image/ExifTool/SigmaRaw.pm +1 -1
  169. data/bin/lib/Image/ExifTool/Sony.pm +7 -7
  170. data/bin/lib/Image/ExifTool/SonyIDC.pm +1 -1
  171. data/bin/lib/Image/ExifTool/Stim.pm +1 -1
  172. data/bin/lib/Image/ExifTool/TagInfoXML.pm +13 -8
  173. data/bin/lib/Image/ExifTool/TagLookup.pm +4599 -4505
  174. data/bin/lib/Image/ExifTool/TagNames.pod +313 -39
  175. data/bin/lib/Image/ExifTool/Text.pm +1 -1
  176. data/bin/lib/Image/ExifTool/Theora.pm +1 -1
  177. data/bin/lib/Image/ExifTool/Torrent.pm +1 -1
  178. data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  179. data/bin/lib/Image/ExifTool/VCard.pm +1 -1
  180. data/bin/lib/Image/ExifTool/Validate.pm +1 -1
  181. data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  182. data/bin/lib/Image/ExifTool/WTV.pm +1 -1
  183. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  184. data/bin/lib/Image/ExifTool/WriteExif.pl +14 -1
  185. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  186. data/bin/lib/Image/ExifTool/WritePDF.pl +5 -1
  187. data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  188. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  189. data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -1
  190. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +30 -14
  191. data/bin/lib/Image/ExifTool/WriteRIFF.pl +1 -1
  192. data/bin/lib/Image/ExifTool/WriteXMP.pl +16 -2
  193. data/bin/lib/Image/ExifTool/Writer.pl +35 -15
  194. data/bin/lib/Image/ExifTool/XMP.pm +23 -3
  195. data/bin/lib/Image/ExifTool/XMP2.pl +20 -1
  196. data/bin/lib/Image/ExifTool/XMPStruct.pl +1 -1
  197. data/bin/lib/Image/ExifTool/ZIP.pm +20 -8
  198. data/bin/lib/Image/ExifTool/ZISRAW.pm +1 -1
  199. data/bin/lib/Image/ExifTool/iWork.pm +1 -1
  200. data/bin/lib/Image/ExifTool.pm +38 -16
  201. data/bin/lib/Image/ExifTool.pod +39 -38
  202. data/bin/perl-Image-ExifTool.spec +1 -1
  203. data/lib/exiftool_vendored/version.rb +1 -1
  204. metadata +3 -2
@@ -53,6 +53,19 @@ my %mandatory = (
53
53
  },
54
54
  );
55
55
 
56
+ #------------------------------------------------------------------------------
57
+ # Inverse print conversion for OffsetTime tags
58
+ # Inputs: 0) input time zone or date/time value, 1) ExifTool ref
59
+ # Returns: Time zone string for writing to EXIF
60
+ sub InverseOffsetTime($$)
61
+ {
62
+ my ($val, $et) = @_;
63
+ $val = $et->TimeNow() if lc($val) eq 'now';
64
+ return '+00:00' if $val =~ /Z$/;
65
+ return sprintf('%s%.2d:%.2d',$1,$2,$3) if $val =~ /([-+])(\d{1,2}):?(\d{2})/;
66
+ return undef;
67
+ }
68
+
56
69
  #------------------------------------------------------------------------------
57
70
  # Inverse print conversion for LensInfo
58
71
  # Inputs: 0) lens info string
@@ -2640,7 +2653,7 @@ This file contains routines to write EXIF metadata.
2640
2653
 
2641
2654
  =head1 AUTHOR
2642
2655
 
2643
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
2656
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
2644
2657
 
2645
2658
  This library is free software; you can redistribute it and/or modify it
2646
2659
  under the same terms as Perl itself.
@@ -711,7 +711,7 @@ seldom-used routines.
711
711
 
712
712
  =head1 AUTHOR
713
713
 
714
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
714
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
715
715
 
716
716
  This library is free software; you can redistribute it and/or modify it
717
717
  under the same terms as Perl itself.
@@ -395,6 +395,10 @@ sub WritePDF($$)
395
395
 
396
396
  # must pre-determine Info reference to be used in encryption
397
397
  my $infoRef = $prevInfoRef || \ "$nextObject 0 R";
398
+ unless (ref $infoRef eq 'SCALAR') {
399
+ $et->Error("Info dictionary is not an indirect object");
400
+ return $rtn;
401
+ }
398
402
  $keyExt = $$infoRef;
399
403
 
400
404
  # must encrypt all values in dictionary if they came from an encrypted stream
@@ -750,7 +754,7 @@ C<PDF-update> pseudo group).
750
754
 
751
755
  =head1 AUTHOR
752
756
 
753
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
757
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
754
758
 
755
759
  This library is free software; you can redistribute it and/or modify it
756
760
  under the same terms as Perl itself.
@@ -401,7 +401,7 @@ strings).
401
401
 
402
402
  =head1 AUTHOR
403
403
 
404
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
404
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
405
405
 
406
406
  This library is free software; you can redistribute it and/or modify it
407
407
  under the same terms as Perl itself.
@@ -257,7 +257,7 @@ default resource name, and applied if no appended name is provided.
257
257
 
258
258
  =head1 AUTHOR
259
259
 
260
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
260
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
261
261
 
262
262
  This library is free software; you can redistribute it and/or modify it
263
263
  under the same terms as Perl itself.
@@ -687,7 +687,7 @@ Thanks to Tim Kordick for his help testing the EPS writer.
687
687
 
688
688
  =head1 AUTHOR
689
689
 
690
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
690
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
691
691
 
692
692
  This library is free software; you can redistribute it and/or modify it
693
693
  under the same terms as Perl itself.
@@ -306,14 +306,17 @@ sub CheckQTValue($$$)
306
306
 
307
307
  #------------------------------------------------------------------------------
308
308
  # Format QuickTime value for writing
309
- # Inputs: 0) ExifTool ref, 1) value ref, 2) Format (or undef), 3) Writable (or undef)
310
- # Returns: Flags for QT data type, and reformats value as required
309
+ # Inputs: 0) ExifTool ref, 1) value ref, 2) tagInfo ref, 3) Format (or undef)
310
+ # Returns: Flags for QT data type, and reformats value as required (sets to undef on error)
311
311
  sub FormatQTValue($$;$$)
312
312
  {
313
- my ($et, $valPt, $format, $writable) = @_;
313
+ my ($et, $valPt, $tagInfo, $format) = @_;
314
+ my $writable = $$tagInfo{Writable};
315
+ my $count = $$tagInfo{Count};
314
316
  my $flags;
317
+ $format or $format = $$tagInfo{Format};
315
318
  if ($format and $format ne 'string' or not $format and $writable and $writable ne 'string') {
316
- $$valPt = WriteValue($$valPt, $format || $writable);
319
+ $$valPt = WriteValue($$valPt, $format || $writable, $count);
317
320
  if ($writable and $qtFormat{$writable}) {
318
321
  $flags = $qtFormat{$writable};
319
322
  } else {
@@ -329,6 +332,7 @@ sub FormatQTValue($$;$$)
329
332
  $flags = 0x01; # UTF8
330
333
  $$valPt = $et->Encode($$valPt, 'UTF8');
331
334
  }
335
+ defined $$valPt or $et->WarnOnce("Error converting value for $$tagInfo{Name}");
332
336
  return $flags;
333
337
  }
334
338
 
@@ -1139,7 +1143,7 @@ sub WriteQuickTime($$$)
1139
1143
  my $newVal = $et->GetNewValue($nvHash);
1140
1144
  next unless defined $newVal;
1141
1145
  my $prVal = $newVal;
1142
- my $flags = FormatQTValue($et, \$newVal, $format, $$tagInfo{Writable});
1146
+ my $flags = FormatQTValue($et, \$newVal, $tagInfo, $format);
1143
1147
  next unless defined $newVal;
1144
1148
  my ($ctry, $lang) = (0, 0);
1145
1149
  if ($$ti{LangCode}) {
@@ -1220,7 +1224,8 @@ sub WriteQuickTime($$$)
1220
1224
  }
1221
1225
  my $prVal = $newVal;
1222
1226
  # format new value for writing (and get new flags)
1223
- $flags = FormatQTValue($et, \$newVal, $format, $$tagInfo{Writable});
1227
+ $flags = FormatQTValue($et, \$newVal, $tagInfo, $format);
1228
+ next unless defined $newVal;
1224
1229
  my $grp = $et->GetGroup($langInfo, 1);
1225
1230
  $et->VerboseValue("- $grp:$$langInfo{Name}", $val);
1226
1231
  $et->VerboseValue("+ $grp:$$langInfo{Name}", $prVal);
@@ -1463,7 +1468,7 @@ sub WriteQuickTime($$$)
1463
1468
  my $newVal = $et->GetNewValue($nvHash);
1464
1469
  next unless defined $newVal;
1465
1470
  my $prVal = $newVal;
1466
- my $flags = FormatQTValue($et, \$newVal, $$tagInfo{Format}, $$tagInfo{Writable});
1471
+ my $flags = FormatQTValue($et, \$newVal, $tagInfo);
1467
1472
  next unless defined $newVal;
1468
1473
  my ($ctry, $lang) = (0, 0);
1469
1474
  # handle alternate languages
@@ -1662,12 +1667,18 @@ sub WriteQuickTime($$$)
1662
1667
  # edit size of mdat in header if necessary
1663
1668
  if ($diff) {
1664
1669
  if (length($$hdrChunk[2]) == 8) {
1665
- my $size = Get32u(\$$hdrChunk[2], 0) + $diff;
1666
- $size > 0xffffffff and $et->Error("Can't yet grow mdat across 4GB boundary"), return $rtnVal;
1667
- Set32u($size, \$$hdrChunk[2], 0);
1670
+ my $size = Get32u(\$$hdrChunk[2], 0);
1671
+ if ($size) { # (0 size = extends to end of file)
1672
+ $size += $diff;
1673
+ $size > 0xffffffff and $et->Error("Can't yet grow mdat across 4GB boundary"), return $rtnVal;
1674
+ Set32u($size, \$$hdrChunk[2], 0);
1675
+ }
1668
1676
  } elsif (length($$hdrChunk[2]) == 16) {
1669
- my $size = Get64u(\$$hdrChunk[2], 8) + $diff;
1670
- Set64u($size, \$$hdrChunk[2], 8);
1677
+ my $size = Get64u(\$$hdrChunk[2], 8);
1678
+ if ($size) {
1679
+ $size += $diff;
1680
+ Set64u($size, \$$hdrChunk[2], 8);
1681
+ }
1671
1682
  } else {
1672
1683
  $et->Error('Internal error. Invalid mdat header');
1673
1684
  return $rtnVal;
@@ -1894,7 +1905,12 @@ sub WriteMOV($$)
1894
1905
  $ftype = 'MOV';
1895
1906
  }
1896
1907
  $et->SetFileType($ftype); # need to set "FileType" tag for a Condition
1897
- $et->InitWriteDirs($dirMap{$ftype}, 'XMP', 'QuickTime');
1908
+ if ($ftype eq 'HEIC') {
1909
+ # EXIF is preferred in HEIC files
1910
+ $et->InitWriteDirs($dirMap{$ftype}, 'EXIF', 'QuickTime');
1911
+ } else {
1912
+ $et->InitWriteDirs($dirMap{$ftype}, 'XMP', 'QuickTime');
1913
+ }
1898
1914
  $$et{DirMap} = $dirMap{$ftype}; # need access to directory map when writing
1899
1915
  # track tags globally to avoid creating multiple tags in the case of duplicate directories
1900
1916
  $$et{DidTag} = { };
@@ -1927,7 +1943,7 @@ QuickTime-based file formats like MOV and MP4.
1927
1943
 
1928
1944
  =head1 AUTHOR
1929
1945
 
1930
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
1946
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
1931
1947
 
1932
1948
  This library is free software; you can redistribute it and/or modify it
1933
1949
  under the same terms as Perl itself.
@@ -338,7 +338,7 @@ Currently writes only WebP files.
338
338
 
339
339
  =head1 AUTHOR
340
340
 
341
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
341
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
342
342
 
343
343
  This library is free software; you can redistribute it and/or modify it
344
344
  under the same terms as Perl itself.
@@ -561,7 +561,21 @@ sub AddStructType($$$$;$)
561
561
  }
562
562
 
563
563
  #------------------------------------------------------------------------------
564
- # Hack to use XMP writer for SphericalVideoXML
564
+ # Process SphericalVideoXML (see XMP-GSpherical tags documentation)
565
+ # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
566
+ # Returns: SphericalVideoXML data
567
+ sub ProcessGSpherical($$$)
568
+ {
569
+ my ($et, $dirInfo, $tagTablePtr) = @_;
570
+ # extract SphericalVideoXML as a block if requested
571
+ if ($$et{REQ_TAG_LOOKUP}{sphericalvideoxml}) {
572
+ $et->FoundTag(SphericalVideoXML => substr(${$$dirInfo{DataPt}}, 16));
573
+ }
574
+ return Image::ExifTool::XMP::ProcessXMP($et, $dirInfo, $tagTablePtr);
575
+ }
576
+
577
+ #------------------------------------------------------------------------------
578
+ # Hack to use XMP writer for SphericalVideoXML (see XMP-GSpherical tags documentation)
565
579
  # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
566
580
  # Returns: SphericalVideoXML data
567
581
  sub WriteGSpherical($$$)
@@ -1621,7 +1635,7 @@ This file contains routines to write XMP metadata.
1621
1635
 
1622
1636
  =head1 AUTHOR
1623
1637
 
1624
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
1638
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
1625
1639
 
1626
1640
  This library is free software; you can redistribute it and/or modify it
1627
1641
  under the same terms as Perl itself.
@@ -242,7 +242,7 @@ my %intRange = (
242
242
  'int64s' => [-9223372036854775808, 9223372036854775807],
243
243
  );
244
244
  # lookup for file types with block-writable EXIF
245
- my %blockExifTypes = map { $_ => 1 } qw(JPEG PNG JP2 MIE EXIF FLIF MOV MP4 RIFF);
245
+ my %blockExifTypes = map { $_ => 1 } qw(JPEG PNG JP2 JXL MIE EXIF FLIF MOV MP4 RIFF);
246
246
 
247
247
  my $maxSegmentLen = 0xfffd; # maximum length of data in a JPEG segment
248
248
  my $maxXMPLen = $maxSegmentLen; # maximum length of XMP data in JPEG
@@ -707,9 +707,13 @@ TAG: foreach $tagInfo (@matchingTags) {
707
707
  $writeGroup or $writeGroup = $group0;
708
708
  # get priority for this group
709
709
  unless ($priority) {
710
- $priority = $$self{WRITE_PRIORITY}{lc($writeGroup)};
711
- unless ($priority) {
712
- $priority = $$self{WRITE_PRIORITY}{lc($group0)} || 0;
710
+ if ($$tagInfo{Avoid} and $$tagInfo{WriteAlso}) {
711
+ $priority = 0;
712
+ } else {
713
+ $priority = $$self{WRITE_PRIORITY}{lc($writeGroup)};
714
+ unless ($priority) {
715
+ $priority = $$self{WRITE_PRIORITY}{lc($group0)} || 0;
716
+ }
713
717
  }
714
718
  }
715
719
  # adjust priority based on Preferred level for this tag
@@ -830,6 +834,8 @@ TAG: foreach $tagInfo (@matchingTags) {
830
834
  $tag = $$tagInfo{Name}; # get tag name for warnings
831
835
  my $lcTag = lc $tag;
832
836
  my $pref = $preferred{$lcTag} || { };
837
+ # don't write Avoid-ed tags with side effect unless preferred
838
+ next if not $$pref{$tagInfo} and $$tagInfo{Avoid} and $$tagInfo{WriteAlso};
833
839
  my $shift = $options{Shift};
834
840
  my $addValue = $options{AddValue};
835
841
  if (defined $shift) {
@@ -971,6 +977,7 @@ TAG: foreach $tagInfo (@matchingTags) {
971
977
  $self->GetNewValueHash($tagInfo, $writeGroup, 'delete', $options{ProtectSaved});
972
978
  # also delete related tag previous new values
973
979
  if ($$tagInfo{WriteAlso}) {
980
+ $$self{INDENT2} = '+';
974
981
  my ($wgrp, $wtag);
975
982
  if ($$tagInfo{WriteGroup} and $$tagInfo{WriteGroup} eq 'All' and $writeGroup) {
976
983
  $wgrp = $writeGroup . ':';
@@ -981,6 +988,7 @@ TAG: foreach $tagInfo (@matchingTags) {
981
988
  my ($n,$e) = $self->SetNewValue($wgrp . $wtag, undef, Replace=>2);
982
989
  $numSet += $n;
983
990
  }
991
+ $$self{INDENT2} = '';
984
992
  }
985
993
  $options{Replace} == 2 and ++$numSet, next;
986
994
  }
@@ -1022,7 +1030,7 @@ TAG: foreach $tagInfo (@matchingTags) {
1022
1030
  require 'Image/ExifTool/XMPStruct.pl';
1023
1031
  $_ = Image::ExifTool::XMP::SerializeStruct($_);
1024
1032
  }
1025
- print $out "$verb $wgrp1:$tag$fromList if value is '${_}'\n";
1033
+ print $out "$$self{INDENT2}$verb $wgrp1:$tag$fromList if value is '${_}'\n";
1026
1034
  }
1027
1035
  }
1028
1036
  }
@@ -1086,15 +1094,25 @@ TAG: foreach $tagInfo (@matchingTags) {
1086
1094
  push @{$$nvHash{Value}}, ref $val eq 'ARRAY' ? @$val : $val;
1087
1095
  }
1088
1096
  if ($verbose > 1) {
1089
- my $ifExists = $$nvHash{IsCreating} ? ( $createOnly ?
1090
- ($$nvHash{IsCreating} == 2 ?
1091
- " if $writeGroup exists and tag doesn't" :
1092
- " if tag doesn't exist") :
1093
- ($$nvHash{IsCreating} == 2 ? " if $writeGroup exists" : '')) :
1097
+ my $ifExists;
1098
+ if ($$tagInfo{IsComposite}) {
1099
+ # (composite tags don't technically exist in the file)
1100
+ if ($$tagInfo{WriteAlso}) {
1101
+ $ifExists = ' (+' . join(',+',sort keys %{$$tagInfo{WriteAlso}}) . '):';
1102
+ } else {
1103
+ $ifExists = '';
1104
+ }
1105
+ } else {
1106
+ $ifExists = $$nvHash{IsCreating} ? ( $createOnly ?
1107
+ ($$nvHash{IsCreating} == 2 ?
1108
+ " if $writeGroup exists and tag doesn't" :
1109
+ " if tag doesn't exist") :
1110
+ ($$nvHash{IsCreating} == 2 ? " if $writeGroup exists" : '')) :
1094
1111
  (($$nvHash{DelValue} and @{$$nvHash{DelValue}}) ?
1095
- ' if tag was deleted' : ' if tag exists');
1112
+ ' if tag was deleted' : ' if tag exists');
1113
+ }
1096
1114
  my $verb = ($shift ? 'Shifting' : ($addValue ? 'Adding' : 'Writing'));
1097
- print $out "$verb $wgrp1:$tag$ifExists\n";
1115
+ print $out "$$self{INDENT2}$verb $wgrp1:$tag$ifExists\n";
1098
1116
  }
1099
1117
  }
1100
1118
  } elsif ($permanent) {
@@ -1109,7 +1127,7 @@ TAG: foreach $tagInfo (@matchingTags) {
1109
1127
  $self->GetNewValueHash($tagInfo, $writeGroup, 'delete');
1110
1128
  my $nvHash = $self->GetNewValueHash($tagInfo, $writeGroup, 'create');
1111
1129
  $$nvHash{WantGroup} = $wantGroup;
1112
- $verbose > 1 and print $out "Deleting $wgrp1:$tag\n";
1130
+ $verbose > 1 and print $out "$$self{INDENT2}Deleting $wgrp1:$tag\n";
1113
1131
  }
1114
1132
  $$setTags{$tagInfo} = 1 if $setTags;
1115
1133
  $prioritySet = 1 if $$pref{$tagInfo};
@@ -1118,6 +1136,7 @@ WriteAlso:
1118
1136
  # also write related tags
1119
1137
  my $writeAlso = $$tagInfo{WriteAlso};
1120
1138
  if ($writeAlso) {
1139
+ $$self{INDENT2} = '+'; # indicate related tag with a leading "+"
1121
1140
  my ($wgrp, $wtag, $n);
1122
1141
  if ($$tagInfo{WriteGroup} and $$tagInfo{WriteGroup} eq 'All' and $writeGroup) {
1123
1142
  $wgrp = $writeGroup . ':';
@@ -1137,7 +1156,7 @@ WriteAlso:
1137
1156
  SetTags => \%alsoWrote, # remember tags already written
1138
1157
  );
1139
1158
  undef $evalWarning;
1140
- #### eval WriteAlso ($val)
1159
+ #### eval WriteAlso ($val,%opts)
1141
1160
  my $v = eval $$writeAlso{$wtag};
1142
1161
  # we wanted to do the eval in case there are side effect, but we
1143
1162
  # don't want to write a value for a tag that is being deleted:
@@ -1159,6 +1178,7 @@ WriteAlso:
1159
1178
  }
1160
1179
  }
1161
1180
  }
1181
+ $$self{INDENT2} = '';
1162
1182
  }
1163
1183
  }
1164
1184
  # print warning if we couldn't set our priority tag
@@ -7045,7 +7065,7 @@ used routines.
7045
7065
 
7046
7066
  =head1 AUTHOR
7047
7067
 
7048
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
7068
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
7049
7069
 
7050
7070
  This library is free software; you can redistribute it and/or modify it
7051
7071
  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.55';
53
+ $VERSION = '3.56';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -87,6 +87,7 @@ my %stdPath = (
87
87
  'MicrosoftPhoto' => 'microsoft',
88
88
  'prismusagerights' => 'pur',
89
89
  'GettyImagesGIFT' => 'getty',
90
+ 'hdr_metadata' => 'hdr',
90
91
  );
91
92
 
92
93
  # translate ExifTool XMP family 1 group names back to standard XMP namespace prefixes
@@ -197,6 +198,7 @@ my %xmpNS = (
197
198
  sdc => 'http://ns.nikon.com/sdc/1.0/',
198
199
  ast => 'http://ns.nikon.com/asteroid/1.0/',
199
200
  nine => 'http://ns.nikon.com/nine/1.0/',
201
+ hdr_metadata => 'http://ns.adobe.com/hdr-metadata/1.0/',
200
202
  );
201
203
 
202
204
  # build reverse namespace lookup
@@ -895,6 +897,10 @@ my %sRangeMask = (
895
897
  Name => 'nine',
896
898
  SubDirectory => { TagTable => 'Image::ExifTool::Nikon::nine' },
897
899
  },
900
+ hdr => {
901
+ Name => 'hdr',
902
+ SubDirectory => { TagTable => 'Image::ExifTool::XMP::hdr' },
903
+ },
898
904
  );
899
905
 
900
906
  # hack to allow XML containing Dublin Core metadata to be handled like XMP (eg. EPUB - see ZIP.pm)
@@ -1728,6 +1734,14 @@ my %sPantryItem = (
1728
1734
  List => 'Seq',
1729
1735
  },
1730
1736
  RangeMaskMapInfo => { Name => 'RangeMask', Struct => \%sRangeMask, FlatName => 'RangeMask' },
1737
+ # new for ACR 15.1 (not sure if these are integer or real, so just guess)
1738
+ HDREditMode => { Writable => 'integer' },
1739
+ SDRBrightness => { Writable => 'real' },
1740
+ SDRContrast => { Writable => 'real' },
1741
+ SDRHighlights => { Writable => 'real' },
1742
+ SDRShadows => { Writable => 'real' },
1743
+ SDRWhites => { Writable => 'real' },
1744
+ SDRBlend => { Writable => 'real' },
1731
1745
  );
1732
1746
 
1733
1747
  # Tiff namespace properties (tiff)
@@ -2279,7 +2293,13 @@ my %sPantryItem = (
2279
2293
  PrintConvInv => '$val=~s/\s*m$//; $val',
2280
2294
  },
2281
2295
  NativeDigest => { }, #PH
2282
- # new Exif
2296
+ # the following written incorrectly by ACR 15.1
2297
+ # SubSecTime (should not be written according to Exif4XMP 2.32 specification)
2298
+ # SubSecTimeOriginal (should not be written according to Exif4XMP 2.32 specification)
2299
+ # SubSecTimeDigitized (should not be written according to Exif4XMP 2.32 specification)
2300
+ # SerialNumber (should be BodySerialNumber)
2301
+ # Lens (should be XMP-aux)
2302
+ # LensInfo (should be XMP-aux)
2283
2303
  );
2284
2304
 
2285
2305
  # Exif extended properties (exifEX, ref 12)
@@ -4392,7 +4412,7 @@ information.
4392
4412
 
4393
4413
  =head1 AUTHOR
4394
4414
 
4395
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
4415
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
4396
4416
 
4397
4417
  This library is free software; you can redistribute it and/or modify it
4398
4418
  under the same terms as Perl itself.
@@ -2074,6 +2074,25 @@ my %sSubVersion = (
2074
2074
  },
2075
2075
  );
2076
2076
 
2077
+ # hdr metadata namespace used by ACR 15.1
2078
+ %Image::ExifTool::XMP::hdr = (
2079
+ %xmpTableDefaults,
2080
+ GROUPS => { 1 => 'XMP-hdr', 2 => 'Image' },
2081
+ NAMESPACE => 'hdr_metadata',
2082
+ TABLE_DESC => 'XMP HDR Metadata',
2083
+ NOTES => q{
2084
+ HDR metadata namespace tags written by ACR 15.1. The actual namespace
2085
+ prefix is "hdr_metadata", which is the prefix recorded in the file, but
2086
+ ExifTool shortens this for the family 1 group name.
2087
+ },
2088
+ ccv_primaries_xy => { Name => 'CCVPrimariesXY' }, # (comma-separated string of 6 reals)
2089
+ ccv_white_xy => { Name => 'CCVWhiteXY' }, # (comma-separated string of 2 reals)
2090
+ ccv_min_luminance_nits => { Name => 'CCVMinLuminanceNits', Writable => 'real' },
2091
+ ccv_max_luminance_nits => { Name => 'CCVMaxLuminanceNits', Writable => 'real' },
2092
+ ccv_avg_luminance_nits => { Name => 'CCVAvgLuminanceNits', Writable => 'real' },
2093
+ scene_referred => { Name => 'SceneReferred', Writable => 'boolean' },
2094
+ );
2095
+
2077
2096
  # SVG namespace properties (ref 9)
2078
2097
  %Image::ExifTool::XMP::SVG = (
2079
2098
  GROUPS => { 0 => 'SVG', 1 => 'SVG', 2 => 'Image' },
@@ -2141,7 +2160,7 @@ This file contains definitions for less common XMP namespaces.
2141
2160
 
2142
2161
  =head1 AUTHOR
2143
2162
 
2144
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
2163
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
2145
2164
 
2146
2165
  This library is free software; you can redistribute it and/or modify it
2147
2166
  under the same terms as Perl itself.
@@ -869,7 +869,7 @@ information.
869
869
 
870
870
  =head1 AUTHOR
871
871
 
872
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
872
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
873
873
 
874
874
  This library is free software; you can redistribute it and/or modify it
875
875
  under the same terms as Perl itself.
@@ -19,7 +19,7 @@ use strict;
19
19
  use vars qw($VERSION $warnString);
20
20
  use Image::ExifTool qw(:DataAccess :Utils);
21
21
 
22
- $VERSION = '1.27';
22
+ $VERSION = '1.28';
23
23
 
24
24
  sub WarnProc($) { $warnString = $_[0]; }
25
25
 
@@ -385,6 +385,18 @@ sub HandleMember($$;$)
385
385
  $et->HandleTag($tagTablePtr, '_com', $com) if defined $com and length $com;
386
386
  }
387
387
 
388
+ #------------------------------------------------------------------------------
389
+ # Extract file from ZIP archive
390
+ # Inputs: 0) ExifTool ref, 1) Zip object ref, 2) file name
391
+ # Returns: zip member or undef it it didn't exist
392
+ sub ExtractFile($$$)
393
+ {
394
+ my ($et, $zip, $file) = @_;
395
+ my $result = $zip->memberNamed($file);
396
+ $et->VPrint(1, " (Extracting '${file}' from zip archive)\n");
397
+ return $result;
398
+ }
399
+
388
400
  #------------------------------------------------------------------------------
389
401
  # Extract information from a ZIP file
390
402
  # Inputs: 0) ExifTool object reference, 1) dirInfo reference
@@ -460,7 +472,7 @@ sub ProcessZIP($$)
460
472
  # check for an Office Open file (DOCX, etc)
461
473
  # --> read '[Content_Types].xml' to determine the file type
462
474
  my ($mime, @members);
463
- my $cType = $zip->memberNamed('[Content_Types].xml');
475
+ my $cType = ExtractFile($et, $zip, '[Content_Types].xml');
464
476
  if ($cType) {
465
477
  ($buff, $status) = $zip->contents($cType);
466
478
  if (not $status and (
@@ -501,7 +513,7 @@ sub ProcessZIP($$)
501
513
  }
502
514
 
503
515
  # check for an Open Document, IDML or EPUB file
504
- my $mType = $zip->memberNamed('mimetype');
516
+ my $mType = ExtractFile($et, $zip, 'mimetype');
505
517
  if ($mType) {
506
518
  ($mime, $status) = $zip->contents($mType);
507
519
  if (not $status and $mime =~ /([\x21-\xfe]+)/s) {
@@ -510,9 +522,9 @@ sub ProcessZIP($$)
510
522
  $et->SetFileType($openDocType{$mime} || 'ZIP', $mime);
511
523
  $et->Warn("Unrecognized MIMEType $mime") unless $openDocType{$mime};
512
524
  # extract Open Document metadata from "meta.xml"
513
- my $meta = $zip->memberNamed('meta.xml');
525
+ my $meta = ExtractFile($et, $zip, 'meta.xml');
514
526
  # IDML files have metadata in a different place (ref 6)
515
- $meta or $meta = $zip->memberNamed('META-INF/metadata.xml');
527
+ $meta or $meta = ExtractFile($et, $zip, 'META-INF/metadata.xml');
516
528
  if ($meta) {
517
529
  ($buff, $status) = $zip->contents($meta);
518
530
  unless ($status) {
@@ -532,7 +544,7 @@ sub ProcessZIP($$)
532
544
  # process rootfile of EPUB container if applicable
533
545
  for (;;) {
534
546
  last if $meta and $mime ne 'application/epub+zip';
535
- my $container = $zip->memberNamed('META-INF/container.xml');
547
+ my $container = ExtractFile($et, $zip, 'META-INF/container.xml');
536
548
  ($buff, $status) = $zip->contents($container);
537
549
  last if $status;
538
550
  $buff =~ /<rootfile\s+[^>]*?\bfull-path=(['"])(.*?)\1/s or last;
@@ -570,7 +582,7 @@ sub ProcessZIP($$)
570
582
  my $type;
571
583
  my %tag = ( jpg => 'PreviewImage', png => 'PreviewPNG' );
572
584
  foreach $type ('jpg', 'png') {
573
- my $thumb = $zip->memberNamed("Thumbnails/thumbnail.$type");
585
+ my $thumb = ExtractFile($et, $zip, "Thumbnails/thumbnail.$type");
574
586
  next unless $thumb;
575
587
  ($buff, $status) = $zip->contents($thumb);
576
588
  $et->FoundTag($tag{$type}, $buff) unless $status;
@@ -708,7 +720,7 @@ Electronic Publication (EPUB), and Sketch design files (SKETCH).
708
720
 
709
721
  =head1 AUTHOR
710
722
 
711
- Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
723
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
712
724
 
713
725
  This library is free software; you can redistribute it and/or modify it
714
726
  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-2022, Phil Harvey (philharvey66 at gmail.com)
223
+ Copyright 2003-2023, 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-2022, Phil Harvey (philharvey66 at gmail.com)
218
+ Copyright 2003-2023, 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.