exiftool_vendored 12.25.0 → 12.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +174 -7
  3. data/bin/MANIFEST +11 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +44 -43
  7. data/bin/arg_files/xmp2exif.args +2 -1
  8. data/bin/config_files/convert_regions.config +25 -14
  9. data/bin/config_files/example.config +1 -1
  10. data/bin/exiftool +118 -92
  11. data/bin/fmt_files/gpx.fmt +1 -1
  12. data/bin/fmt_files/gpx_wpt.fmt +1 -1
  13. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +16 -3
  14. data/bin/lib/Image/ExifTool/CBOR.pm +331 -0
  15. data/bin/lib/Image/ExifTool/Canon.pm +52 -20
  16. data/bin/lib/Image/ExifTool/Charset.pm +2 -0
  17. data/bin/lib/Image/ExifTool/DPX.pm +13 -2
  18. data/bin/lib/Image/ExifTool/Exif.pm +107 -8
  19. data/bin/lib/Image/ExifTool/FLIR.pm +33 -8
  20. data/bin/lib/Image/ExifTool/FlashPix.pm +35 -10
  21. data/bin/lib/Image/ExifTool/FujiFilm.pm +1 -0
  22. data/bin/lib/Image/ExifTool/Geotag.pm +13 -2
  23. data/bin/lib/Image/ExifTool/GoPro.pm +16 -1
  24. data/bin/lib/Image/ExifTool/ICC_Profile.pm +96 -4
  25. data/bin/lib/Image/ExifTool/ID3.pm +15 -3
  26. data/bin/lib/Image/ExifTool/JPEG.pm +68 -2
  27. data/bin/lib/Image/ExifTool/JSON.pm +7 -3
  28. data/bin/lib/Image/ExifTool/Jpeg2000.pm +164 -36
  29. data/bin/lib/Image/ExifTool/LIF.pm +153 -0
  30. data/bin/lib/Image/ExifTool/Lang/nl.pm +60 -59
  31. data/bin/lib/Image/ExifTool/M2TS.pm +103 -7
  32. data/bin/lib/Image/ExifTool/MIE.pm +2 -1
  33. data/bin/lib/Image/ExifTool/MRC.pm +1 -1
  34. data/bin/lib/Image/ExifTool/MacOS.pm +2 -2
  35. data/bin/lib/Image/ExifTool/Nikon.pm +50 -6
  36. data/bin/lib/Image/ExifTool/NikonSettings.pm +10 -2
  37. data/bin/lib/Image/ExifTool/Olympus.pm +9 -2
  38. data/bin/lib/Image/ExifTool/Other.pm +93 -0
  39. data/bin/lib/Image/ExifTool/PDF.pm +11 -12
  40. data/bin/lib/Image/ExifTool/PNG.pm +7 -6
  41. data/bin/lib/Image/ExifTool/Panasonic.pm +14 -2
  42. data/bin/lib/Image/ExifTool/Pentax.pm +28 -5
  43. data/bin/lib/Image/ExifTool/Photoshop.pm +6 -0
  44. data/bin/lib/Image/ExifTool/QuickTime.pm +123 -25
  45. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +203 -121
  46. data/bin/lib/Image/ExifTool/README +9 -2
  47. data/bin/lib/Image/ExifTool/RIFF.pm +7 -2
  48. data/bin/lib/Image/ExifTool/Samsung.pm +47 -10
  49. data/bin/lib/Image/ExifTool/Sony.pm +113 -42
  50. data/bin/lib/Image/ExifTool/TagLookup.pm +4599 -4451
  51. data/bin/lib/Image/ExifTool/TagNames.pod +276 -41
  52. data/bin/lib/Image/ExifTool/Torrent.pm +18 -11
  53. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  54. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
  55. data/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
  56. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +21 -4
  57. data/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  58. data/bin/lib/Image/ExifTool/Writer.pl +47 -2
  59. data/bin/lib/Image/ExifTool/XMP.pm +32 -12
  60. data/bin/lib/Image/ExifTool/XMP2.pl +5 -2
  61. data/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
  62. data/bin/lib/Image/ExifTool/ZISRAW.pm +121 -2
  63. data/bin/lib/Image/ExifTool.pm +153 -52
  64. data/bin/lib/Image/ExifTool.pod +70 -60
  65. data/bin/perl-Image-ExifTool.spec +43 -42
  66. data/lib/exiftool_vendored/version.rb +1 -1
  67. metadata +6 -3
@@ -26,9 +26,10 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
26
26
  $psAPP13hdr $psAPP13old @loadAllTables %UserDefined $evalWarning
27
27
  %noWriteFile %magicNumber @langs $defaultLang %langName %charsetName
28
28
  %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd
29
- %jpegMarker %specialTags %fileTypeLookup $testLen $exePath);
29
+ %jpegMarker %specialTags %fileTypeLookup $testLen $exeDir
30
+ %static_vars);
30
31
 
31
- $VERSION = '12.25';
32
+ $VERSION = '12.35';
32
33
  $RELEASE = '';
33
34
  @ISA = qw(Exporter);
34
35
  %EXPORT_TAGS = (
@@ -138,18 +139,18 @@ sub ReadValue($$$;$$$);
138
139
  @loadAllTables = qw(
139
140
  PhotoMechanic Exif GeoTiff CanonRaw KyoceraRaw Lytro MinoltaRaw PanasonicRaw
140
141
  SigmaRaw JPEG GIMP Jpeg2000 GIF BMP BMP::OS2 BMP::Extra BPG BPG::Extensions
141
- PICT PNG MNG FLIF DjVu DPX OpenEXR ZISRAW MRC MRC::FEI12 MIFF PCX PGF PSP
142
- PhotoCD Radiance PDF PostScript Photoshop::Header Photoshop::Layers
143
- Photoshop::ImageData FujiFilm::RAF FujiFilm::IFD Samsung::Trailer Sony::SRF2
144
- Sony::SR2SubIFD Sony::PMP ITC ID3 ID3::Lyrics3 FLAC Ogg Vorbis APE
145
- APE::NewHeader APE::OldHeader Audible MPC MPEG::Audio MPEG::Video MPEG::Xing
146
- M2TS QuickTime QuickTime::ImageFile QuickTime::Stream QuickTime::Tags360Fly
147
- Matroska MOI MXF DV Flash Flash::FLV Real::Media Real::Audio Real::Metafile
148
- Red RIFF AIFF ASF WTV DICOM FITS MIE JSON HTML XMP::SVG Palm Palm::MOBI
149
- Palm::EXTH Torrent EXE EXE::PEVersion EXE::PEString EXE::MachO EXE::PEF
150
- EXE::ELF EXE::AR EXE::CHM LNK Font VCard Text VCard::VCalendar RSRC Rawzor
151
- ZIP ZIP::GZIP ZIP::RAR RTF OOXML iWork ISO FLIR::AFF FLIR::FPF MacOS
152
- MacOS::MDItem FlashPix::DocTable
142
+ PICT PNG MNG FLIF DjVu DPX OpenEXR ZISRAW MRC LIF MRC::FEI12 MIFF PCX PGF
143
+ PSP PhotoCD Radiance Other::PFM PDF PostScript Photoshop::Header
144
+ Photoshop::Layers Photoshop::ImageData FujiFilm::RAF FujiFilm::IFD
145
+ Samsung::Trailer Sony::SRF2 Sony::SR2SubIFD Sony::PMP ITC ID3 ID3::Lyrics3
146
+ FLAC Ogg Vorbis APE APE::NewHeader APE::OldHeader Audible MPC MPEG::Audio
147
+ MPEG::Video MPEG::Xing M2TS QuickTime QuickTime::ImageFile QuickTime::Stream
148
+ QuickTime::Tags360Fly Matroska MOI MXF DV Flash Flash::FLV Real::Media
149
+ Real::Audio Real::Metafile Red RIFF AIFF ASF WTV DICOM FITS MIE JSON HTML
150
+ XMP::SVG Palm Palm::MOBI Palm::EXTH Torrent EXE EXE::PEVersion EXE::PEString
151
+ EXE::MachO EXE::PEF EXE::ELF EXE::AR EXE::CHM LNK Font VCard Text
152
+ VCard::VCalendar RSRC Rawzor ZIP ZIP::GZIP ZIP::RAR RTF OOXML iWork ISO
153
+ FLIR::AFF FLIR::FPF MacOS MacOS::MDItem FlashPix::DocTable
153
154
  );
154
155
 
155
156
  # alphabetical list of current Lang modules
@@ -190,7 +191,7 @@ $defaultLang = 'en'; # default language
190
191
  HTML VRD RTF FITS XCF DSS QTIF FPX PICT ZIP GZIP PLIST RAR BZ2
191
192
  CZI TAR EXE EXR HDR CHM LNK WMF AVC DEX DPX RAW Font RSRC M2TS
192
193
  MacOS PHP PCX DCX DWF DWG DXF WTV Torrent VCard LRI R3D AA PDB
193
- MRC JXL MOI ISO ALIAS JSON MP3 DICOM PCD TXT);
194
+ PFM2 MRC LIF JXL MOI ISO ALIAS JSON MP3 DICOM PCD TXT);
194
195
 
195
196
  # file types that we can write (edit)
196
197
  my @writeTypes = qw(JPEG TIFF GIF CRW MRW ORF RAF RAW PNG MIE PSD XMP PPM EPS
@@ -354,6 +355,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
354
355
  JPF => 'JP2',
355
356
  JPG => 'JPEG',
356
357
  JPM => ['JP2', 'JPEG 2000 compound image'],
358
+ JPS => ['JPEG', 'JPEG Stereo image'],
357
359
  JPX => ['JP2', 'JPEG 2000 with extensions'],
358
360
  JSON => ['JSON', 'JavaScript Object Notation'],
359
361
  JXL => ['JXL', 'JPEG XL'],
@@ -365,6 +367,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
365
367
  LA => ['RIFF', 'Lossless Audio'],
366
368
  LFP => ['LFP', 'Lytro Light Field Picture'],
367
369
  LFR => 'LFP', # (Light Field RAW)
370
+ LIF => ['LIF', 'Leica Image File'],
368
371
  LNK => ['LNK', 'Windows shortcut'],
369
372
  LRI => ['LRI', 'Light RAW'],
370
373
  LRV => ['MOV', 'Low-Resolution Video'],
@@ -434,7 +437,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
434
437
  PEF => ['TIFF', 'Pentax (RAW) Electronic Format'],
435
438
  PFA => ['Font', 'PostScript Font ASCII'],
436
439
  PFB => ['Font', 'PostScript Font Binary'],
437
- PFM => ['Font', 'Printer Font Metrics'],
440
+ PFM => [['Font','PFM2'], 'Printer Font Metrics'], # (description is overridden for Portable FloatMap images)
438
441
  PGF => ['PGF', 'Progressive Graphics File'],
439
442
  PGM => ['PPM', 'Portable Gray Map'],
440
443
  PHP => ['PHP', 'PHP Hypertext Preprocessor'],
@@ -605,7 +608,7 @@ my %fileDescription = (
605
608
  DJVU => 'image/vnd.djvu',
606
609
  DNG => 'image/x-adobe-dng',
607
610
  DOC => 'application/msword',
608
- DOCM => 'application/vnd.ms-word.document.macroEnabled',
611
+ DOCM => 'application/vnd.ms-word.document.macroEnabled.12',
609
612
  DOCX => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
610
613
  DOT => 'application/msword',
611
614
  DOTM => 'application/vnd.ms-word.template.macroEnabledTemplate',
@@ -654,6 +657,7 @@ my %fileDescription = (
654
657
  JP2 => 'image/jp2',
655
658
  JPEG => 'image/jpeg',
656
659
  JPM => 'image/jpm',
660
+ JPS => 'image/x-jps',
657
661
  JPX => 'image/jpx',
658
662
  JSON => 'application/json',
659
663
  JXL => 'image/jxl', #PH (NC)
@@ -662,6 +666,7 @@ my %fileDescription = (
662
666
  KDC => 'image/x-kodak-kdc',
663
667
  KEY => 'application/x-iwork-keynote-sffkey',
664
668
  LFP => 'image/x-lytro-lfp', #PH (NC)
669
+ LIF => 'image/x-lif',
665
670
  LNK => 'application/octet-stream',
666
671
  LRI => 'image/x-light-lri',
667
672
  M2T => 'video/mpeg',
@@ -717,16 +722,16 @@ my %fileDescription = (
717
722
  PMP => 'image/x-sony-pmp', #PH (NC)
718
723
  PNG => 'image/png',
719
724
  POT => 'application/vnd.ms-powerpoint',
720
- POTM => 'application/vnd.ms-powerpoint.template.macroEnabled',
725
+ POTM => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
721
726
  POTX => 'application/vnd.openxmlformats-officedocument.presentationml.template',
722
- PPAM => 'application/vnd.ms-powerpoint.addin.macroEnabled',
727
+ PPAM => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
723
728
  PPAX => 'application/vnd.openxmlformats-officedocument.presentationml.addin', # (NC, PH invented)
724
729
  PPM => 'image/x-portable-pixmap',
725
730
  PPS => 'application/vnd.ms-powerpoint',
726
- PPSM => 'application/vnd.ms-powerpoint.slideshow.macroEnabled',
731
+ PPSM => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
727
732
  PPSX => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
728
733
  PPT => 'application/vnd.ms-powerpoint',
729
- PPTM => 'application/vnd.ms-powerpoint.presentation.macroEnabled',
734
+ PPTM => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
730
735
  PPTX => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
731
736
  PS => 'application/postscript',
732
737
  PSD => 'application/vnd.adobe.photoshop',
@@ -773,13 +778,13 @@ my %fileDescription = (
773
778
  X3F => 'image/x-sigma-x3f',
774
779
  XCF => 'image/x-xcf',
775
780
  XLA => 'application/vnd.ms-excel',
776
- XLAM => 'application/vnd.ms-excel.addin.macroEnabled',
781
+ XLAM => 'application/vnd.ms-excel.addin.macroEnabled.12',
777
782
  XLS => 'application/vnd.ms-excel',
778
- XLSB => 'application/vnd.ms-excel.sheet.binary.macroEnabled',
779
- XLSM => 'application/vnd.ms-excel.sheet.macroEnabled',
783
+ XLSB => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
784
+ XLSM => 'application/vnd.ms-excel.sheet.macroEnabled.12',
780
785
  XLSX => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
781
786
  XLT => 'application/vnd.ms-excel',
782
- XLTM => 'application/vnd.ms-excel.template.macroEnabled',
787
+ XLTM => 'application/vnd.ms-excel.template.macroEnabled.12',
783
788
  XLTX => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
784
789
  XML => 'application/xml',
785
790
  XMP => 'application/rdf+xml',
@@ -803,6 +808,7 @@ my %moduleName = (
803
808
  DEX => 0,
804
809
  DOCX => 'OOXML',
805
810
  DCX => 0,
811
+ DIR => 0,
806
812
  DR4 => 'CanonVRD',
807
813
  DSS => 'Olympus',
808
814
  DWF => 0,
@@ -832,6 +838,7 @@ my %moduleName = (
832
838
  ORF => 'Olympus',
833
839
  PDB => 'Palm',
834
840
  PCD => 'PhotoCD',
841
+ PFM2 => 'Other',
835
842
  PHP => 0,
836
843
  PMP => 'Sony',
837
844
  PS => 'PostScript',
@@ -902,7 +909,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
902
909
  GZIP => '\x1f\x8b\x08',
903
910
  HDR => '#\?(RADIANCE|RGBE)\x0a',
904
911
  HTML => '(\xef\xbb\xbf)?\s*(?i)<(!DOCTYPE\s+HTML|HTML|\?xml)', # (case insensitive)
905
- ICC => '.{12}(scnr|mntr|prtr|link|spac|abst|nmcl|nkpf)(XYZ |Lab |Luv |YCbr|Yxy |RGB |GRAY|HSV |HLS |CMYK|CMY |[2-9A-F]CLR){2}',
912
+ ICC => '.{12}(scnr|mntr|prtr|link|spac|abst|nmcl|nkpf|cenc|mid |mlnk|mvis)(XYZ |Lab |Luv |YCbr|Yxy |RGB |GRAY|HSV |HLS |CMYK|CMY |[2-9A-F]CLR|nc..|\0{4}){2}',
906
913
  IND => '\x06\x06\xed\xf5\xd8\x1d\x46\xe5\xbd\x31\xef\xe7\xfe\x74\xb7\x1d',
907
914
  # ISO => signature is at byte 32768
908
915
  ITC => '.{4}itch',
@@ -911,6 +918,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
911
918
  JSON => '(\xef\xbb\xbf)?\s*(\[\s*)?\{\s*"[^"]*"\s*:',
912
919
  JXL => '\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl ',
913
920
  LFP => '\x89LFP\x0d\x0a\x1a\x0a',
921
+ LIF => '\x70\0{3}.{4}\x2a.{4}<\0',
914
922
  LNK => '.{4}\x01\x14\x02\0{5}\xc0\0{6}\x46',
915
923
  LRI => 'LELR \0',
916
924
  M2TS => '(....)?\x47',
@@ -927,10 +935,11 @@ $testLen = 1024; # number of bytes to read when testing for magic number
927
935
  MXF => '\x06\x0e\x2b\x34\x02\x05\x01\x01\x0d\x01\x02', # (not tested if extension recognized)
928
936
  OGG => '(OggS|ID3)',
929
937
  ORF => '(II|MM)',
930
- PDB => '.{60}(\.pdfADBE|TEXtREAd|BVokBDIC|DB99DBOS|PNRdPPrs|DataPPrs|vIMGView|PmDBPmDB|InfoINDB|ToGoToGo|SDocSilX|JbDbJBas|JfDbJFil|DATALSdb|Mdb1Mdb1|BOOKMOBI|DataPlkr|DataSprd|SM01SMem|TEXtTlDc|InfoTlIf|DataTlMl|DataTlPt|dataTDBP|TdatTide|ToRaTRPW|zTXTGPlm|BDOCWrdS)',
931
938
  # PCD => signature is at byte 2048
932
939
  PCX => '\x0a[\0-\x05]\x01[\x01\x02\x04\x08].{64}[\0-\x02]',
940
+ PDB => '.{60}(\.pdfADBE|TEXtREAd|BVokBDIC|DB99DBOS|PNRdPPrs|DataPPrs|vIMGView|PmDBPmDB|InfoINDB|ToGoToGo|SDocSilX|JbDbJBas|JfDbJFil|DATALSdb|Mdb1Mdb1|BOOKMOBI|DataPlkr|DataSprd|SM01SMem|TEXtTlDc|InfoTlIf|DataTlMl|DataTlPt|dataTDBP|TdatTide|ToRaTRPW|zTXTGPlm|BDOCWrdS)',
933
941
  PDF => '\s*%PDF-\d+\.\d+',
942
+ PFM => 'P[Ff]\x0a\d+ \d+\x0a[-+0-9.]+\x0a',
934
943
  PGF => 'PGF',
935
944
  PHP => '<\?php\s',
936
945
  PICT => '(.{10}|.{522})(\x11\x01|\x00\x11)',
@@ -1147,14 +1156,14 @@ my %systemTagsNotes = (
1147
1156
  Groups => { 1 => 'System', 2 => 'Other' },
1148
1157
  Notes => q{
1149
1158
  file name without extension. Not generated unless specifically requested or
1150
- the L<RequestAll|../ExifTool.html#RequestAll> API option is set
1159
+ the API L<RequestAll|../ExifTool.html#RequestAll> option is set
1151
1160
  },
1152
1161
  },
1153
1162
  FilePath => {
1154
1163
  Groups => { 1 => 'System', 2 => 'Other' },
1155
1164
  Notes => q{
1156
1165
  absolute path of source file. Not generated unless specifically requested or
1157
- the L<RequestAll|../ExifTool.html#RequestAll> API option is set. Does not support Windows Unicode file
1166
+ the API L<RequestAll|../ExifTool.html#RequestAll> option is set. Does not support Windows Unicode file
1158
1167
  names
1159
1168
  },
1160
1169
  },
@@ -1177,7 +1186,7 @@ my %systemTagsNotes = (
1177
1186
  sequence number for each source file when extracting or copying information,
1178
1187
  including files that fail the -if condition of the command-line application,
1179
1188
  beginning at 0 for the first file. Not generated unless specifically
1180
- requested or the L<RequestAll|../ExifTool.html#RequestAll> API option is set
1189
+ requested or the API L<RequestAll|../ExifTool.html#RequestAll> option is set
1181
1190
  },
1182
1191
  },
1183
1192
  FileSize => {
@@ -1199,6 +1208,18 @@ my %systemTagsNotes = (
1199
1208
  },
1200
1209
  PrintConv => \&ConvertFileSize,
1201
1210
  },
1211
+ ZoneIdentifier => {
1212
+ Groups => { 1 => 'System', 2 => 'Other' },
1213
+ Notes => q{
1214
+ Windows only. Used to indicate that a file has a Zone.Identifier alternate
1215
+ data stream, which is used by some Windows browsers to mark downloaded files
1216
+ as possibly unsafe to run. May be deleted to remove this stream. Requires
1217
+ Win32API::File
1218
+ },
1219
+ Writable => 1,
1220
+ WritePseudo => 1,
1221
+ Protected => 1,
1222
+ },
1202
1223
  FileType => {
1203
1224
  Groups => { 2 => 'Other' },
1204
1225
  Notes => q{
@@ -1250,7 +1271,7 @@ my %systemTagsNotes = (
1250
1271
  the filesystem creation date/time. Windows/Mac only. In Windows, the file
1251
1272
  creation date/time is preserved by default when writing if Win32API::File
1252
1273
  and Win32::API are available. On Mac, this tag is extracted only if it or
1253
- the MacOS group is specifically requested or the L<RequestAll|../ExifTool.html#RequestAll> API option is
1274
+ the MacOS group is specifically requested or the API L<RequestAll|../ExifTool.html#RequestAll> option is
1254
1275
  set to 2 or higher. Requires "setfile" for writing on Mac, which may be
1255
1276
  installed by typing C<xcode-select --install> in the Terminal
1256
1277
  },
@@ -1641,7 +1662,7 @@ my %systemTagsNotes = (
1641
1662
  sub-sampling values to generate the value of this tag. The result is
1642
1663
  compared to known values in an attempt to deduce the originating software
1643
1664
  based only on the JPEG image data. For performance reasons, this tag is
1644
- generated only if specifically requested or the L<RequestAll|../ExifTool.html#RequestAll> API option is set
1665
+ generated only if specifically requested or the API L<RequestAll|../ExifTool.html#RequestAll> option is set
1645
1666
  to 3 or higher
1646
1667
  },
1647
1668
  },
@@ -1649,14 +1670,14 @@ my %systemTagsNotes = (
1649
1670
  Notes => q{
1650
1671
  an estimate of the IJG JPEG quality setting for the image, calculated from
1651
1672
  the quantization tables. For performance reasons, this tag is generated
1652
- only if specifically requested or the L<RequestAll|../ExifTool.html#RequestAll> API option is set to 3 or
1673
+ only if specifically requested or the API L<RequestAll|../ExifTool.html#RequestAll> option is set to 3 or
1653
1674
  higher
1654
1675
  },
1655
1676
  },
1656
1677
  JPEGImageLength => {
1657
1678
  Notes => q{
1658
1679
  byte length of JPEG image without metadata. For performance reasons, this
1659
- tag is generated only if specifically requested or the L<RequestAll|../ExifTool.html#RequestAll> API option
1680
+ tag is generated only if specifically requested or the API L<RequestAll|../ExifTool.html#RequestAll> option
1660
1681
  is set to 3 or higher
1661
1682
  },
1662
1683
  },
@@ -1666,7 +1687,7 @@ my %systemTagsNotes = (
1666
1687
  Notes => q{
1667
1688
  the current date/time. Useful when setting the tag values, eg.
1668
1689
  C<"-modifydate<now">. Not generated unless specifically requested or the
1669
- L<RequestAll|../ExifTool.html#RequestAll> API option is set
1690
+ API L<RequestAll|../ExifTool.html#RequestAll> option is set
1670
1691
  },
1671
1692
  PrintConv => '$self->ConvertDateTime($val)',
1672
1693
  },
@@ -1677,7 +1698,7 @@ my %systemTagsNotes = (
1677
1698
  YYYYmmdd-HHMM-SSNN-PPPP-RRRRRRRRRRRR, where Y=year, m=month, d=day, H=hour,
1678
1699
  M=minute, S=second, N=file sequence number in hex, P=process ID in hex, and
1679
1700
  R=random hex number; without dashes with the -n option. Not generated
1680
- unless specifically requested or the L<RequestAll|../ExifTool.html#RequestAll> API option is set
1701
+ unless specifically requested or the API L<RequestAll|../ExifTool.html#RequestAll> option is set
1681
1702
  },
1682
1703
  PrintConv => '$val =~ s/(.{8})(.{4})(.{4})(.{4})/$1-$2-$3-$4-/; $val',
1683
1704
  },
@@ -1770,7 +1791,7 @@ my %systemTagsNotes = (
1770
1791
  Groups => { 0 => 'Trailer' },
1771
1792
  Notes => q{
1772
1793
  the full JPEG trailer data block. Extracted only if specifically requested
1773
- or the RequestAll API option is set to 3 or higher
1794
+ or the API RequestAll option is set to 3 or higher
1774
1795
  },
1775
1796
  Writable => 1,
1776
1797
  Protected => 1,
@@ -1932,6 +1953,8 @@ my %systemTagsNotes = (
1932
1953
  return \$img;
1933
1954
  },
1934
1955
  },
1956
+ # Apple may add "AMPF" to the end of the JFIF record,
1957
+ # possibly indicating the existence of MPF images (ref forum12677)
1935
1958
  );
1936
1959
 
1937
1960
  # Composite tags (accumulation of all Composite tag tables)
@@ -2084,12 +2107,15 @@ sub Options($$;@)
2084
2107
  $$options{$param} = $newVal;
2085
2108
  delete $$self{CUR_LANG};
2086
2109
  # make sure the language is available
2087
- } elsif (eval "require Image::ExifTool::Lang::$newVal") {
2088
- my $xlat = "Image::ExifTool::Lang::${newVal}::Translate";
2089
- no strict 'refs';
2090
- if (%$xlat) {
2091
- $$self{CUR_LANG} = \%$xlat;
2092
- $$options{$param} = $newVal;
2110
+ } else {
2111
+ my %langs = map { $_ => 1 } @langs;
2112
+ if ($langs{$newVal} and eval "require Image::ExifTool::Lang::$newVal") {
2113
+ my $xlat = "Image::ExifTool::Lang::${newVal}::Translate";
2114
+ no strict 'refs';
2115
+ if (%$xlat) {
2116
+ $$self{CUR_LANG} = \%$xlat;
2117
+ $$options{$param} = $newVal;
2118
+ }
2093
2119
  }
2094
2120
  } # else don't change Lang
2095
2121
  } elsif ($param eq 'Exclude' and defined $newVal) {
@@ -2306,6 +2332,7 @@ sub ClearOptions($)
2306
2332
  Password => undef, # password for password-protected PDF documents
2307
2333
  PrintConv => 1, # flag to enable print conversion
2308
2334
  QuickTimeHandler => 1, # flag to add mdir Handler to newly created Meta box
2335
+ QuickTimePad=> undef, # flag to preserve padding of QuickTime CR3 tags
2309
2336
  QuickTimeUTC=> undef, # assume that QuickTime date/time tags are stored as UTC
2310
2337
  RequestAll => undef, # extract all tags that must be specifically requested
2311
2338
  RequestTags => undef, # extra tags to request (on top of those in the tag list)
@@ -2355,7 +2382,7 @@ sub ExtractInfo($;@)
2355
2382
  my $fast = $$options{FastScan} || 0;
2356
2383
  my $req = $$self{REQ_TAG_LOOKUP};
2357
2384
  my $reqAll = $$options{RequestAll} || 0;
2358
- my (%saveOptions, $reEntry, $rsize, $type, @startTime, $saveOrder, $isDir);
2385
+ my (%saveOptions, $reEntry, $rsize, $zid, $type, @startTime, $saveOrder, $isDir);
2359
2386
 
2360
2387
  # check for internal ReEntry option to allow recursive calls to ExtractInfo
2361
2388
  if (ref $_[1] eq 'HASH' and $_[1]{ReEntry} and
@@ -2447,6 +2474,17 @@ sub ExtractInfo($;@)
2447
2474
  }
2448
2475
  # get size of resource fork on Mac OS
2449
2476
  $rsize = -s "$filename/..namedfork/rsrc" if $^O eq 'darwin' and not $$self{IN_RESOURCE};
2477
+ # check to see if Zone.Identifier file exists in Windows
2478
+ if ($^O eq 'MSWin32' and eval { require Win32API::File }) {
2479
+ my $wattr;
2480
+ my $zfile = "${filename}:Zone.Identifier";
2481
+ if ($self->EncodeFileName($zfile)) {
2482
+ $wattr = eval { Win32API::File::GetFileAttributesW($zfile) };
2483
+ } else {
2484
+ $wattr = eval { Win32API::File::GetFileAttributes($zfile) };
2485
+ }
2486
+ $zid = 1 unless $wattr == Win32API::File::INVALID_FILE_ATTRIBUTES();
2487
+ }
2450
2488
  }
2451
2489
  # open the file
2452
2490
  if ($self->Open(\*EXIFTOOL_FILE, $filename)) {
@@ -2489,6 +2527,7 @@ sub ExtractInfo($;@)
2489
2527
  my $fileSize = $stat[7];
2490
2528
  $self->FoundTag('FileSize', $stat[7]) if defined $stat[7];
2491
2529
  $self->FoundTag('ResourceForkSize', $rsize) if $rsize;
2530
+ $self->FoundTag('ZoneIdentifier', 'Exists') if $zid;
2492
2531
  $self->FoundTag('FileModifyDate', $stat[9]) if defined $stat[9];
2493
2532
  $self->FoundTag('FileAccessDate', $stat[8]) if defined $stat[8];
2494
2533
  my $cTag = $^O eq 'MSWin32' ? 'FileCreateDate' : 'FileInodeChangeDate';
@@ -3304,8 +3343,9 @@ sub GetTagID($$)
3304
3343
  my ($self, $tag) = @_;
3305
3344
  my $tagInfo = $$self{TAG_INFO}{$tag};
3306
3345
  return '' unless $tagInfo and defined $$tagInfo{TagID};
3307
- return ($$tagInfo{TagID}, $$tagInfo{LangCode}) if wantarray;
3308
- return $$tagInfo{TagID};
3346
+ my $id = $$tagInfo{KeysID} || $$tagInfo{TagID};
3347
+ return ($id, $$tagInfo{LangCode}) if wantarray;
3348
+ return $id;
3309
3349
  }
3310
3350
 
3311
3351
  #------------------------------------------------------------------------------
@@ -3421,7 +3461,7 @@ sub GetGroup($$;$)
3421
3461
  }
3422
3462
  # generate tag ID group names unless obviously not needed
3423
3463
  unless ($noID) {
3424
- my $id = $$tagInfo{TagID};
3464
+ my $id = $$tagInfo{KeysID} || $$tagInfo{TagID};
3425
3465
  if (not defined $id) {
3426
3466
  $id = ''; # (just to be safe)
3427
3467
  } elsif ($id =~ /^\d+$/) {
@@ -3776,7 +3816,15 @@ sub GetFileType(;$$)
3776
3816
  # return description if specified
3777
3817
  # (allow input $file to be a FileType for this purpose)
3778
3818
  if ($desc) {
3779
- $desc = $fileType ? $$fileType[1] : $fileDescription{$file};
3819
+ if ($fileType) {
3820
+ if ($static_vars{OverrideFileDescription} and $static_vars{OverrideFileDescription}{$fileExt}) {
3821
+ $desc = $static_vars{OverrideFileDescription}{$fileExt};
3822
+ } else {
3823
+ $desc = $$fileType[1];
3824
+ }
3825
+ } else {
3826
+ $desc = $fileDescription{$file};
3827
+ }
3780
3828
  $desc .= ", $subType" if $subType;
3781
3829
  return $desc;
3782
3830
  } elsif ($fileType and (not defined $desc or $desc ne '0')) {
@@ -3841,6 +3889,7 @@ sub Init($)
3841
3889
  foreach (keys %$self) {
3842
3890
  /[a-z]/ and delete $$self{$_};
3843
3891
  }
3892
+ undef %static_vars; # clear all static variables
3844
3893
  delete $$self{FOUND_TAGS}; # list of found tags
3845
3894
  delete $$self{EXIF_DATA}; # the EXIF data block
3846
3895
  delete $$self{EXIF_POS}; # EXIF position in file
@@ -4098,7 +4147,9 @@ sub Exists($$)
4098
4147
  return 0 unless $wh;
4099
4148
  eval { Win32API::File::CloseHandle($wh) };
4100
4149
  } else {
4101
- return -e $file;
4150
+ # (named pipes already exist, but we pretend that they don't
4151
+ # so we will be able to write them, so test with for pipe -p)
4152
+ return(-e $file and not -p $file);
4102
4153
  }
4103
4154
  return 1;
4104
4155
  }
@@ -5626,6 +5677,38 @@ sub ConvertDateTime($$)
5626
5677
  unshift @a, 1 while @a < 3; # add month and day if necessary
5627
5678
  unshift @a, 0 while @a < 6; # add h,m,s if necessary
5628
5679
  $a[4] -= 1; # base month is 1
5680
+ # parse our %f fractional seconds first (and round up seconds if necessary)
5681
+ # - if there are multiple %f codes, they all get the same number of digits as the first
5682
+ if ($fmt =~ /%\.?(\d*)f/) {
5683
+ my $dig = $1;
5684
+ my $frac = $date =~ /(\.\d+)/ ? $1 : '';
5685
+ if (not $frac) {
5686
+ $frac = '.' . ('0' x $dig) if $dig;
5687
+ } elsif (length $dig) {
5688
+ if ($dig+1 > length($frac)) {
5689
+ $frac .= '0' x ($dig+1-length($frac));
5690
+ } elsif ($dig+1 < length($frac)) {
5691
+ $frac = sprintf("%.${dig}f", $frac);
5692
+ while ($frac =~ s/^(\d)// and $1 ne '0') {
5693
+ # this is a pain, but we must round up to the next second
5694
+ ++$a[0] < 60 and last;
5695
+ $a[0] = 0;
5696
+ ++$a[1] < 60 and last;
5697
+ $a[1] = 0;
5698
+ ++$a[2] < 24 and last;
5699
+ $a[2] = 0;
5700
+ require 'Image/ExifTool/Shift.pl';
5701
+ ++$a[3] <= DaysInMonth($a[4]+1, $a[5]) and last;
5702
+ $a[3] = 1;
5703
+ ++$a[4] < 12 and last;
5704
+ $a[4] = 0;
5705
+ ++$a[5];
5706
+ last; # (this was a goto)
5707
+ }
5708
+ }
5709
+ }
5710
+ $fmt =~ s/(^|[^%])((%%)*)%\.?\d*f/$1$2$frac/g;
5711
+ }
5629
5712
  # parse %z and %s ourself (to handle time zones properly)
5630
5713
  if ($fmt =~ /%[sz]/) {
5631
5714
  # use system time zone unless otherwise specified
@@ -6182,6 +6265,7 @@ sub ProcessJPEG($$)
6182
6265
  my $marker = $nextMarker;
6183
6266
  my $segDataPt = $nextSegDataPt;
6184
6267
  my $segPos = $nextSegPos;
6268
+ my $skipped;
6185
6269
  undef $nextMarker;
6186
6270
  undef $nextSegDataPt;
6187
6271
  #
@@ -6191,11 +6275,13 @@ sub ProcessJPEG($$)
6191
6275
  # read up to next marker (JPEG markers begin with 0xff)
6192
6276
  my $buff;
6193
6277
  $raf->ReadLine($buff) or last;
6278
+ $skipped = length($buff) - 1;
6194
6279
  # JPEG markers can be padded with unlimited 0xff's
6195
6280
  for (;;) {
6196
6281
  $raf->Read($ch, 1) or last Marker;
6197
6282
  $nextMarker = ord($ch);
6198
6283
  last unless $nextMarker == 0xff;
6284
+ ++$skipped;
6199
6285
  }
6200
6286
  # read segment data if it exists
6201
6287
  if (not defined $markerLenBytes{$nextMarker}) {
@@ -6222,6 +6308,14 @@ sub ProcessJPEG($$)
6222
6308
  # set some useful variables for the current segment
6223
6309
  my $markerName = JpegMarkerName($marker);
6224
6310
  $$path[$pn] = $markerName;
6311
+ # issue warning if we skipped some garbage
6312
+ if ($skipped and not $foundSOS) {
6313
+ $self->Warn("Skipped unknown $skipped bytes after JPEG $markerName segment", 1);
6314
+ if ($htmlDump) {
6315
+ $self->HDump($nextSegPos-4-$skipped, $skipped, "[unknown $skipped bytes]", undef, 0x08);
6316
+ $dumpEnd = $nextSegPos - 4;
6317
+ }
6318
+ }
6225
6319
  #
6226
6320
  # parse the current segment
6227
6321
  #
@@ -6433,7 +6527,7 @@ sub ProcessJPEG($$)
6433
6527
  next;
6434
6528
  } elsif ($marker == 0xdb and length($$segDataPt) and # DQT
6435
6529
  # save the DQT data only if JPEGDigest has been requested
6436
- # (Note: since we aren't checking the RequestAll API option here, the application
6530
+ # (Note: since we aren't checking the API RequestAll option here, the application
6437
6531
  # must use the RequestTags option to generate these tags if they have not been
6438
6532
  # specifically requested. The reason is that there is too much overhead involved
6439
6533
  # in the calculation of this tag to make this worth the CPU time.)
@@ -6761,6 +6855,12 @@ sub ProcessJPEG($$)
6761
6855
  # extract the Stim information (it is in standard TIFF format)
6762
6856
  my $tagTablePtr = GetTagTable('Image::ExifTool::Stim::Main');
6763
6857
  $self->ProcessTIFF(\%dirInfo, $tagTablePtr);
6858
+ } elsif ($$segDataPt =~ /^_JPSJPS_/) {
6859
+ $dumpType = 'JPS';
6860
+ $self->OverrideFileType('JPS') if $$self{FILE_TYPE} eq 'JPEG';
6861
+ SetByteOrder('MM');
6862
+ my $tagTablePtr = GetTagTable('Image::ExifTool::JPEG::JPS');
6863
+ $self->ProcessDirectory(\%dirInfo, $tagTablePtr);
6764
6864
  } elsif ($$self{Make} eq 'DJI') {
6765
6865
  $dumpType = 'DJI ThermalData';
6766
6866
  # add this data to the combined data if it exists
@@ -8668,6 +8768,7 @@ sub ProcessBinaryData($$$)
8668
8768
  # read value now if necessary
8669
8769
  unless (defined $val and not $$tagInfo{SubDirectory}) {
8670
8770
  $val = ReadValue($dataPt, $entry+$offset, $format, $count, $more, \$rational);
8771
+ next unless defined $val;
8671
8772
  $mask = $$tagInfo{Mask};
8672
8773
  $val = ($val & $mask) >> $$tagInfo{BitShift} if $mask;
8673
8774
  }
@@ -8769,8 +8870,8 @@ until ($Image::ExifTool::noConfig) {
8769
8870
  $file = $config;
8770
8871
  }
8771
8872
  # also check executable directory unless path is absolute
8772
- $exePath = $0 unless defined $exePath; # (undocumented $exePath setting)
8773
- -r $file or $config =~ /^\// or $file = ($exePath =~ /(.*[\\\/])/ ? $1 : './') . $config;
8873
+ $exeDir = ($0 =~ /(.*)[\\\/]/) ? $1 : '.' unless defined $exeDir;
8874
+ -r $file or $config =~ /^\// or $file = "$exeDir/$config";
8774
8875
  unless (-r $file) {
8775
8876
  warn("Config file not found\n") if defined $Image::ExifTool::configFile;
8776
8877
  last;