exiftool_vendored 12.22.0 → 12.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +201 -5
  3. data/bin/MANIFEST +22 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +45 -43
  7. data/bin/arg_files/xmp2exif.args +2 -1
  8. data/bin/config_files/acdsee.config +193 -6
  9. data/bin/config_files/convert_regions.config +25 -14
  10. data/bin/config_files/cuepointlist.config +70 -0
  11. data/bin/config_files/example.config +1 -1
  12. data/bin/exiftool +89 -70
  13. data/bin/fmt_files/gpx.fmt +1 -1
  14. data/bin/fmt_files/gpx_wpt.fmt +1 -1
  15. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +17 -4
  16. data/bin/lib/Image/ExifTool/CBOR.pm +331 -0
  17. data/bin/lib/Image/ExifTool/Canon.pm +53 -21
  18. data/bin/lib/Image/ExifTool/Charset.pm +2 -0
  19. data/bin/lib/Image/ExifTool/DPX.pm +13 -2
  20. data/bin/lib/Image/ExifTool/DjVu.pm +6 -5
  21. data/bin/lib/Image/ExifTool/Exif.pm +120 -12
  22. data/bin/lib/Image/ExifTool/FlashPix.pm +35 -10
  23. data/bin/lib/Image/ExifTool/FujiFilm.pm +19 -8
  24. data/bin/lib/Image/ExifTool/Geotag.pm +13 -2
  25. data/bin/lib/Image/ExifTool/GoPro.pm +16 -1
  26. data/bin/lib/Image/ExifTool/ICC_Profile.pm +96 -4
  27. data/bin/lib/Image/ExifTool/ID3.pm +15 -3
  28. data/bin/lib/Image/ExifTool/JPEG.pm +74 -4
  29. data/bin/lib/Image/ExifTool/JSON.pm +30 -5
  30. data/bin/lib/Image/ExifTool/Jpeg2000.pm +395 -16
  31. data/bin/lib/Image/ExifTool/LIF.pm +153 -0
  32. data/bin/lib/Image/ExifTool/Lang/nl.pm +60 -59
  33. data/bin/lib/Image/ExifTool/M2TS.pm +103 -7
  34. data/bin/lib/Image/ExifTool/MIE.pm +2 -1
  35. data/bin/lib/Image/ExifTool/MRC.pm +341 -0
  36. data/bin/lib/Image/ExifTool/MWG.pm +3 -3
  37. data/bin/lib/Image/ExifTool/MXF.pm +1 -1
  38. data/bin/lib/Image/ExifTool/MacOS.pm +3 -3
  39. data/bin/lib/Image/ExifTool/Microsoft.pm +5 -3
  40. data/bin/lib/Image/ExifTool/Nikon.pm +17 -5
  41. data/bin/lib/Image/ExifTool/NikonSettings.pm +19 -2
  42. data/bin/lib/Image/ExifTool/Olympus.pm +9 -2
  43. data/bin/lib/Image/ExifTool/Other.pm +93 -0
  44. data/bin/lib/Image/ExifTool/PDF.pm +11 -12
  45. data/bin/lib/Image/ExifTool/PNG.pm +8 -7
  46. data/bin/lib/Image/ExifTool/Panasonic.pm +28 -3
  47. data/bin/lib/Image/ExifTool/Pentax.pm +28 -5
  48. data/bin/lib/Image/ExifTool/PhaseOne.pm +4 -3
  49. data/bin/lib/Image/ExifTool/Photoshop.pm +6 -0
  50. data/bin/lib/Image/ExifTool/QuickTime.pm +210 -65
  51. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +280 -139
  52. data/bin/lib/Image/ExifTool/README +9 -2
  53. data/bin/lib/Image/ExifTool/RIFF.pm +89 -12
  54. data/bin/lib/Image/ExifTool/Samsung.pm +48 -10
  55. data/bin/lib/Image/ExifTool/Sony.pm +204 -61
  56. data/bin/lib/Image/ExifTool/TagLookup.pm +206 -19
  57. data/bin/lib/Image/ExifTool/TagNames.pod +634 -195
  58. data/bin/lib/Image/ExifTool/Torrent.pm +18 -11
  59. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  60. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
  61. data/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
  62. data/bin/lib/Image/ExifTool/WritePostScript.pl +1 -0
  63. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +58 -16
  64. data/bin/lib/Image/ExifTool/WriteXMP.pl +7 -3
  65. data/bin/lib/Image/ExifTool/Writer.pl +44 -0
  66. data/bin/lib/Image/ExifTool/XMP.pm +51 -18
  67. data/bin/lib/Image/ExifTool/XMP2.pl +4 -1
  68. data/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
  69. data/bin/lib/Image/ExifTool/ZISRAW.pm +121 -2
  70. data/bin/lib/Image/ExifTool.pm +188 -61
  71. data/bin/lib/Image/ExifTool.pod +89 -68
  72. data/bin/perl-Image-ExifTool.spec +43 -42
  73. data/lib/exiftool_vendored/version.rb +1 -1
  74. metadata +10 -9
@@ -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 $exePath
30
+ %static_vars);
30
31
 
31
- $VERSION = '12.22';
32
+ $VERSION = '12.34';
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 MIFF PCX PGF PSP PhotoCD Radiance
142
- PDF PostScript Photoshop::Header Photoshop::Layers Photoshop::ImageData
143
- FujiFilm::RAF FujiFilm::IFD Samsung::Trailer Sony::SRF2 Sony::SR2SubIFD
144
- Sony::PMP ITC ID3 ID3::Lyrics3 FLAC Ogg Vorbis APE APE::NewHeader
145
- APE::OldHeader Audible MPC MPEG::Audio MPEG::Video MPEG::Xing M2TS QuickTime
146
- QuickTime::ImageFile QuickTime::Stream QuickTime::Tags360Fly Matroska MOI
147
- MXF DV Flash Flash::FLV Real::Media Real::Audio Real::Metafile Red RIFF AIFF
148
- ASF WTV DICOM FITS MIE JSON HTML XMP::SVG Palm Palm::MOBI Palm::EXTH Torrent
149
- EXE EXE::PEVersion EXE::PEString EXE::MachO EXE::PEF EXE::ELF EXE::AR
150
- EXE::CHM LNK Font VCard Text VCard::VCalendar RSRC Rawzor ZIP ZIP::GZIP
151
- ZIP::RAR RTF OOXML iWork ISO FLIR::AFF FLIR::FPF MacOS MacOS::MDItem
152
- 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
@@ -189,12 +190,12 @@ $defaultLang = 'en'; # default language
189
190
  FLAC APE MPC MKV MXF DV PMP IND PGF ICC ITC FLIR FLIF FPF LFP
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
- MacOS PHP PCX DCX DWF DWG WTV Torrent VCard LRI R3D AA PDB MOI
193
- ISO ALIAS JSON MP3 DICOM PCD TXT);
193
+ MacOS PHP PCX DCX DWF DWG DXF WTV Torrent VCard LRI R3D AA PDB
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
197
- X3F PS PDF ICC VRD DR4 JP2 EXIF AI AIT IND MOV EXV FLIF);
198
+ X3F PS PDF ICC VRD DR4 JP2 JXL EXIF AI AIT IND MOV EXV FLIF);
198
199
  my %writeTypes; # lookup for writable file types (hash filled if required)
199
200
 
200
201
  # file extensions that we can't write for various base types
@@ -292,6 +293,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
292
293
  DWF => ['DWF', 'Autodesk drawing (Design Web Format)'],
293
294
  DWG => ['DWG', 'AutoCAD Drawing'],
294
295
  DYLIB=> ['EXE', 'Mach-O Dynamic Link Library'],
296
+ DXF => ['DXF', 'AutoCAD Drawing Exchange Format'],
295
297
  EIP => ['ZIP', 'Capture One Enhanced Image Package'],
296
298
  EPS => ['EPS', 'Encapsulated PostScript Format'],
297
299
  EPS2 => 'EPS',
@@ -353,8 +355,10 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
353
355
  JPF => 'JP2',
354
356
  JPG => 'JPEG',
355
357
  JPM => ['JP2', 'JPEG 2000 compound image'],
358
+ JPS => ['JPEG', 'JPEG Stereo image'],
356
359
  JPX => ['JP2', 'JPEG 2000 with extensions'],
357
360
  JSON => ['JSON', 'JavaScript Object Notation'],
361
+ JXL => ['JXL', 'JPEG XL'],
358
362
  JXR => ['TIFF', 'JPEG XR'],
359
363
  K25 => ['TIFF', 'Kodak DC25 RAW'],
360
364
  KDC => ['TIFF', 'Kodak Digital Camera RAW'],
@@ -363,6 +367,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
363
367
  LA => ['RIFF', 'Lossless Audio'],
364
368
  LFP => ['LFP', 'Lytro Light Field Picture'],
365
369
  LFR => 'LFP', # (Light Field RAW)
370
+ LIF => ['LIF', 'Leica Image File'],
366
371
  LNK => ['LNK', 'Windows shortcut'],
367
372
  LRI => ['LRI', 'Light RAW'],
368
373
  LRV => ['MOV', 'Low-Resolution Video'],
@@ -394,6 +399,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
394
399
  MPG => 'MPEG',
395
400
  MPO => ['JPEG', 'Extended Multi-Picture format'],
396
401
  MQV => ['MOV', 'Sony Mobile Quicktime Video'],
402
+ MRC => ['MRC', 'Medical Research Council image'],
397
403
  MRW => ['MRW', 'Minolta RAW format'],
398
404
  MTS => 'M2TS',
399
405
  MXF => ['MXF', 'Material Exchange Format'],
@@ -418,6 +424,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
418
424
  ONP => ['JSON', 'ON1 Presets'],
419
425
  OPUS => ['OGG', 'Ogg Opus audio file'],
420
426
  ORF => ['ORF', 'Olympus RAW format'],
427
+ ORI => 'ORF',
421
428
  OTF => ['Font', 'Open Type Font'],
422
429
  PAC => ['RIFF', 'Lossless Predictive Audio Compression'],
423
430
  PAGES => ['ZIP', 'Apple Pages document'],
@@ -430,7 +437,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
430
437
  PEF => ['TIFF', 'Pentax (RAW) Electronic Format'],
431
438
  PFA => ['Font', 'PostScript Font ASCII'],
432
439
  PFB => ['Font', 'PostScript Font Binary'],
433
- PFM => ['Font', 'Printer Font Metrics'],
440
+ PFM => [['Font','PFM2'], 'Printer Font Metrics'], # (description is overridden for Portable FloatMap images)
434
441
  PGF => ['PGF', 'Progressive Graphics File'],
435
442
  PGM => ['PPM', 'Portable Gray Map'],
436
443
  PHP => ['PHP', 'PHP Hypertext Preprocessor'],
@@ -601,7 +608,7 @@ my %fileDescription = (
601
608
  DJVU => 'image/vnd.djvu',
602
609
  DNG => 'image/x-adobe-dng',
603
610
  DOC => 'application/msword',
604
- DOCM => 'application/vnd.ms-word.document.macroEnabled',
611
+ DOCM => 'application/vnd.ms-word.document.macroEnabled.12',
605
612
  DOCX => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
606
613
  DOT => 'application/msword',
607
614
  DOTM => 'application/vnd.ms-word.template.macroEnabledTemplate',
@@ -614,6 +621,7 @@ my %fileDescription = (
614
621
  'DVR-MS' => 'video/x-ms-dvr',
615
622
  DWF => 'model/vnd.dwf',
616
623
  DWG => 'image/vnd.dwg',
624
+ DXF => 'application/dxf',
617
625
  EIP => 'application/x-captureone', #(NC)
618
626
  EPS => 'application/postscript',
619
627
  ERF => 'image/x-epson-erf',
@@ -649,13 +657,16 @@ my %fileDescription = (
649
657
  JP2 => 'image/jp2',
650
658
  JPEG => 'image/jpeg',
651
659
  JPM => 'image/jpm',
660
+ JPS => 'image/x-jps',
652
661
  JPX => 'image/jpx',
653
662
  JSON => 'application/json',
663
+ JXL => 'image/jxl', #PH (NC)
654
664
  JXR => 'image/jxr',
655
665
  K25 => 'image/x-kodak-k25',
656
666
  KDC => 'image/x-kodak-kdc',
657
667
  KEY => 'application/x-iwork-keynote-sffkey',
658
668
  LFP => 'image/x-lytro-lfp', #PH (NC)
669
+ LIF => 'image/x-lif',
659
670
  LNK => 'application/octet-stream',
660
671
  LRI => 'image/x-light-lri',
661
672
  M2T => 'video/mpeg',
@@ -676,6 +687,7 @@ my %fileDescription = (
676
687
  MP4 => 'video/mp4',
677
688
  MPC => 'audio/x-musepack',
678
689
  MPEG => 'video/mpeg',
690
+ MRC => 'image/x-mrc',
679
691
  MRW => 'image/x-minolta-mrw',
680
692
  MXF => 'application/mxf',
681
693
  NEF => 'image/x-nikon-nef',
@@ -710,16 +722,16 @@ my %fileDescription = (
710
722
  PMP => 'image/x-sony-pmp', #PH (NC)
711
723
  PNG => 'image/png',
712
724
  POT => 'application/vnd.ms-powerpoint',
713
- POTM => 'application/vnd.ms-powerpoint.template.macroEnabled',
725
+ POTM => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
714
726
  POTX => 'application/vnd.openxmlformats-officedocument.presentationml.template',
715
- PPAM => 'application/vnd.ms-powerpoint.addin.macroEnabled',
727
+ PPAM => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
716
728
  PPAX => 'application/vnd.openxmlformats-officedocument.presentationml.addin', # (NC, PH invented)
717
729
  PPM => 'image/x-portable-pixmap',
718
730
  PPS => 'application/vnd.ms-powerpoint',
719
- PPSM => 'application/vnd.ms-powerpoint.slideshow.macroEnabled',
731
+ PPSM => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
720
732
  PPSX => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
721
733
  PPT => 'application/vnd.ms-powerpoint',
722
- PPTM => 'application/vnd.ms-powerpoint.presentation.macroEnabled',
734
+ PPTM => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
723
735
  PPTX => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
724
736
  PS => 'application/postscript',
725
737
  PSD => 'application/vnd.adobe.photoshop',
@@ -766,13 +778,13 @@ my %fileDescription = (
766
778
  X3F => 'image/x-sigma-x3f',
767
779
  XCF => 'image/x-xcf',
768
780
  XLA => 'application/vnd.ms-excel',
769
- XLAM => 'application/vnd.ms-excel.addin.macroEnabled',
781
+ XLAM => 'application/vnd.ms-excel.addin.macroEnabled.12',
770
782
  XLS => 'application/vnd.ms-excel',
771
- XLSB => 'application/vnd.ms-excel.sheet.binary.macroEnabled',
772
- 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',
773
785
  XLSX => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
774
786
  XLT => 'application/vnd.ms-excel',
775
- XLTM => 'application/vnd.ms-excel.template.macroEnabled',
787
+ XLTM => 'application/vnd.ms-excel.template.macroEnabled.12',
776
788
  XLTX => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
777
789
  XML => 'application/xml',
778
790
  XMP => 'application/rdf+xml',
@@ -796,10 +808,12 @@ my %moduleName = (
796
808
  DEX => 0,
797
809
  DOCX => 'OOXML',
798
810
  DCX => 0,
811
+ DIR => 0,
799
812
  DR4 => 'CanonVRD',
800
813
  DSS => 'Olympus',
801
814
  DWF => 0,
802
815
  DWG => 0,
816
+ DXF => 0,
803
817
  EPS => 'PostScript',
804
818
  EXIF => '',
805
819
  EXR => 'OpenEXR',
@@ -813,6 +827,7 @@ my %moduleName = (
813
827
  HDR => 'Radiance',
814
828
  JP2 => 'Jpeg2000',
815
829
  JPEG => '',
830
+ JXL => 'Jpeg2000',
816
831
  LFP => 'Lytro',
817
832
  LRI => 0,
818
833
  MOV => 'QuickTime',
@@ -823,6 +838,7 @@ my %moduleName = (
823
838
  ORF => 'Olympus',
824
839
  PDB => 'Palm',
825
840
  PCD => 'PhotoCD',
841
+ PFM2 => 'Other',
826
842
  PHP => 0,
827
843
  PMP => 'Sony',
828
844
  PS => 'PostScript',
@@ -874,6 +890,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
874
890
  DV => '\x1f\x07\0[\x3f\xbf]', # (not tested if extension recognized)
875
891
  DWF => '\(DWF V\d',
876
892
  DWG => 'AC10\d{2}\0',
893
+ DXF => '\s*0\s+\0?\s*SECTION\s+2\s+HEADER',
877
894
  EPS => '(%!PS|%!Ad|\xc5\xd0\xd3\xc6)',
878
895
  EXE => '(MZ|\xca\xfe\xba\xbe|\xfe\xed\xfa[\xce\xcf]|[\xce\xcf]\xfa\xed\xfe|Joy!peff|\x7fELF|#!\s*/\S*bin/|!<arch>\x0a)',
879
896
  EXIF => '(II\x2a\0|MM\0\x2a)',
@@ -892,14 +909,16 @@ $testLen = 1024; # number of bytes to read when testing for magic number
892
909
  GZIP => '\x1f\x8b\x08',
893
910
  HDR => '#\?(RADIANCE|RGBE)\x0a',
894
911
  HTML => '(\xef\xbb\xbf)?\s*(?i)<(!DOCTYPE\s+HTML|HTML|\?xml)', # (case insensitive)
895
- 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}',
896
913
  IND => '\x06\x06\xed\xf5\xd8\x1d\x46\xe5\xbd\x31\xef\xe7\xfe\x74\xb7\x1d',
897
914
  # ISO => signature is at byte 32768
898
915
  ITC => '.{4}itch',
899
916
  JP2 => '(\0\0\0\x0cjP( |\x1a\x1a)\x0d\x0a\x87\x0a|\xff\x4f\xff\x51\0)',
900
917
  JPEG => '\xff\xd8\xff',
901
918
  JSON => '(\xef\xbb\xbf)?\s*(\[\s*)?\{\s*"[^"]*"\s*:',
919
+ JXL => '\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl ',
902
920
  LFP => '\x89LFP\x0d\x0a\x1a\x0a',
921
+ LIF => '\x70\0{3}.{4}\x2a.{4}<\0',
903
922
  LNK => '.{4}\x01\x14\x02\0{5}\xc0\0{6}\x46',
904
923
  LRI => 'LELR \0',
905
924
  M2TS => '(....)?\x47',
@@ -911,14 +930,16 @@ $testLen = 1024; # number of bytes to read when testing for magic number
911
930
  MPC => '(MP\+|ID3)',
912
931
  MOI => 'V6',
913
932
  MPEG => '\0\0\x01[\xb0-\xbf]',
933
+ MRC => '.{64}[\x01\x02\x03]\0\0\0[\x01\x02\x03]\0\0\0[\x01\x02\x03]\0\0\0.{132}MAP[\0 ](\x44\x44|\x44\x41|\x11\x11)\0\0',
914
934
  MRW => '\0MR[MI]',
915
935
  MXF => '\x06\x0e\x2b\x34\x02\x05\x01\x01\x0d\x01\x02', # (not tested if extension recognized)
916
936
  OGG => '(OggS|ID3)',
917
937
  ORF => '(II|MM)',
918
- 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)',
919
938
  # PCD => signature is at byte 2048
920
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)',
921
941
  PDF => '\s*%PDF-\d+\.\d+',
942
+ PFM => 'P[Ff]\x0a\d+ \d+\x0a[-+0-9.]+\x0a',
922
943
  PGF => 'PGF',
923
944
  PHP => '<\?php\s',
924
945
  PICT => '(.{10}|.{522})(\x11\x01|\x00\x11)',
@@ -1135,14 +1156,14 @@ my %systemTagsNotes = (
1135
1156
  Groups => { 1 => 'System', 2 => 'Other' },
1136
1157
  Notes => q{
1137
1158
  file name without extension. Not generated unless specifically requested or
1138
- the L<RequestAll|../ExifTool.html#RequestAll> API option is set
1159
+ the API L<RequestAll|../ExifTool.html#RequestAll> option is set
1139
1160
  },
1140
1161
  },
1141
1162
  FilePath => {
1142
1163
  Groups => { 1 => 'System', 2 => 'Other' },
1143
1164
  Notes => q{
1144
1165
  absolute path of source file. Not generated unless specifically requested or
1145
- 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
1146
1167
  names
1147
1168
  },
1148
1169
  },
@@ -1165,7 +1186,7 @@ my %systemTagsNotes = (
1165
1186
  sequence number for each source file when extracting or copying information,
1166
1187
  including files that fail the -if condition of the command-line application,
1167
1188
  beginning at 0 for the first file. Not generated unless specifically
1168
- 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
1169
1190
  },
1170
1191
  },
1171
1192
  FileSize => {
@@ -1187,6 +1208,18 @@ my %systemTagsNotes = (
1187
1208
  },
1188
1209
  PrintConv => \&ConvertFileSize,
1189
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
+ },
1190
1223
  FileType => {
1191
1224
  Groups => { 2 => 'Other' },
1192
1225
  Notes => q{
@@ -1238,7 +1271,7 @@ my %systemTagsNotes = (
1238
1271
  the filesystem creation date/time. Windows/Mac only. In Windows, the file
1239
1272
  creation date/time is preserved by default when writing if Win32API::File
1240
1273
  and Win32::API are available. On Mac, this tag is extracted only if it or
1241
- 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
1242
1275
  set to 2 or higher. Requires "setfile" for writing on Mac, which may be
1243
1276
  installed by typing C<xcode-select --install> in the Terminal
1244
1277
  },
@@ -1629,7 +1662,7 @@ my %systemTagsNotes = (
1629
1662
  sub-sampling values to generate the value of this tag. The result is
1630
1663
  compared to known values in an attempt to deduce the originating software
1631
1664
  based only on the JPEG image data. For performance reasons, this tag is
1632
- 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
1633
1666
  to 3 or higher
1634
1667
  },
1635
1668
  },
@@ -1637,14 +1670,14 @@ my %systemTagsNotes = (
1637
1670
  Notes => q{
1638
1671
  an estimate of the IJG JPEG quality setting for the image, calculated from
1639
1672
  the quantization tables. For performance reasons, this tag is generated
1640
- 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
1641
1674
  higher
1642
1675
  },
1643
1676
  },
1644
1677
  JPEGImageLength => {
1645
1678
  Notes => q{
1646
1679
  byte length of JPEG image without metadata. For performance reasons, this
1647
- 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
1648
1681
  is set to 3 or higher
1649
1682
  },
1650
1683
  },
@@ -1654,7 +1687,7 @@ my %systemTagsNotes = (
1654
1687
  Notes => q{
1655
1688
  the current date/time. Useful when setting the tag values, eg.
1656
1689
  C<"-modifydate<now">. Not generated unless specifically requested or the
1657
- L<RequestAll|../ExifTool.html#RequestAll> API option is set
1690
+ API L<RequestAll|../ExifTool.html#RequestAll> option is set
1658
1691
  },
1659
1692
  PrintConv => '$self->ConvertDateTime($val)',
1660
1693
  },
@@ -1665,7 +1698,7 @@ my %systemTagsNotes = (
1665
1698
  YYYYmmdd-HHMM-SSNN-PPPP-RRRRRRRRRRRR, where Y=year, m=month, d=day, H=hour,
1666
1699
  M=minute, S=second, N=file sequence number in hex, P=process ID in hex, and
1667
1700
  R=random hex number; without dashes with the -n option. Not generated
1668
- 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
1669
1702
  },
1670
1703
  PrintConv => '$val =~ s/(.{8})(.{4})(.{4})(.{4})/$1-$2-$3-$4-/; $val',
1671
1704
  },
@@ -1756,7 +1789,10 @@ my %systemTagsNotes = (
1756
1789
  EmbeddedVideo => { Groups => { 0 => 'Trailer', 2 => 'Video' } },
1757
1790
  Trailer => {
1758
1791
  Groups => { 0 => 'Trailer' },
1759
- Notes => 'the full JPEG trailer data block. Extracted only if specifically requested',
1792
+ Notes => q{
1793
+ the full JPEG trailer data block. Extracted only if specifically requested
1794
+ or the API RequestAll option is set to 3 or higher
1795
+ },
1760
1796
  Writable => 1,
1761
1797
  Protected => 1,
1762
1798
  },
@@ -1917,6 +1953,8 @@ my %systemTagsNotes = (
1917
1953
  return \$img;
1918
1954
  },
1919
1955
  },
1956
+ # Apple may add "AMPF" to the end of the JFIF record,
1957
+ # possibly indicating the existence of MPF images (ref forum12677)
1920
1958
  );
1921
1959
 
1922
1960
  # Composite tags (accumulation of all Composite tag tables)
@@ -2069,12 +2107,15 @@ sub Options($$;@)
2069
2107
  $$options{$param} = $newVal;
2070
2108
  delete $$self{CUR_LANG};
2071
2109
  # make sure the language is available
2072
- } elsif (eval "require Image::ExifTool::Lang::$newVal") {
2073
- my $xlat = "Image::ExifTool::Lang::${newVal}::Translate";
2074
- no strict 'refs';
2075
- if (%$xlat) {
2076
- $$self{CUR_LANG} = \%$xlat;
2077
- $$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
+ }
2078
2119
  }
2079
2120
  } # else don't change Lang
2080
2121
  } elsif ($param eq 'Exclude' and defined $newVal) {
@@ -2291,6 +2332,7 @@ sub ClearOptions($)
2291
2332
  Password => undef, # password for password-protected PDF documents
2292
2333
  PrintConv => 1, # flag to enable print conversion
2293
2334
  QuickTimeHandler => 1, # flag to add mdir Handler to newly created Meta box
2335
+ QuickTimePad=> undef, # flag to preserve padding of QuickTime CR3 tags
2294
2336
  QuickTimeUTC=> undef, # assume that QuickTime date/time tags are stored as UTC
2295
2337
  RequestAll => undef, # extract all tags that must be specifically requested
2296
2338
  RequestTags => undef, # extra tags to request (on top of those in the tag list)
@@ -2340,7 +2382,7 @@ sub ExtractInfo($;@)
2340
2382
  my $fast = $$options{FastScan} || 0;
2341
2383
  my $req = $$self{REQ_TAG_LOOKUP};
2342
2384
  my $reqAll = $$options{RequestAll} || 0;
2343
- my (%saveOptions, $reEntry, $rsize, $type, @startTime, $saveOrder, $isDir);
2385
+ my (%saveOptions, $reEntry, $rsize, $zid, $type, @startTime, $saveOrder, $isDir);
2344
2386
 
2345
2387
  # check for internal ReEntry option to allow recursive calls to ExtractInfo
2346
2388
  if (ref $_[1] eq 'HASH' and $_[1]{ReEntry} and
@@ -2432,6 +2474,17 @@ sub ExtractInfo($;@)
2432
2474
  }
2433
2475
  # get size of resource fork on Mac OS
2434
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
+ }
2435
2488
  }
2436
2489
  # open the file
2437
2490
  if ($self->Open(\*EXIFTOOL_FILE, $filename)) {
@@ -2474,6 +2527,7 @@ sub ExtractInfo($;@)
2474
2527
  my $fileSize = $stat[7];
2475
2528
  $self->FoundTag('FileSize', $stat[7]) if defined $stat[7];
2476
2529
  $self->FoundTag('ResourceForkSize', $rsize) if $rsize;
2530
+ $self->FoundTag('ZoneIdentifier', 'Exists') if $zid;
2477
2531
  $self->FoundTag('FileModifyDate', $stat[9]) if defined $stat[9];
2478
2532
  $self->FoundTag('FileAccessDate', $stat[8]) if defined $stat[8];
2479
2533
  my $cTag = $^O eq 'MSWin32' ? 'FileCreateDate' : 'FileInodeChangeDate';
@@ -3289,8 +3343,9 @@ sub GetTagID($$)
3289
3343
  my ($self, $tag) = @_;
3290
3344
  my $tagInfo = $$self{TAG_INFO}{$tag};
3291
3345
  return '' unless $tagInfo and defined $$tagInfo{TagID};
3292
- return ($$tagInfo{TagID}, $$tagInfo{LangCode}) if wantarray;
3293
- return $$tagInfo{TagID};
3346
+ my $id = $$tagInfo{KeysID} || $$tagInfo{TagID};
3347
+ return ($id, $$tagInfo{LangCode}) if wantarray;
3348
+ return $id;
3294
3349
  }
3295
3350
 
3296
3351
  #------------------------------------------------------------------------------
@@ -3406,7 +3461,7 @@ sub GetGroup($$;$)
3406
3461
  }
3407
3462
  # generate tag ID group names unless obviously not needed
3408
3463
  unless ($noID) {
3409
- my $id = $$tagInfo{TagID};
3464
+ my $id = $$tagInfo{KeysID} || $$tagInfo{TagID};
3410
3465
  if (not defined $id) {
3411
3466
  $id = ''; # (just to be safe)
3412
3467
  } elsif ($id =~ /^\d+$/) {
@@ -3761,7 +3816,15 @@ sub GetFileType(;$$)
3761
3816
  # return description if specified
3762
3817
  # (allow input $file to be a FileType for this purpose)
3763
3818
  if ($desc) {
3764
- $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
+ }
3765
3828
  $desc .= ", $subType" if $subType;
3766
3829
  return $desc;
3767
3830
  } elsif ($fileType and (not defined $desc or $desc ne '0')) {
@@ -3826,6 +3889,7 @@ sub Init($)
3826
3889
  foreach (keys %$self) {
3827
3890
  /[a-z]/ and delete $$self{$_};
3828
3891
  }
3892
+ undef %static_vars; # clear all static variables
3829
3893
  delete $$self{FOUND_TAGS}; # list of found tags
3830
3894
  delete $$self{EXIF_DATA}; # the EXIF data block
3831
3895
  delete $$self{EXIF_POS}; # EXIF position in file
@@ -4083,7 +4147,9 @@ sub Exists($$)
4083
4147
  return 0 unless $wh;
4084
4148
  eval { Win32API::File::CloseHandle($wh) };
4085
4149
  } else {
4086
- 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);
4087
4153
  }
4088
4154
  return 1;
4089
4155
  }
@@ -6120,9 +6186,10 @@ sub ProcessJPEG($$)
6120
6186
  my $out = $$options{TextOut};
6121
6187
  my $fast = $$options{FastScan} || 0;
6122
6188
  my $raf = $$dirInfo{RAF};
6189
+ my $req = $$self{REQ_TAG_LOOKUP};
6123
6190
  my $htmlDump = $$self{HTML_DUMP};
6124
6191
  my %dumpParms = ( Out => $out );
6125
- my ($success, $wantTrailer, $trailInfo, $foundSOS);
6192
+ my ($success, $wantTrailer, $trailInfo, $foundSOS, %jumbfChunk);
6126
6193
  my (@iccChunk, $iccChunkCount, $iccChunksTotal, @flirChunk, $flirCount, $flirTotal);
6127
6194
  my ($preview, $scalado, @dqt, $subSampling, $dumpEnd, %extendedXMP);
6128
6195
 
@@ -6133,7 +6200,7 @@ sub ProcessJPEG($$)
6133
6200
  $$self{FILE_TYPE} = 'EXV';
6134
6201
  }
6135
6202
  my $appBytes = 0;
6136
- my $calcImageLen = $$self{REQ_TAG_LOOKUP}{jpegimagelength};
6203
+ my $calcImageLen = $$req{jpegimagelength};
6137
6204
  if ($$options{RequestAll} and $$options{RequestAll} > 2) {
6138
6205
  $calcImageLen = 1;
6139
6206
  }
@@ -6166,6 +6233,7 @@ sub ProcessJPEG($$)
6166
6233
  my $marker = $nextMarker;
6167
6234
  my $segDataPt = $nextSegDataPt;
6168
6235
  my $segPos = $nextSegPos;
6236
+ my $skipped;
6169
6237
  undef $nextMarker;
6170
6238
  undef $nextSegDataPt;
6171
6239
  #
@@ -6175,11 +6243,13 @@ sub ProcessJPEG($$)
6175
6243
  # read up to next marker (JPEG markers begin with 0xff)
6176
6244
  my $buff;
6177
6245
  $raf->ReadLine($buff) or last;
6246
+ $skipped = length($buff) - 1;
6178
6247
  # JPEG markers can be padded with unlimited 0xff's
6179
6248
  for (;;) {
6180
6249
  $raf->Read($ch, 1) or last Marker;
6181
6250
  $nextMarker = ord($ch);
6182
6251
  last unless $nextMarker == 0xff;
6252
+ ++$skipped;
6183
6253
  }
6184
6254
  # read segment data if it exists
6185
6255
  if (not defined $markerLenBytes{$nextMarker}) {
@@ -6206,6 +6276,14 @@ sub ProcessJPEG($$)
6206
6276
  # set some useful variables for the current segment
6207
6277
  my $markerName = JpegMarkerName($marker);
6208
6278
  $$path[$pn] = $markerName;
6279
+ # issue warning if we skipped some garbage
6280
+ if ($skipped and not $foundSOS) {
6281
+ $self->Warn("Skipped unknown $skipped bytes after JPEG $markerName segment", 1);
6282
+ if ($htmlDump) {
6283
+ $self->HDump($nextSegPos-4-$skipped, $skipped, "[unknown $skipped bytes]", undef, 0x08);
6284
+ $dumpEnd = $nextSegPos - 4;
6285
+ }
6286
+ }
6209
6287
  #
6210
6288
  # parse the current segment
6211
6289
  #
@@ -6267,7 +6345,7 @@ sub ProcessJPEG($$)
6267
6345
  } else {
6268
6346
  $self->Warn('Missing JPEG SOS');
6269
6347
  }
6270
- if ($$self{REQ_TAG_LOOKUP}{trailer}) {
6348
+ if ($$req{trailer}) {
6271
6349
  # read entire trailer into memory
6272
6350
  if ($raf->Seek(0,2)) {
6273
6351
  my $len = $raf->Tell() - $pos;
@@ -6401,7 +6479,7 @@ sub ProcessJPEG($$)
6401
6479
  next if $trailInfo or $wantTrailer or $verbose > 2 or $htmlDump;
6402
6480
  }
6403
6481
  # must scan to EOI if Validate or JpegCompressionFactor used
6404
- next if $$options{Validate} or $calcImageLen or $$self{REQ_TAG_LOOKUP}{trailer};
6482
+ next if $$options{Validate} or $calcImageLen or $$req{trailer};
6405
6483
  # nothing interesting to parse after start of scan (SOS)
6406
6484
  $success = 1;
6407
6485
  last; # all done parsing file
@@ -6417,11 +6495,11 @@ sub ProcessJPEG($$)
6417
6495
  next;
6418
6496
  } elsif ($marker == 0xdb and length($$segDataPt) and # DQT
6419
6497
  # save the DQT data only if JPEGDigest has been requested
6420
- # (Note: since we aren't checking the RequestAll API option here, the application
6498
+ # (Note: since we aren't checking the API RequestAll option here, the application
6421
6499
  # must use the RequestTags option to generate these tags if they have not been
6422
6500
  # specifically requested. The reason is that there is too much overhead involved
6423
6501
  # in the calculation of this tag to make this worth the CPU time.)
6424
- ($$self{REQ_TAG_LOOKUP}{jpegdigest} or $$self{REQ_TAG_LOOKUP}{jpegqualityestimate}
6502
+ ($$req{jpegdigest} or $$req{jpegqualityestimate}
6425
6503
  or ($$options{RequestAll} and $$options{RequestAll} > 2)))
6426
6504
  {
6427
6505
  my $num = unpack('C',$$segDataPt) & 0x0f; # get table index
@@ -6539,7 +6617,7 @@ sub ProcessJPEG($$)
6539
6617
  }
6540
6618
  if ($start and $plen and IsInt($start) and IsInt($plen) and
6541
6619
  $start + $plen > $$self{EXIF_POS} + length($$self{EXIF_DATA}) and
6542
- ($$self{REQ_TAG_LOOKUP}{previewimage} or
6620
+ ($$req{previewimage} or
6543
6621
  # (extracted normally, so check Binary option)
6544
6622
  ($$options{Binary} and not $$self{EXCL_TAG_LOOKUP}{previewimage})))
6545
6623
  {
@@ -6745,6 +6823,12 @@ sub ProcessJPEG($$)
6745
6823
  # extract the Stim information (it is in standard TIFF format)
6746
6824
  my $tagTablePtr = GetTagTable('Image::ExifTool::Stim::Main');
6747
6825
  $self->ProcessTIFF(\%dirInfo, $tagTablePtr);
6826
+ } elsif ($$segDataPt =~ /^_JPSJPS_/) {
6827
+ $dumpType = 'JPS';
6828
+ $self->OverrideFileType('JPS') if $$self{FILE_TYPE} eq 'JPEG';
6829
+ SetByteOrder('MM');
6830
+ my $tagTablePtr = GetTagTable('Image::ExifTool::JPEG::JPS');
6831
+ $self->ProcessDirectory(\%dirInfo, $tagTablePtr);
6748
6832
  } elsif ($$self{Make} eq 'DJI') {
6749
6833
  $dumpType = 'DJI ThermalData';
6750
6834
  # add this data to the combined data if it exists
@@ -6934,7 +7018,7 @@ sub ProcessJPEG($$)
6934
7018
  # (with number of elements N = ImageHeight / 16 - 1, ref PH/NealKrawetz)
6935
7019
  $xtra = 'segment (N=' . unpack('x6N', $$segDataPt) . ')';
6936
7020
  }
6937
- } elsif ($marker == 0xeb) { # APP11 (JPEG-HDR)
7021
+ } elsif ($marker == 0xeb) { # APP11 (JPEG-HDR, JUMBF)
6938
7022
  if ($$segDataPt =~ /^HDR_RI /) {
6939
7023
  $dumpType = 'JPEG-HDR';
6940
7024
  my $dataPt = $segDataPt;
@@ -6954,6 +7038,47 @@ sub ProcessJPEG($$)
6954
7038
  $self->ProcessDirectory(\%dirInfo, $tagTablePtr);
6955
7039
  undef $combinedSegData;
6956
7040
  }
7041
+ } elsif ($$segDataPt =~ /^(JP..)/s and length($$segDataPt) >= 16) {
7042
+ # JUMBF extension marker
7043
+ my $hdr = $1;
7044
+ $dumpType = 'JUMBF';
7045
+ SetByteOrder('MM');
7046
+ my $seq = Get32u($segDataPt, 4) - 1; # (start from 0)
7047
+ my $len = Get32u($segDataPt, 8);
7048
+ my $type = substr($$segDataPt, 12, 4);
7049
+ my $hdrLen;
7050
+ if ($len == 1 and length($$segDataPt) >= 24) {
7051
+ $len = Get64u($$segDataPt, 16);
7052
+ $hdrLen = 16;
7053
+ } else {
7054
+ $hdrLen = 8;
7055
+ }
7056
+ $jumbfChunk{$type} or $jumbfChunk{$type} = [ ];
7057
+ if ($len < $hdrLen) {
7058
+ $self->Warn('Invalid JUMBF segment');
7059
+ } elsif ($seq < 0) {
7060
+ $self->Warn('Invalid JUMBF sequence number');
7061
+ } elsif (defined $jumbfChunk{$type}[$seq]) {
7062
+ $self->Warn('Duplicate JUMBF sequence number');
7063
+ } else {
7064
+ # add to list of JUMBF chunks
7065
+ $jumbfChunk{$type}[$seq] = substr($$segDataPt, 8 + $hdrLen);
7066
+ # check to see if we have a complete JUMBF box
7067
+ my $size = $hdrLen;
7068
+ foreach (@{$jumbfChunk{$type}}) {
7069
+ defined $_ or $size = 0, last;
7070
+ $size += length $_;
7071
+ }
7072
+ if ($size == $len) {
7073
+ my $buff = join '', substr($$segDataPt,8,$hdrLen), @{$jumbfChunk{$type}};
7074
+ $dirInfo{DataPt} = \$buff;
7075
+ $dirInfo{DataPos} = $segPos + 8; # (shows correct offsets for single-segment JUMBF)
7076
+ $dirInfo{DataLen} = $dirInfo{DirLen} = $size;
7077
+ my $tagTablePtr = GetTagTable('Image::ExifTool::Jpeg2000::Main');
7078
+ $self->ProcessDirectory(\%dirInfo, $tagTablePtr);
7079
+ delete $jumbfChunk{$type};
7080
+ }
7081
+ }
6957
7082
  }
6958
7083
  } elsif ($marker == 0xec) { # APP12 (Ducky, Picture Info)
6959
7084
  if ($$segDataPt =~ /^Ducky/) {
@@ -7005,7 +7130,7 @@ sub ProcessJPEG($$)
7005
7130
  } elsif ($marker == 0xee) { # APP14 (Adobe)
7006
7131
  if ($$segDataPt =~ /^Adobe/) {
7007
7132
  # extract as a block if requested, or if copying tags from file
7008
- if ($$self{REQ_TAG_LOOKUP}{adobe} or
7133
+ if ($$req{adobe} or
7009
7134
  # (not extracted normally, so check TAGS_FROM_FILE)
7010
7135
  ($$self{TAGS_FROM_FILE} and not $$self{EXCL_TAG_LOOKUP}{adobe}))
7011
7136
  {
@@ -7108,6 +7233,7 @@ sub ProcessJPEG($$)
7108
7233
  Image::ExifTool::JPEGDigest::Calculate($self, \@dqt, $subSampling);
7109
7234
  }
7110
7235
  # issue necessary warnings
7236
+ $self->Warn('Invalid JUMBF size or missing JUMBF chunk') if %jumbfChunk;
7111
7237
  $self->Warn('Incomplete ICC_Profile record', 1) if defined $iccChunkCount;
7112
7238
  $self->Warn('Incomplete FLIR record', 1) if defined $flirCount;
7113
7239
  $self->Warn('Error reading PreviewImage', 1) if $$self{PreviewError};
@@ -7776,7 +7902,8 @@ sub GetTagInfo($$$;$$$)
7776
7902
  }
7777
7903
  }
7778
7904
  if ($$tagInfo{Unknown} and not $$self{OPTIONS}{Unknown} and
7779
- not $$self{OPTIONS}{Verbose} and not $$self{HTML_DUMP})
7905
+ not $$self{OPTIONS}{Verbose} and not $$self{OPTIONS}{Validate} and
7906
+ not $$self{HTML_DUMP})
7780
7907
  {
7781
7908
  # don't return Unknown tags unless that option is set
7782
7909
  return undef;