exiftool_vendored 10.65.0 → 11.41.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of exiftool_vendored might be problematic. Click here for more details.

Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +818 -19
  3. data/bin/MANIFEST +38 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +48 -44
  7. data/bin/arg_files/exif2xmp.args +4 -1
  8. data/bin/arg_files/gps2xmp.args +4 -1
  9. data/bin/arg_files/iptcCore.args +8 -0
  10. data/bin/arg_files/xmp2exif.args +4 -1
  11. data/bin/arg_files/xmp2gps.args +4 -1
  12. data/bin/config_files/dji.config +131 -0
  13. data/bin/config_files/example.config +6 -2
  14. data/bin/config_files/gps2utm.config +256 -256
  15. data/bin/config_files/nksc.config +146 -0
  16. data/bin/config_files/picasa_faces.config +382 -382
  17. data/bin/exiftool +688 -408
  18. data/bin/fmt_files/gpx.fmt +10 -6
  19. data/bin/fmt_files/gpx_wpt.fmt +10 -6
  20. data/bin/fmt_files/kml.fmt +8 -5
  21. data/bin/lib/File/RandomAccess.pm +48 -8
  22. data/bin/lib/File/RandomAccess.pod +21 -2
  23. data/bin/lib/Image/ExifTool.pm +645 -256
  24. data/bin/lib/Image/ExifTool.pod +219 -164
  25. data/bin/lib/Image/ExifTool/AES.pm +1 -1
  26. data/bin/lib/Image/ExifTool/AFCP.pm +3 -8
  27. data/bin/lib/Image/ExifTool/AIFF.pm +12 -4
  28. data/bin/lib/Image/ExifTool/APE.pm +1 -1
  29. data/bin/lib/Image/ExifTool/APP12.pm +1 -1
  30. data/bin/lib/Image/ExifTool/ASF.pm +19 -6
  31. data/bin/lib/Image/ExifTool/Apple.pm +13 -5
  32. data/bin/lib/Image/ExifTool/Audible.pm +1 -1
  33. data/bin/lib/Image/ExifTool/BMP.pm +1 -1
  34. data/bin/lib/Image/ExifTool/BPG.pm +17 -15
  35. data/bin/lib/Image/ExifTool/BZZ.pm +1 -1
  36. data/bin/lib/Image/ExifTool/BigTIFF.pm +30 -15
  37. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +103 -52
  38. data/bin/lib/Image/ExifTool/Canon.pm +684 -112
  39. data/bin/lib/Image/ExifTool/CanonCustom.pm +119 -9
  40. data/bin/lib/Image/ExifTool/CanonRaw.pm +1 -1
  41. data/bin/lib/Image/ExifTool/CanonVRD.pm +13 -26
  42. data/bin/lib/Image/ExifTool/CaptureOne.pm +1 -1
  43. data/bin/lib/Image/ExifTool/Casio.pm +1 -1
  44. data/bin/lib/Image/ExifTool/Charset.pm +1 -1
  45. data/bin/lib/Image/ExifTool/DICOM.pm +12 -5
  46. data/bin/lib/Image/ExifTool/DJI.pm +51 -3
  47. data/bin/lib/Image/ExifTool/DNG.pm +15 -8
  48. data/bin/lib/Image/ExifTool/DPX.pm +1 -1
  49. data/bin/lib/Image/ExifTool/DV.pm +1 -1
  50. data/bin/lib/Image/ExifTool/DarwinCore.pm +63 -23
  51. data/bin/lib/Image/ExifTool/DjVu.pm +4 -2
  52. data/bin/lib/Image/ExifTool/EXE.pm +30 -6
  53. data/bin/lib/Image/ExifTool/Exif.pm +351 -109
  54. data/bin/lib/Image/ExifTool/FITS.pm +148 -0
  55. data/bin/lib/Image/ExifTool/FLAC.pm +2 -2
  56. data/bin/lib/Image/ExifTool/FLIF.pm +1 -1
  57. data/bin/lib/Image/ExifTool/FLIR.pm +109 -13
  58. data/bin/lib/Image/ExifTool/Fixup.pm +1 -1
  59. data/bin/lib/Image/ExifTool/Flash.pm +3 -3
  60. data/bin/lib/Image/ExifTool/FlashPix.pm +433 -9
  61. data/bin/lib/Image/ExifTool/Font.pm +2 -2
  62. data/bin/lib/Image/ExifTool/FotoStation.pm +1 -1
  63. data/bin/lib/Image/ExifTool/FujiFilm.pm +336 -16
  64. data/bin/lib/Image/ExifTool/GE.pm +1 -1
  65. data/bin/lib/Image/ExifTool/GIF.pm +5 -7
  66. data/bin/lib/Image/ExifTool/GIMP.pm +39 -3
  67. data/bin/lib/Image/ExifTool/GPS.pm +48 -22
  68. data/bin/lib/Image/ExifTool/GeoTiff.pm +23 -23
  69. data/bin/lib/Image/ExifTool/Geotag.pm +80 -45
  70. data/bin/lib/Image/ExifTool/GoPro.pm +709 -0
  71. data/bin/lib/Image/ExifTool/H264.pm +40 -18
  72. data/bin/lib/Image/ExifTool/HP.pm +1 -1
  73. data/bin/lib/Image/ExifTool/HTML.pm +19 -12
  74. data/bin/lib/Image/ExifTool/HtmlDump.pm +37 -26
  75. data/bin/lib/Image/ExifTool/ICC_Profile.pm +297 -23
  76. data/bin/lib/Image/ExifTool/ID3.pm +12 -7
  77. data/bin/lib/Image/ExifTool/IPTC.pm +48 -19
  78. data/bin/lib/Image/ExifTool/ISO.pm +1 -1
  79. data/bin/lib/Image/ExifTool/ITC.pm +1 -1
  80. data/bin/lib/Image/ExifTool/Import.pm +13 -9
  81. data/bin/lib/Image/ExifTool/InDesign.pm +3 -5
  82. data/bin/lib/Image/ExifTool/JPEG.pm +22 -11
  83. data/bin/lib/Image/ExifTool/JPEGDigest.pm +1 -1
  84. data/bin/lib/Image/ExifTool/JSON.pm +3 -3
  85. data/bin/lib/Image/ExifTool/JVC.pm +1 -1
  86. data/bin/lib/Image/ExifTool/Jpeg2000.pm +2 -2
  87. data/bin/lib/Image/ExifTool/Kodak.pm +1233 -58
  88. data/bin/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
  89. data/bin/lib/Image/ExifTool/LNK.pm +1 -1
  90. data/bin/lib/Image/ExifTool/Lang/cs.pm +1 -1
  91. data/bin/lib/Image/ExifTool/Lang/de.pm +33 -24
  92. data/bin/lib/Image/ExifTool/Lang/en_ca.pm +64 -2
  93. data/bin/lib/Image/ExifTool/Lang/en_gb.pm +64 -2
  94. data/bin/lib/Image/ExifTool/Lang/es.pm +8 -4
  95. data/bin/lib/Image/ExifTool/Lang/fi.pm +46 -4
  96. data/bin/lib/Image/ExifTool/Lang/fr.pm +5 -3
  97. data/bin/lib/Image/ExifTool/Lang/it.pm +6 -3
  98. data/bin/lib/Image/ExifTool/Lang/ja.pm +15 -3
  99. data/bin/lib/Image/ExifTool/Lang/ko.pm +5 -2
  100. data/bin/lib/Image/ExifTool/Lang/nl.pm +6 -3
  101. data/bin/lib/Image/ExifTool/Lang/pl.pm +2 -2
  102. data/bin/lib/Image/ExifTool/Lang/ru.pm +1 -1
  103. data/bin/lib/Image/ExifTool/Lang/sv.pm +1 -1
  104. data/bin/lib/Image/ExifTool/Lang/tr.pm +4 -2
  105. data/bin/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
  106. data/bin/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
  107. data/bin/lib/Image/ExifTool/Leaf.pm +1 -1
  108. data/bin/lib/Image/ExifTool/Lytro.pm +4 -8
  109. data/bin/lib/Image/ExifTool/M2TS.pm +10 -9
  110. data/bin/lib/Image/ExifTool/MIE.pm +12 -8
  111. data/bin/lib/Image/ExifTool/MIEUnits.pod +1 -1
  112. data/bin/lib/Image/ExifTool/MIFF.pm +1 -1
  113. data/bin/lib/Image/ExifTool/MNG.pm +1 -1
  114. data/bin/lib/Image/ExifTool/MOI.pm +1 -1
  115. data/bin/lib/Image/ExifTool/MPC.pm +1 -1
  116. data/bin/lib/Image/ExifTool/MPEG.pm +2 -3
  117. data/bin/lib/Image/ExifTool/MPF.pm +6 -6
  118. data/bin/lib/Image/ExifTool/MWG.pm +4 -4
  119. data/bin/lib/Image/ExifTool/MXF.pm +2 -2
  120. data/bin/lib/Image/ExifTool/MacOS.pm +184 -34
  121. data/bin/lib/Image/ExifTool/MakerNotes.pm +101 -18
  122. data/bin/lib/Image/ExifTool/Matroska.pm +1 -1
  123. data/bin/lib/Image/ExifTool/Microsoft.pm +5 -3
  124. data/bin/lib/Image/ExifTool/Minolta.pm +89 -62
  125. data/bin/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
  126. data/bin/lib/Image/ExifTool/Motorola.pm +1 -1
  127. data/bin/lib/Image/ExifTool/Nikon.pm +1511 -380
  128. data/bin/lib/Image/ExifTool/NikonCapture.pm +1 -1
  129. data/bin/lib/Image/ExifTool/NikonCustom.pm +2758 -2935
  130. data/bin/lib/Image/ExifTool/Nintendo.pm +1 -1
  131. data/bin/lib/Image/ExifTool/OOXML.pm +1 -1
  132. data/bin/lib/Image/ExifTool/Ogg.pm +1 -1
  133. data/bin/lib/Image/ExifTool/Olympus.pm +47 -8
  134. data/bin/lib/Image/ExifTool/OpenEXR.pm +1 -1
  135. data/bin/lib/Image/ExifTool/Opus.pm +1 -1
  136. data/bin/lib/Image/ExifTool/PCX.pm +138 -0
  137. data/bin/lib/Image/ExifTool/PDF.pm +58 -42
  138. data/bin/lib/Image/ExifTool/PGF.pm +1 -1
  139. data/bin/lib/Image/ExifTool/PICT.pm +1 -1
  140. data/bin/lib/Image/ExifTool/PLIST.pm +12 -5
  141. data/bin/lib/Image/ExifTool/PLUS.pm +1 -1
  142. data/bin/lib/Image/ExifTool/PNG.pm +108 -10
  143. data/bin/lib/Image/ExifTool/PPM.pm +3 -3
  144. data/bin/lib/Image/ExifTool/PSP.pm +1 -1
  145. data/bin/lib/Image/ExifTool/Palm.pm +1 -1
  146. data/bin/lib/Image/ExifTool/Panasonic.pm +299 -31
  147. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +201 -19
  148. data/bin/lib/Image/ExifTool/Pentax.pm +164 -143
  149. data/bin/lib/Image/ExifTool/PhaseOne.pm +12 -5
  150. data/bin/lib/Image/ExifTool/PhotoCD.pm +9 -10
  151. data/bin/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
  152. data/bin/lib/Image/ExifTool/Photoshop.pm +230 -60
  153. data/bin/lib/Image/ExifTool/PostScript.pm +29 -4
  154. data/bin/lib/Image/ExifTool/PrintIM.pm +1 -1
  155. data/bin/lib/Image/ExifTool/Qualcomm.pm +2 -2
  156. data/bin/lib/Image/ExifTool/QuickTime.pm +1539 -279
  157. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +1857 -0
  158. data/bin/lib/Image/ExifTool/README +84 -46
  159. data/bin/lib/Image/ExifTool/RIFF.pm +116 -23
  160. data/bin/lib/Image/ExifTool/RSRC.pm +1 -1
  161. data/bin/lib/Image/ExifTool/RTF.pm +6 -4
  162. data/bin/lib/Image/ExifTool/Radiance.pm +1 -1
  163. data/bin/lib/Image/ExifTool/Rawzor.pm +3 -2
  164. data/bin/lib/Image/ExifTool/Real.pm +1 -1
  165. data/bin/lib/Image/ExifTool/Reconyx.pm +261 -7
  166. data/bin/lib/Image/ExifTool/Red.pm +325 -0
  167. data/bin/lib/Image/ExifTool/Ricoh.pm +3 -7
  168. data/bin/lib/Image/ExifTool/Samsung.pm +95 -25
  169. data/bin/lib/Image/ExifTool/Sanyo.pm +1 -1
  170. data/bin/lib/Image/ExifTool/Scalado.pm +1 -1
  171. data/bin/lib/Image/ExifTool/Shift.pl +26 -12
  172. data/bin/lib/Image/ExifTool/Shortcuts.pm +9 -2
  173. data/bin/lib/Image/ExifTool/Sigma.pm +36 -30
  174. data/bin/lib/Image/ExifTool/SigmaRaw.pm +3 -8
  175. data/bin/lib/Image/ExifTool/Sony.pm +531 -177
  176. data/bin/lib/Image/ExifTool/SonyIDC.pm +63 -3
  177. data/bin/lib/Image/ExifTool/Stim.pm +2 -2
  178. data/bin/lib/Image/ExifTool/TagInfoXML.pm +23 -23
  179. data/bin/lib/Image/ExifTool/TagLookup.pm +6352 -5062
  180. data/bin/lib/Image/ExifTool/TagNames.pod +3024 -565
  181. data/bin/lib/Image/ExifTool/Theora.pm +1 -1
  182. data/bin/lib/Image/ExifTool/Torrent.pm +2 -2
  183. data/bin/lib/Image/ExifTool/Unknown.pm +1 -1
  184. data/bin/lib/Image/ExifTool/VCard.pm +47 -9
  185. data/bin/lib/Image/ExifTool/Validate.pm +391 -99
  186. data/bin/lib/Image/ExifTool/Vorbis.pm +1 -1
  187. data/bin/lib/Image/ExifTool/WTV.pm +319 -0
  188. data/bin/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
  189. data/bin/lib/Image/ExifTool/WriteExif.pl +91 -18
  190. data/bin/lib/Image/ExifTool/WriteIPTC.pl +6 -6
  191. data/bin/lib/Image/ExifTool/WritePDF.pl +13 -12
  192. data/bin/lib/Image/ExifTool/WritePNG.pl +1 -1
  193. data/bin/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
  194. data/bin/lib/Image/ExifTool/WritePostScript.pl +2 -2
  195. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +764 -121
  196. data/bin/lib/Image/ExifTool/WriteXMP.pl +176 -67
  197. data/bin/lib/Image/ExifTool/Writer.pl +490 -246
  198. data/bin/lib/Image/ExifTool/XMP.pm +216 -76
  199. data/bin/lib/Image/ExifTool/XMP2.pl +54 -10
  200. data/bin/lib/Image/ExifTool/XMPStruct.pl +14 -11
  201. data/bin/lib/Image/ExifTool/ZIP.pm +60 -15
  202. data/bin/lib/Image/ExifTool/iWork.pm +12 -5
  203. data/bin/perl-Image-ExifTool.spec +46 -44
  204. data/lib/exiftool_vendored/version.rb +1 -1
  205. metadata +14 -4
@@ -16,7 +16,7 @@ use strict;
16
16
  use vars qw($VERSION);
17
17
  use Image::ExifTool qw(:DataAccess :Utils);
18
18
 
19
- $VERSION = '1.48';
19
+ $VERSION = '1.51';
20
20
 
21
21
  sub ProcessID3v2($$$);
22
22
  sub ProcessPrivate($$$);
@@ -853,7 +853,12 @@ sub ConvertTimeStamp($)
853
853
  }
854
854
  my $m = int($time / 60);
855
855
  my $s = $time - $m * 60;
856
- return sprintf('[%s%.2d:%05.2f]', $h, $m, $s) . substr($val, pos($val));
856
+ my $ss = sprintf('%05.2f', $s);
857
+ if ($ss >= 60) {
858
+ $ss = '00.00';
859
+ ++$m >= 60 and $m -= 60, ++$h;
860
+ }
861
+ return sprintf('[%s%.2d:%s]', $h, $m, $ss) . substr($val, pos($val));
857
862
  }
858
863
 
859
864
  #------------------------------------------------------------------------------
@@ -959,7 +964,7 @@ sub PrintGenre($)
959
964
  $genre{$1} or $genre{$1} = "Unknown ($1)";
960
965
  }
961
966
  $val =~ s/\((\d+)\)/\($genre{$1}\)/g;
962
- $val =~ s/(^|\/)(\d+)(\/|$)/$1$genre{$2}$3/g;
967
+ $val =~ s/(^|\/)(\d+)(?=\/|$)/$1$genre{$2}$3/g;
963
968
  $val =~ s/^\(([^)]+)\)\1?$/$1/; # clean up by removing brackets and duplicates
964
969
  return $val;
965
970
  }
@@ -1037,8 +1042,8 @@ sub ProcessID3v2($$$)
1037
1042
  my $verbose = $et->Options('Verbose');
1038
1043
  my $len; # frame data length
1039
1044
 
1040
- $verbose and $et->VerboseDir($tagTablePtr->{GROUPS}->{1}, 0, $size);
1041
- Image::ExifTool::HexDump($dataPt, $size, Start => $offset) if $verbose > 2;
1045
+ $et->VerboseDir($tagTablePtr->{GROUPS}->{1}, 0, $size);
1046
+ $et->VerboseDump($dataPt, Len => $size, Start => $offset);
1042
1047
 
1043
1048
  for (;;$offset+=$len) {
1044
1049
  my ($id, $flags, $hi);
@@ -1081,7 +1086,7 @@ sub ProcessID3v2($$$)
1081
1086
  my $otherTable = $otherTable{$tagTablePtr};
1082
1087
  $tagInfo = $et->GetTagInfo($otherTable, $id) if $otherTable;
1083
1088
  if ($tagInfo) {
1084
- $et->WarnOnce("Frame '$id' is not valid for this ID3 version", 1);
1089
+ $et->WarnOnce("Frame '${id}' is not valid for this ID3 version", 1);
1085
1090
  } else {
1086
1091
  next unless $verbose or $et->Options('Unknown');
1087
1092
  $id =~ tr/-A-Za-z0-9_//dc;
@@ -1549,7 +1554,7 @@ other types of audio files.
1549
1554
 
1550
1555
  =head1 AUTHOR
1551
1556
 
1552
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
1557
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
1553
1558
 
1554
1559
  This library is free software; you can redistribute it and/or modify it
1555
1560
  under the same terms as Perl itself.
@@ -15,7 +15,7 @@ use strict;
15
15
  use vars qw($VERSION $AUTOLOAD %iptcCharset);
16
16
  use Image::ExifTool qw(:DataAccess :Utils);
17
17
 
18
- $VERSION = '1.54';
18
+ $VERSION = '1.57';
19
19
 
20
20
  %iptcCharset = (
21
21
  "\x1b%G" => 'UTF8',
@@ -202,7 +202,7 @@ my %fileFormat = (
202
202
  Shift => 'Time',
203
203
  ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
204
204
  ValueConvInv => 'Image::ExifTool::IPTC::IptcDate($val)',
205
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
205
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
206
206
  },
207
207
  80 => {
208
208
  Name => 'TimeSent',
@@ -211,7 +211,7 @@ my %fileFormat = (
211
211
  Shift => 'Time',
212
212
  ValueConv => 'Image::ExifTool::Exif::ExifTime($val)',
213
213
  ValueConvInv => 'Image::ExifTool::IPTC::IptcTime($val)',
214
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
214
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
215
215
  },
216
216
  90 => {
217
217
  Name => 'CodedCharacterSet',
@@ -228,6 +228,7 @@ my %fileFormat = (
228
228
  },
229
229
  Protected => 1,
230
230
  Format => 'string[0,32]',
231
+ ValueConvInv => '$val =~ /^UTF-?8$/i ? "\x1b%G" : $val',
231
232
  # convert ISO 2022 escape sequences to a more readable format
232
233
  PrintConv => \&PrintCodedCharset,
233
234
  PrintConvInv => \&PrintInvCodedCharset,
@@ -339,7 +340,7 @@ my %fileFormat = (
339
340
  Shift => 'Time',
340
341
  ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
341
342
  ValueConvInv => 'Image::ExifTool::IPTC::IptcDate($val)',
342
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
343
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
343
344
  },
344
345
  35 => {
345
346
  Name => 'ReleaseTime',
@@ -348,7 +349,7 @@ my %fileFormat = (
348
349
  Shift => 'Time',
349
350
  ValueConv => 'Image::ExifTool::Exif::ExifTime($val)',
350
351
  ValueConvInv => 'Image::ExifTool::IPTC::IptcTime($val)',
351
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
352
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
352
353
  },
353
354
  37 => {
354
355
  Name => 'ExpirationDate',
@@ -357,7 +358,7 @@ my %fileFormat = (
357
358
  Shift => 'Time',
358
359
  ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
359
360
  ValueConvInv => 'Image::ExifTool::IPTC::IptcDate($val)',
360
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
361
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
361
362
  },
362
363
  38 => {
363
364
  Name => 'ExpirationTime',
@@ -366,7 +367,7 @@ my %fileFormat = (
366
367
  Shift => 'Time',
367
368
  ValueConv => 'Image::ExifTool::Exif::ExifTime($val)',
368
369
  ValueConvInv => 'Image::ExifTool::IPTC::IptcTime($val)',
369
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
370
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
370
371
  },
371
372
  40 => {
372
373
  Name => 'SpecialInstructions',
@@ -396,7 +397,7 @@ my %fileFormat = (
396
397
  Shift => 'Time',
397
398
  ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
398
399
  ValueConvInv => 'Image::ExifTool::IPTC::IptcDate($val)',
399
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
400
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
400
401
  },
401
402
  50 => {
402
403
  Name => 'ReferenceNumber',
@@ -410,7 +411,7 @@ my %fileFormat = (
410
411
  Shift => 'Time',
411
412
  ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
412
413
  ValueConvInv => 'Image::ExifTool::IPTC::IptcDate($val)',
413
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
414
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
414
415
  },
415
416
  60 => {
416
417
  Name => 'TimeCreated',
@@ -419,7 +420,7 @@ my %fileFormat = (
419
420
  Shift => 'Time',
420
421
  ValueConv => 'Image::ExifTool::Exif::ExifTime($val)',
421
422
  ValueConvInv => 'Image::ExifTool::IPTC::IptcTime($val)',
422
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
423
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
423
424
  },
424
425
  62 => {
425
426
  Name => 'DigitalCreationDate',
@@ -428,7 +429,7 @@ my %fileFormat = (
428
429
  Shift => 'Time',
429
430
  ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
430
431
  ValueConvInv => 'Image::ExifTool::IPTC::IptcDate($val)',
431
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
432
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
432
433
  },
433
434
  63 => {
434
435
  Name => 'DigitalCreationTime',
@@ -437,7 +438,7 @@ my %fileFormat = (
437
438
  Shift => 'Time',
438
439
  ValueConv => 'Image::ExifTool::Exif::ExifTime($val)',
439
440
  ValueConvInv => 'Image::ExifTool::IPTC::IptcTime($val)',
440
- PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($val)',
441
+ PrintConvInv => 'Image::ExifTool::IPTC::InverseDateOrTime($self,$val)',
441
442
  },
442
443
  65 => {
443
444
  Name => 'OriginatingProgram',
@@ -533,7 +534,7 @@ my %fileFormat = (
533
534
  I haven't found a reference for the format of tags 121, 184-188 and
534
535
  225-232, so I have just make them writable as strings with
535
536
  reasonable length. Beware that if this is wrong, other utilities
536
- won't be able to read these tags as written by ExifTool
537
+ may not be able to read these tags as written by ExifTool
537
538
  },
538
539
  },
539
540
  122 => {
@@ -673,6 +674,8 @@ my %fileFormat = (
673
674
  231 => {
674
675
  Name => 'DocumentHistory',
675
676
  Format => 'string[0,256]', # (guess)
677
+ ValueConv => '$val =~ s/\0+/\n/g; $val', # (have seen embedded nulls)
678
+ ValueConvInv => '$val',
676
679
  },
677
680
  232 => {
678
681
  Name => 'ExifCameraInfo',
@@ -1047,6 +1050,7 @@ sub ProcessIPTC($$$)
1047
1050
  my $dirLen = $$dirInfo{DirLen} || 0;
1048
1051
  my $dirEnd = $pos + $dirLen;
1049
1052
  my $verbose = $et->Options('Verbose');
1053
+ my $validate = $et->Options('Validate');
1050
1054
  my $success = 0;
1051
1055
  my ($lastRec, $recordPtr, $recordName);
1052
1056
 
@@ -1150,6 +1154,9 @@ sub ProcessIPTC($$$)
1150
1154
  last;
1151
1155
  }
1152
1156
  if (not defined $lastRec or $lastRec != $rec) {
1157
+ if ($validate and defined $lastRec and $rec < $lastRec) {
1158
+ $et->Warn("IPTC doesn't conform to spec: Records out of sequence",1)
1159
+ }
1153
1160
  my $tableInfo = $tagTablePtr->{$rec};
1154
1161
  unless ($tableInfo) {
1155
1162
  $et->WarnOnce("Unrecognized IPTC record $rec (ignored)");
@@ -1180,9 +1187,26 @@ sub ProcessIPTC($$$)
1180
1187
  # (could use $$recordPtr{FORMAT} if no Format below, but don't do this to
1181
1188
  # be backward compatible with improperly written PhotoMechanic tags)
1182
1189
  $format = $$tagInfo{Format} if $tagInfo;
1183
- # use logic to determine format if not specified
1184
- unless ($format) {
1190
+ if (not $format) {
1191
+ # guess at "int" format if not specified
1185
1192
  $format = 'int' if $len <= 4 and $len != 3 and $val =~ /[\0-\x08]/;
1193
+ } elsif ($validate) {
1194
+ my ($fmt,$min,$max);
1195
+ if ($format =~ /(.*)\[(\d+)(,(\d+))?\]/) {
1196
+ $fmt = $1;
1197
+ $min = $2;
1198
+ $max = $4 || $2;
1199
+ } else {
1200
+ $fmt = $format;
1201
+ $min = $max = 1;
1202
+ }
1203
+ my $siz = Image::ExifTool::FormatSize($fmt) || 1;
1204
+ $min *= $siz; $max *= $siz;
1205
+ if ($len < $min or $len > $max) {
1206
+ my $should = ($min == $max) ? $min : ($len < $min ? "$min min" : "$max max");
1207
+ my $what = ($len < $siz * $min) ? 'short' : 'long';
1208
+ $et->Warn("IPTC $$tagInfo{Name} too $what ($len bytes; should be $should)", 1);
1209
+ }
1186
1210
  }
1187
1211
  if ($format) {
1188
1212
  if ($format =~ /^int/) {
@@ -1194,7 +1218,10 @@ sub ProcessIPTC($$$)
1194
1218
  }
1195
1219
  }
1196
1220
  } elsif ($format =~ /^string/) {
1197
- $val =~ s/\0+$//; # some braindead softwares add null terminators
1221
+ # some braindead softwares add null terminators
1222
+ if ($val =~ s/\0+$// and $validate) {
1223
+ $et->Warn("IPTC $$tagInfo{Name} improperly terminated", 1);
1224
+ }
1198
1225
  if ($rec == 1) {
1199
1226
  # handle CodedCharacterSet tag
1200
1227
  $xlat = HandleCodedCharset($et, $val) if $tag == 90;
@@ -1204,9 +1231,11 @@ sub ProcessIPTC($$$)
1204
1231
  TranslateCodedString($et, \$val, \$xlat, 1);
1205
1232
  }
1206
1233
  } elsif ($format =~ /^digits/) {
1207
- $val =~ s/\0+$//;
1234
+ if ($val =~ s/\0+$// and $validate) {
1235
+ $et->Warn("IPTC $$tagInfo{Name} improperly terminated", 1);
1236
+ }
1208
1237
  } elsif ($format !~ /^undef/) {
1209
- warn("Invalid IPTC format: $format");
1238
+ warn("Invalid IPTC format: $format"); # (this would be a programming error)
1210
1239
  }
1211
1240
  }
1212
1241
  $verbose and $et->VerboseInfo($tag, $tagInfo,
@@ -1250,7 +1279,7 @@ image files.
1250
1279
 
1251
1280
  =head1 AUTHOR
1252
1281
 
1253
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
1282
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
1254
1283
 
1255
1284
  This library is free software; you can redistribute it and/or modify it
1256
1285
  under the same terms as Perl itself.
@@ -184,7 +184,7 @@ information from ISO 9660 disk images.
184
184
 
185
185
  =head1 AUTHOR
186
186
 
187
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
187
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
188
188
 
189
189
  This library is free software; you can redistribute it and/or modify it
190
190
  under the same terms as Perl itself.
@@ -191,7 +191,7 @@ information (including artwork images) from iTunes Cover Flow files.
191
191
 
192
192
  =head1 AUTHOR
193
193
 
194
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
194
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
195
195
 
196
196
  This library is free software; you can redistribute it and/or modify it
197
197
  under the same terms as Perl itself.
@@ -12,7 +12,7 @@ require Exporter;
12
12
 
13
13
  use vars qw($VERSION @ISA @EXPORT_OK);
14
14
 
15
- $VERSION = '1.08';
15
+ $VERSION = '1.09';
16
16
  @ISA = qw(Exporter);
17
17
  @EXPORT_OK = qw(ReadCSV ReadJSON);
18
18
 
@@ -40,7 +40,7 @@ sub ReadCSV($$;$)
40
40
  $raf = new File::RandomAccess($file);
41
41
  $file = 'CSV file';
42
42
  } else {
43
- open CSVFILE, $file or return "Error opening CSV file '$file'";
43
+ open CSVFILE, $file or return "Error opening CSV file '${file}'";
44
44
  binmode CSVFILE;
45
45
  $openedFile = 1;
46
46
  $raf = new File::RandomAccess(\*CSVFILE);
@@ -79,7 +79,8 @@ sub ReadCSV($$;$)
79
79
  if (@tags) {
80
80
  # save values for each tag
81
81
  for ($i=0; $i<@vals and $i<@tags; ++$i) {
82
- next unless length $vals[$i]; # ignore empty entries
82
+ # ignore empty entries unless missingValue is empty too
83
+ next unless length $vals[$i] or defined $missingValue and $missingValue eq '';
83
84
  # delete tag (set value to undef) if value is same as missing tag
84
85
  $fileInfo{$tags[$i]} =
85
86
  (defined $missingValue and $vals[$i] eq $missingValue) ? undef : $vals[$i];
@@ -95,7 +96,7 @@ sub ReadCSV($$;$)
95
96
  # terminate at first blank tag name (eg. extra comma at end of line)
96
97
  last unless length $_;
97
98
  @tags or s/^\xef\xbb\xbf//; # remove UTF-8 BOM if it exists
98
- /^[-\w]+(:[-\w+]+)?#?$/ or $err = "Invalid tag name '$_'", last;
99
+ /^[-\w]+(:[-\w+]+)?#?$/ or $err = "Invalid tag name '${_}'", last;
99
100
  push(@tags, $_);
100
101
  }
101
102
  last if $err;
@@ -122,7 +123,8 @@ sub ToUTF8($)
122
123
 
123
124
  #------------------------------------------------------------------------------
124
125
  # Read JSON object from file
125
- # Inputs: 0) RAF reference or undef, 1) optional file buffer reference
126
+ # Inputs: 0) RAF reference or undef, 1) optional scalar reference for data
127
+ # to read before reading from file (ie. the file read buffer)
126
128
  # Returns: JSON object (scalar, hash ref, or array ref), or undef on EOF or
127
129
  # empty object or array (and sets $$buffPt to empty string on EOF)
128
130
  # Notes: position in buffer is significant
@@ -133,6 +135,7 @@ sub ReadJSONObject($;$)
133
135
  my ($pos, $readMore, $rtnVal, $tok, $key, $didBOM);
134
136
  if ($buffPt) {
135
137
  $pos = pos $$buffPt;
138
+ $pos = pos($$buffPt) = 0 unless defined $pos;
136
139
  } else {
137
140
  my $buff = '';
138
141
  $buffPt = \$buff;
@@ -143,6 +146,7 @@ Tok: for (;;) {
143
146
  # put a test here to be safe because one user reported this problem)
144
147
  last unless defined $pos;
145
148
  if ($pos >= length $$buffPt or $readMore) {
149
+ last unless defined $raf;
146
150
  # read another 64kB and add to unparsed data
147
151
  my $offset = length($$buffPt) - $pos;
148
152
  if ($offset) {
@@ -250,7 +254,7 @@ sub ReadJSON($$;$$)
250
254
  $raf = new File::RandomAccess($file);
251
255
  $file = 'JSON file';
252
256
  } else {
253
- open JSONFILE, $file or return "Error opening JSON file '$file'";
257
+ open JSONFILE, $file or return "Error opening JSON file '${file}'";
254
258
  binmode JSONFILE;
255
259
  $openedFile = 1;
256
260
  $raf = new File::RandomAccess(\*JSONFILE);
@@ -258,7 +262,7 @@ sub ReadJSON($$;$$)
258
262
  my $obj = ReadJSONObject($raf);
259
263
  close JSONFILE if $openedFile;
260
264
  unless (ref $obj eq 'ARRAY') {
261
- ref $obj eq 'HASH' or return "Format error in JSON file '$file'";
265
+ ref $obj eq 'HASH' or return "Format error in JSON file '${file}'";
262
266
  $obj = [ $obj ];
263
267
  }
264
268
  my ($info, $found);
@@ -280,7 +284,7 @@ sub ReadJSON($$;$$)
280
284
  $$database{$$info{SourceFile}} = $info;
281
285
  $found = 1;
282
286
  }
283
- return $found ? undef : "No valid JSON objects in '$file'";
287
+ return $found ? undef : "No valid JSON objects in '${file}'";
284
288
  }
285
289
 
286
290
 
@@ -341,7 +345,7 @@ stored as hash lookups of tag name/value for each SourceFile.
341
345
 
342
346
  =head1 AUTHOR
343
347
 
344
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
348
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
345
349
 
346
350
  This library is free software; you can redistribute it and/or modify it
347
351
  under the same terms as Perl itself.
@@ -14,7 +14,7 @@ use strict;
14
14
  use vars qw($VERSION);
15
15
  use Image::ExifTool qw(:DataAccess :Utils);
16
16
 
17
- $VERSION = '1.05';
17
+ $VERSION = '1.06';
18
18
 
19
19
  # map for writing metadata to InDesign files (currently only write XMP)
20
20
  my %indMap = (
@@ -106,10 +106,8 @@ sub ProcessIND($$)
106
106
  printf $out "Contiguous object at offset 0x%x (%d bytes):\n", $raf->Tell(), $len;
107
107
  if ($verbose > 2) {
108
108
  my $len2 = $len < 1024000 ? $len : 1024000;
109
- my %parms = (Addr => $raf->Tell());
110
- $parms{MaxLen} = $verbose > 3 ? 1024 : 96 if $verbose < 5;
111
109
  $raf->Seek(-$raf->Read($buff, $len2), 1) or $err = 1;
112
- HexDump(\$buff, undef, %parms);
110
+ $et->VerboseDump(\$buff, Addr => $raf->Tell());
113
111
  }
114
112
  }
115
113
  # check for XMP if stream data is long enough
@@ -260,7 +258,7 @@ them and the LargeFileSupport option is enabled.
260
258
 
261
259
  =head1 AUTHOR
262
260
 
263
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
261
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
264
262
 
265
263
  This library is free software; you can redistribute it and/or modify it
266
264
  under the same terms as Perl itself.
@@ -11,14 +11,17 @@ use strict;
11
11
  use vars qw($VERSION);
12
12
  use Image::ExifTool qw(:DataAccess :Utils);
13
13
 
14
- $VERSION = '1.25';
14
+ $VERSION = '1.27';
15
15
 
16
16
  sub ProcessOcad($$$);
17
17
  sub ProcessJPEG_HDR($$$);
18
18
 
19
19
  # (this main JPEG table is for documentation purposes only)
20
20
  %Image::ExifTool::JPEG::Main = (
21
- NOTES => 'This table lists information extracted by ExifTool from JPEG images.',
21
+ NOTES => q{
22
+ This table lists information extracted by ExifTool from JPEG images. See
23
+ L<https://www.w3.org/Graphics/JPEG/jfif3.pdf> for the JPEG specification.
24
+ },
22
25
  APP0 => [{
23
26
  Name => 'JFIF',
24
27
  Condition => '$$valPt =~ /^JFIF\0/',
@@ -107,6 +110,10 @@ sub ProcessJPEG_HDR($$$);
107
110
  Name => 'RMETA',
108
111
  Condition => '$$valPt =~ /^RMETA\0/',
109
112
  SubDirectory => { TagTable => 'Image::ExifTool::Ricoh::RMETA' },
113
+ }, {
114
+ Name => 'SamsungUniqueID',
115
+ Condition => '$$valPt =~ /ssuniqueid\0/',
116
+ SubDirectory => { TagTable => 'Image::ExifTool::Samsung::APP5' },
110
117
  }, {
111
118
  Name => 'PreviewImage', # (eg. BenQ DC E1050)
112
119
  Notes => 'continued from APP4',
@@ -123,6 +130,10 @@ sub ProcessJPEG_HDR($$$);
123
130
  Name => 'HP_TDHD', # (written by R837)
124
131
  Condition => '$$valPt =~ /^TDHD\x01\0\0\0/',
125
132
  SubDirectory => { TagTable => 'Image::ExifTool::HP::TDHD' },
133
+ }, {
134
+ Name => 'GoPro',
135
+ Condition => '$$valPt =~ /^GoPro\0/',
136
+ SubDirectory => { TagTable => 'Image::ExifTool::GoPro::GPMF' },
126
137
  }],
127
138
  APP7 => [{
128
139
  Name => 'Pentax',
@@ -249,7 +260,7 @@ sub ProcessJPEG_HDR($$$);
249
260
  },
250
261
  );
251
262
 
252
- # SPIFF APP8 segment. Refs:
263
+ # APP8 SPIFF segment. Refs:
253
264
  # 1) http://www.fileformat.info/format/spiff/
254
265
  # 2) http://www.jpeg.org/public/spiff.pdf
255
266
  %Image::ExifTool::JPEG::SPIFF = (
@@ -336,11 +347,11 @@ sub ProcessJPEG_HDR($$$);
336
347
  },
337
348
  );
338
349
 
339
- # Media Jukebox APP9 segment (ref PH)
350
+ # APP9 Media Jukebox segment (ref PH)
340
351
  %Image::ExifTool::JPEG::MediaJukebox = (
341
352
  GROUPS => { 0 => 'XML', 1 => 'MediaJukebox', 2 => 'Image' },
342
353
  VARS => { NO_ID => 1 },
343
- NOTES => 'Tags found in the XML metadata of the "Media Jukebox" APP9 segment.',
354
+ NOTES => 'Tags found in the XML metadata of the APP9 "Media Jukebox" segment.',
344
355
  Date => {
345
356
  Groups => { 2 => 'Time' },
346
357
  # convert from days since Dec 30, 1899 to seconds since Jan 1, 1970
@@ -383,7 +394,7 @@ sub ProcessJPEG_HDR($$$);
383
394
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
384
395
  GROUPS => { 0 => 'APP13', 1 => 'AdobeCM', 2 => 'Image' },
385
396
  NOTES => q{
386
- The "Adobe_CM" APP13 segment presumably contains color management
397
+ The APP13 "Adobe_CM" segment presumably contains color management
387
398
  information, but the meaning of the data is currently unknown. If anyone
388
399
  has an idea about what this means, please let me know.
389
400
  },
@@ -398,7 +409,7 @@ sub ProcessJPEG_HDR($$$);
398
409
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
399
410
  GROUPS => { 0 => 'APP14', 1 => 'Adobe', 2 => 'Image' },
400
411
  NOTES => q{
401
- The "Adobe" APP14 segment stores image encoding information for DCT filters.
412
+ The APP14 "Adobe" segment stores image encoding information for DCT filters.
402
413
  This segment may be copied or deleted as a block using the Extra "Adobe"
403
414
  tag, but note that it is not deleted by default when deleting all metadata
404
415
  because it may affect the appearance of the image.
@@ -439,7 +450,7 @@ sub ProcessJPEG_HDR($$$);
439
450
  'Q' => 'Quality',
440
451
  );
441
452
 
442
- # AVI1 APP0 segment (ref http://www.schnarff.com/file-formats/bmp/BMPDIB.TXT)
453
+ # APP0 AVI1 segment (ref http://www.schnarff.com/file-formats/bmp/BMPDIB.TXT)
443
454
  %Image::ExifTool::JPEG::AVI1 = (
444
455
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
445
456
  GROUPS => { 0 => 'APP0', 1 => 'AVI1', 2 => 'Image' },
@@ -455,7 +466,7 @@ sub ProcessJPEG_HDR($$$);
455
466
  },
456
467
  );
457
468
 
458
- # Ocad APP0 segment (ref PH)
469
+ # APP0 Ocad segment (ref PH)
459
470
  %Image::ExifTool::JPEG::Ocad = (
460
471
  PROCESS_PROC => \&ProcessOcad,
461
472
  GROUPS => { 0 => 'APP0', 1 => 'Ocad', 2 => 'Image' },
@@ -471,7 +482,7 @@ sub ProcessJPEG_HDR($$$);
471
482
  }
472
483
  );
473
484
 
474
- # NITF APP6 segment (National Imagery Transmission Format)
485
+ # APP6 NITF segment (National Imagery Transmission Format)
475
486
  # ref http://www.gwg.nga.mil/ntb/baseline/docs/n010697/bwcguide25aug98.pdf
476
487
  %Image::ExifTool::JPEG::NITF = (
477
488
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -591,7 +602,7 @@ segments are included in the Image::ExifTool module itself.
591
602
 
592
603
  =head1 AUTHOR
593
604
 
594
- Copyright 2003-2017, Phil Harvey (phil at owl.phy.queensu.ca)
605
+ Copyright 2003-2019, Phil Harvey (phil at owl.phy.queensu.ca)
595
606
 
596
607
  This library is free software; you can redistribute it and/or modify it
597
608
  under the same terms as Perl itself.