exiftool_vendored 12.25.0 → 12.32.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +114 -4
  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 +72 -56
  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 +10 -2
  14. data/bin/lib/Image/ExifTool/CBOR.pm +277 -0
  15. data/bin/lib/Image/ExifTool/Canon.pm +25 -18
  16. data/bin/lib/Image/ExifTool/DPX.pm +13 -2
  17. data/bin/lib/Image/ExifTool/Exif.pm +11 -6
  18. data/bin/lib/Image/ExifTool/FlashPix.pm +35 -10
  19. data/bin/lib/Image/ExifTool/FujiFilm.pm +1 -0
  20. data/bin/lib/Image/ExifTool/Geotag.pm +13 -2
  21. data/bin/lib/Image/ExifTool/GoPro.pm +16 -1
  22. data/bin/lib/Image/ExifTool/ID3.pm +15 -3
  23. data/bin/lib/Image/ExifTool/JPEG.pm +68 -2
  24. data/bin/lib/Image/ExifTool/JSON.pm +4 -2
  25. data/bin/lib/Image/ExifTool/Jpeg2000.pm +58 -26
  26. data/bin/lib/Image/ExifTool/LIF.pm +153 -0
  27. data/bin/lib/Image/ExifTool/Lang/nl.pm +60 -59
  28. data/bin/lib/Image/ExifTool/M2TS.pm +103 -7
  29. data/bin/lib/Image/ExifTool/MIE.pm +2 -1
  30. data/bin/lib/Image/ExifTool/MRC.pm +1 -1
  31. data/bin/lib/Image/ExifTool/Nikon.pm +15 -4
  32. data/bin/lib/Image/ExifTool/NikonSettings.pm +10 -2
  33. data/bin/lib/Image/ExifTool/Olympus.pm +5 -2
  34. data/bin/lib/Image/ExifTool/Other.pm +93 -0
  35. data/bin/lib/Image/ExifTool/PDF.pm +9 -12
  36. data/bin/lib/Image/ExifTool/PNG.pm +7 -6
  37. data/bin/lib/Image/ExifTool/Panasonic.pm +14 -2
  38. data/bin/lib/Image/ExifTool/Pentax.pm +28 -5
  39. data/bin/lib/Image/ExifTool/Photoshop.pm +6 -0
  40. data/bin/lib/Image/ExifTool/QuickTime.pm +103 -24
  41. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +203 -121
  42. data/bin/lib/Image/ExifTool/README +3 -0
  43. data/bin/lib/Image/ExifTool/RIFF.pm +7 -2
  44. data/bin/lib/Image/ExifTool/Samsung.pm +47 -10
  45. data/bin/lib/Image/ExifTool/Sony.pm +84 -33
  46. data/bin/lib/Image/ExifTool/TagLookup.pm +50 -3
  47. data/bin/lib/Image/ExifTool/TagNames.pod +135 -29
  48. data/bin/lib/Image/ExifTool/Torrent.pm +18 -11
  49. data/bin/lib/Image/ExifTool/WriteIPTC.pl +1 -1
  50. data/bin/lib/Image/ExifTool/WritePDF.pl +1 -0
  51. data/bin/lib/Image/ExifTool/WritePNG.pl +2 -0
  52. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +11 -4
  53. data/bin/lib/Image/ExifTool/WriteXMP.pl +1 -1
  54. data/bin/lib/Image/ExifTool/Writer.pl +3 -0
  55. data/bin/lib/Image/ExifTool/XMP.pm +17 -5
  56. data/bin/lib/Image/ExifTool/XMP2.pl +2 -1
  57. data/bin/lib/Image/ExifTool/XMPStruct.pl +3 -1
  58. data/bin/lib/Image/ExifTool/ZISRAW.pm +121 -2
  59. data/bin/lib/Image/ExifTool.pm +79 -37
  60. data/bin/lib/Image/ExifTool.pod +62 -60
  61. data/bin/perl-Image-ExifTool.spec +43 -42
  62. data/lib/exiftool_vendored/version.rb +1 -1
  63. metadata +6 -3
@@ -50,7 +50,7 @@ use Image::ExifTool::Exif;
50
50
  use Image::ExifTool::GPS;
51
51
  require Exporter;
52
52
 
53
- $VERSION = '3.41';
53
+ $VERSION = '3.44';
54
54
  @ISA = qw(Exporter);
55
55
  @EXPORT_OK = qw(EscapeXML UnescapeXML);
56
56
 
@@ -155,7 +155,7 @@ my %xmpNS = (
155
155
  DICOM => 'http://ns.adobe.com/DICOM/',
156
156
  'drone-dji'=> 'http://www.dji.com/drone-dji/1.0/',
157
157
  svg => 'http://www.w3.org/2000/svg',
158
- et => 'http://ns.exiftool.ca/1.0/',
158
+ et => 'http://ns.exiftool.org/1.0/',
159
159
  #
160
160
  # namespaces defined in XMP2.pl:
161
161
  #
@@ -195,7 +195,7 @@ my %xmpNS = (
195
195
  );
196
196
 
197
197
  # build reverse namespace lookup
198
- my %uri2ns = ( 'http://ns.exiftool.org/1.0/' => 'et' ); # (allow exiftool.org as well as exiftool.ca)
198
+ my %uri2ns = ( 'http://ns.exiftool.ca/1.0/' => 'et' ); # (allow exiftool.ca as well as exiftool.org)
199
199
  {
200
200
  my $ns;
201
201
  foreach $ns (keys %nsURI) {
@@ -2017,6 +2017,11 @@ my %sPantryItem = (
2017
2017
  Groups => { 2 => 'Location' },
2018
2018
  Writable => 'integer',
2019
2019
  PrintConv => {
2020
+ OTHER => sub {
2021
+ my ($val, $inv) = @_;
2022
+ return undef unless $inv and $val =~ /^([-+0-9])/;
2023
+ return($1 eq '-' ? 1 : 0);
2024
+ },
2020
2025
  0 => 'Above Sea Level',
2021
2026
  1 => 'Below Sea Level',
2022
2027
  },
@@ -3258,8 +3263,14 @@ NoLoop:
3258
3263
  }
3259
3264
  }
3260
3265
  # generate a default tagInfo hash if necessary
3261
- $tagInfo or $tagInfo = { Name => $name, IsDefault => 1, Priority => 0 };
3262
-
3266
+ unless ($tagInfo) {
3267
+ # shorten tag name if necessary
3268
+ if ($$et{ShortenXmpTags}) {
3269
+ my $shorten = $$et{ShortenXmpTags};
3270
+ $name = &$shorten($name);
3271
+ }
3272
+ $tagInfo = { Name => $name, IsDefault => 1, Priority => 0 };
3273
+ }
3263
3274
  # add tag Namespace entry for tags in variable-namespace tables
3264
3275
  $$tagInfo{Namespace} = $xns if $xns;
3265
3276
  if ($$et{curURI}{$ns} and $$et{curURI}{$ns} =~ m{^http://ns.exiftool.(?:ca|org)/(.*?)/(.*?)/}) {
@@ -3778,6 +3789,7 @@ sub ParseXMPElement($$$;$$$$)
3778
3789
  # (unless we already extracted shorthand values from this element)
3779
3790
  if (length $val or not $shorthand) {
3780
3791
  my $lastProp = $$propList[-1];
3792
+ $lastProp = '' unless defined $lastProp;
3781
3793
  if (defined $nodeID) {
3782
3794
  SaveBlankInfo($blankInfo, $propList, $val);
3783
3795
  } elsif ($lastProp eq 'rdf:type' and $wasEmpty) {
@@ -539,7 +539,8 @@ my %sImageRegion = ( # new in 1.5
539
539
  NOTES => q{
540
540
  This table contains tags defined by the IPTC Extension schema version 1.5.
541
541
  The actual namespace prefix is "Iptc4xmpExt", but ExifTool shortens this for
542
- the family 1 group name. (see L<http://www.iptc.org/IPTC4XMP/>)
542
+ the family 1 group name. (see
543
+ L<http://www.iptc.org/standards/photo-metadata/iptc-standard/>)
543
544
  },
544
545
  AboutCvTerm => {
545
546
  Struct => \%sCVTermDetails,
@@ -32,7 +32,9 @@ sub SerializeStruct($;$)
32
32
  my ($key, $val, @vals, $rtnVal);
33
33
 
34
34
  if (ref $obj eq 'HASH') {
35
- foreach $key (sort keys %$obj) {
35
+ # support hashes with ordered keys
36
+ my @keys = $$obj{_ordered_keys_} ? @{$$obj{_ordered_keys_}} : sort keys %$obj;
37
+ foreach $key (@keys) {
36
38
  push @vals, $key . '=' . SerializeStruct($$obj{$key}, '}');
37
39
  }
38
40
  $rtnVal = '{' . join(',', @vals) . '}';
@@ -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.00';
17
+ $VERSION = '1.01';
18
18
 
19
19
  %Image::ExifTool::ZISRAW::Main = (
20
20
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -41,6 +41,123 @@ $VERSION = '1.00';
41
41
  },
42
42
  );
43
43
 
44
+ #------------------------------------------------------------------------------
45
+ # Shorten obscenely long CZI tag names
46
+ # Inputs: Tag name
47
+ # Returns: Shortened tag name
48
+ sub ShortenTagNames($)
49
+ {
50
+ local $_;
51
+ $_ = shift;
52
+ s/^HardwareSetting//;
53
+ s/^DevicesDevice/Device/;
54
+ s/LightPathNode//g;
55
+ s/Successors//g;
56
+ s/ExperimentExperiment/Experiment/g;
57
+ s/ObjectivesObjective/Objective/;
58
+ s/ChannelsChannel/Channel/;
59
+ s/TubeLensesTubeLens/TubeLens/;
60
+ s/^ExperimentHardwareSettingsPoolHardwareSetting/HardwareSetting/;
61
+ s/SharpnessMeasureSetSharpnessMeasure/Sharpness/;
62
+ s/FocusSetupAutofocusSetup/Autofocus/;
63
+ s/TracksTrack/Track/;
64
+ s/ChannelRefsChannelRef/ChannelRef/;
65
+ s/ChangerChanger/Changer/;
66
+ s/ElementsChangerElement/Changer/;
67
+ s/ChangerElements/Changer/;
68
+ s/ContrastChangerContrast/Contrast/;
69
+ s/KeyFunctionsKeyFunction/KeyFunction/;
70
+ s/ManagerContrastManager(Contrast)?/ManagerContrast/;
71
+ s/ObjectiveChangerObjective/ObjectiveChanger/;
72
+ s/ManagerLightManager/ManagerLight/;
73
+ s/WavelengthAreasWavelengthArea/WavelengthArea/;
74
+ s/ReflectorChangerReflector/ReflectorChanger/;
75
+ s/^StageStageAxesStageAxis/StageAxis/;
76
+ s/ShutterChangerShutter/ShutterChanger/;
77
+ s/OnOffChangerOnOff/OnOffChanger/;
78
+ s/UnsharpMaskStateUnsharpMask/UnsharpMask/;
79
+ s/Acquisition/Acq/;
80
+ s/Continuous/Cont/;
81
+ s/Resolution/Res/;
82
+ s/Experiment/Expt/g;
83
+ s/Threshold/Thresh/;
84
+ s/Reference/Ref/;
85
+ s/Magnification/Mag/;
86
+ s/Original/Orig/;
87
+ s/FocusSetupFocusStrategySetup/Focus/;
88
+ s/ParametersParameter/Parameter/;
89
+ s/IntervalInfo/Interval/;
90
+ s/ExptBlocksAcqBlock/AcqBlock/;
91
+ s/MicroscopesMicroscope/Microscope/;
92
+ s/TimeSeriesInterval/TimeSeries/;
93
+ s/Interval(.*Interval)/$1/;
94
+ s/SingleTileRegionsSingleTileRegion/SingleTileRegion/;
95
+ s/AcquisitionMode//;
96
+ s/DetectorsDetector/Detector/;
97
+ s/Setup//;
98
+ s/Setting//;
99
+ s/TrackTrack/Track/;
100
+ s/AnalogOutMaximumsAnalogOutMaximum/AnalogOutMaximum/;
101
+ s/AnalogOutMinimumsAnalogOutMinimum/AnalogOutMinimum/;
102
+ s/DigitalOutLabelsDigitalOutLabelLabel/DigitalOutLabelLabel/;
103
+ s/(VivaTomeOpticalSectionInformation)+VivaTomeOpticalSectionInformation/VivaTomeOpticalSectionInformation/;
104
+ s/FocusDefiniteFocus/FocusDefinite/;
105
+ s/ChangerChanger/Changer/;
106
+ s/Calibration/Cal/;
107
+ s/LightSwitchChangerRLTLSwitch/LightSwitchChangerRLTL/;
108
+ s/Parameters//;
109
+ s/Fluorescence/Fluor/;
110
+ s/CameraGeometryCameraGeometry/CameraGeometry/;
111
+ s/CameraCamera/Camera/;
112
+ s/DetectorsCamera/Camera/;
113
+ s/FilterChangerLeftChangerEmissionFilter/LeftChangerEmissionFilter/;
114
+ s/SwitchingStatesSwitchingState/SwitchingState/;
115
+ s/Information/Info/;
116
+ s/SubDimensions?//g;
117
+ s/Setups?//;
118
+ s/Parameters?//;
119
+ s/Calculate/Calc/;
120
+ s/Visibility/Vis/;
121
+ s/Orientation/Orient/;
122
+ s/ListItems/Items/;
123
+ s/Increment/Incr/;
124
+ s/Parameter/Param/;
125
+ s/(ParfocalParcentralValues)+ParfocalParcentralValue/Parcentral/;
126
+ s/ParcentralParcentral/Parcentral/;
127
+ s/CorrFocusCorrection/FocusCorr/;
128
+ s/(ApoTomeDepthInfo)+Element/ApoTomeDepth/;
129
+ s/(ApoTomeClickStopInfo)+Element/ApoTomeClickStop/;
130
+ s/DepthDepth/Depth/;
131
+ s/(Devices?)+Device/Device/;
132
+ s/(BeamPathNode)+/BeamPathNode/;
133
+ s/BeamPathsBeamPath/BeamPath/g;
134
+ s/BeamPathBeamPath/BeamPath/g;
135
+ s/Configuration/Config/;
136
+ s/StageAxesStageAxis/StageAxis/;
137
+ s/RangesRange/Range/;
138
+ s/DataGridDatasGridData(Grid)?/DataGrid/;
139
+ s/DataMicroscopeDatasMicroscopeData(Microscope)?/DataMicroscope/;
140
+ s/DataWegaDatasWegaData/DataWega/;
141
+ s/ClickStopPositionsClickStopPosition/ClickStopPosition/;
142
+ s/LightSourcess?LightSource(Settings)?(LightSource)?/LightSource/;
143
+ s/FilterSetsFilterSet/FilterSet/;
144
+ s/EmissionFiltersEmissionFilter/EmissionFilter/;
145
+ s/ExcitationFiltersExcitationFilter/ExcitationFilter/;
146
+ s/FiltersFilter/Filter/;
147
+ s/DichroicsDichroic/Dichronic/;
148
+ s/WavelengthsWavelength/Wavelength/;
149
+ s/MultiTrackSetup/MultiTrack/;
150
+ s/TrackTrack/Track/;
151
+ s/DataGrabberSetup/DataGrabber/;
152
+ s/CameraFrameSetup/CameraFrame/;
153
+ s/TimeSeries(TimeSeries|Setups)/TimeSeries/;
154
+ s/FocusFocus/Focus/;
155
+ s/FocusAutofocus/Autofocus/;
156
+ s/Focus(Hardware|Software)(Autofocus)+/Autofocus$1/;
157
+ s/AutofocusAutofocus/Autofocus/;
158
+ return $_;
159
+ }
160
+
44
161
  #------------------------------------------------------------------------------
45
162
  # Extract metadata from a ZISRAW (CZI) image
46
163
  # Inputs: 0) ExifTool object reference, 1) dirInfo reference
@@ -76,7 +193,9 @@ sub ProcessCZI($$)
76
193
  $tagTablePtr = GetTagTable('Image::ExifTool::XMP::XML');
77
194
  $dirInfo{DirLen} = length $buff;
78
195
  # shorten tag names somewhat by removing 'ImageDocumentMetadata' prefix from all
79
- $$et{XmpIgnoreProps} = [ 'ImageDocument', 'Metadata' ];
196
+ $$et{XmpIgnoreProps} = [ 'ImageDocument', 'Metadata', 'Information' ];
197
+ $$et{ShortenXmpTags} = \&ShortenTagNames;
198
+
80
199
  $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
81
200
 
82
201
  return 1;
@@ -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.25';
32
+ $VERSION = '12.32';
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',
@@ -832,6 +837,7 @@ my %moduleName = (
832
837
  ORF => 'Olympus',
833
838
  PDB => 'Palm',
834
839
  PCD => 'PhotoCD',
840
+ PFM2 => 'Other',
835
841
  PHP => 0,
836
842
  PMP => 'Sony',
837
843
  PS => 'PostScript',
@@ -911,6 +917,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
911
917
  JSON => '(\xef\xbb\xbf)?\s*(\[\s*)?\{\s*"[^"]*"\s*:',
912
918
  JXL => '\xff\x0a|\0\0\0\x0cJXL \x0d\x0a......ftypjxl ',
913
919
  LFP => '\x89LFP\x0d\x0a\x1a\x0a',
920
+ LIF => '\x70\0{3}.{4}\x2a.{4}<\0',
914
921
  LNK => '.{4}\x01\x14\x02\0{5}\xc0\0{6}\x46',
915
922
  LRI => 'LELR \0',
916
923
  M2TS => '(....)?\x47',
@@ -927,10 +934,11 @@ $testLen = 1024; # number of bytes to read when testing for magic number
927
934
  MXF => '\x06\x0e\x2b\x34\x02\x05\x01\x01\x0d\x01\x02', # (not tested if extension recognized)
928
935
  OGG => '(OggS|ID3)',
929
936
  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
937
  # PCD => signature is at byte 2048
932
938
  PCX => '\x0a[\0-\x05]\x01[\x01\x02\x04\x08].{64}[\0-\x02]',
939
+ 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
940
  PDF => '\s*%PDF-\d+\.\d+',
941
+ PFM => 'P[Ff]\x0a\d+ \d+\x0a[-+0-9.]+\x0a',
934
942
  PGF => 'PGF',
935
943
  PHP => '<\?php\s',
936
944
  PICT => '(.{10}|.{522})(\x11\x01|\x00\x11)',
@@ -1932,6 +1940,8 @@ my %systemTagsNotes = (
1932
1940
  return \$img;
1933
1941
  },
1934
1942
  },
1943
+ # Apple may add "AMPF" to the end of the JFIF record,
1944
+ # possibly indicating the existence of MPF images (ref forum12677)
1935
1945
  );
1936
1946
 
1937
1947
  # Composite tags (accumulation of all Composite tag tables)
@@ -2084,12 +2094,15 @@ sub Options($$;@)
2084
2094
  $$options{$param} = $newVal;
2085
2095
  delete $$self{CUR_LANG};
2086
2096
  # 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;
2097
+ } else {
2098
+ my %langs = map { $_ => 1 } @langs;
2099
+ if ($langs{$newVal} and eval "require Image::ExifTool::Lang::$newVal") {
2100
+ my $xlat = "Image::ExifTool::Lang::${newVal}::Translate";
2101
+ no strict 'refs';
2102
+ if (%$xlat) {
2103
+ $$self{CUR_LANG} = \%$xlat;
2104
+ $$options{$param} = $newVal;
2105
+ }
2093
2106
  }
2094
2107
  } # else don't change Lang
2095
2108
  } elsif ($param eq 'Exclude' and defined $newVal) {
@@ -3304,8 +3317,9 @@ sub GetTagID($$)
3304
3317
  my ($self, $tag) = @_;
3305
3318
  my $tagInfo = $$self{TAG_INFO}{$tag};
3306
3319
  return '' unless $tagInfo and defined $$tagInfo{TagID};
3307
- return ($$tagInfo{TagID}, $$tagInfo{LangCode}) if wantarray;
3308
- return $$tagInfo{TagID};
3320
+ my $id = $$tagInfo{KeysID} || $$tagInfo{TagID};
3321
+ return ($id, $$tagInfo{LangCode}) if wantarray;
3322
+ return $id;
3309
3323
  }
3310
3324
 
3311
3325
  #------------------------------------------------------------------------------
@@ -3421,7 +3435,7 @@ sub GetGroup($$;$)
3421
3435
  }
3422
3436
  # generate tag ID group names unless obviously not needed
3423
3437
  unless ($noID) {
3424
- my $id = $$tagInfo{TagID};
3438
+ my $id = $$tagInfo{KeysID} || $$tagInfo{TagID};
3425
3439
  if (not defined $id) {
3426
3440
  $id = ''; # (just to be safe)
3427
3441
  } elsif ($id =~ /^\d+$/) {
@@ -3776,7 +3790,15 @@ sub GetFileType(;$$)
3776
3790
  # return description if specified
3777
3791
  # (allow input $file to be a FileType for this purpose)
3778
3792
  if ($desc) {
3779
- $desc = $fileType ? $$fileType[1] : $fileDescription{$file};
3793
+ if ($fileType) {
3794
+ if ($static_vars{OverrideFileDescription} and $static_vars{OverrideFileDescription}{$fileExt}) {
3795
+ $desc = $static_vars{OverrideFileDescription}{$fileExt};
3796
+ } else {
3797
+ $desc = $$fileType[1];
3798
+ }
3799
+ } else {
3800
+ $desc = $fileDescription{$file};
3801
+ }
3780
3802
  $desc .= ", $subType" if $subType;
3781
3803
  return $desc;
3782
3804
  } elsif ($fileType and (not defined $desc or $desc ne '0')) {
@@ -3841,6 +3863,7 @@ sub Init($)
3841
3863
  foreach (keys %$self) {
3842
3864
  /[a-z]/ and delete $$self{$_};
3843
3865
  }
3866
+ undef %static_vars; # clear all static variables
3844
3867
  delete $$self{FOUND_TAGS}; # list of found tags
3845
3868
  delete $$self{EXIF_DATA}; # the EXIF data block
3846
3869
  delete $$self{EXIF_POS}; # EXIF position in file
@@ -4098,7 +4121,9 @@ sub Exists($$)
4098
4121
  return 0 unless $wh;
4099
4122
  eval { Win32API::File::CloseHandle($wh) };
4100
4123
  } else {
4101
- return -e $file;
4124
+ # (named pipes already exist, but we pretend that they don't
4125
+ # so we will be able to write them, so test with for pipe -p)
4126
+ return(-e $file and not -p $file);
4102
4127
  }
4103
4128
  return 1;
4104
4129
  }
@@ -6182,6 +6207,7 @@ sub ProcessJPEG($$)
6182
6207
  my $marker = $nextMarker;
6183
6208
  my $segDataPt = $nextSegDataPt;
6184
6209
  my $segPos = $nextSegPos;
6210
+ my $skipped;
6185
6211
  undef $nextMarker;
6186
6212
  undef $nextSegDataPt;
6187
6213
  #
@@ -6191,11 +6217,13 @@ sub ProcessJPEG($$)
6191
6217
  # read up to next marker (JPEG markers begin with 0xff)
6192
6218
  my $buff;
6193
6219
  $raf->ReadLine($buff) or last;
6220
+ $skipped = length($buff) - 1;
6194
6221
  # JPEG markers can be padded with unlimited 0xff's
6195
6222
  for (;;) {
6196
6223
  $raf->Read($ch, 1) or last Marker;
6197
6224
  $nextMarker = ord($ch);
6198
6225
  last unless $nextMarker == 0xff;
6226
+ ++$skipped;
6199
6227
  }
6200
6228
  # read segment data if it exists
6201
6229
  if (not defined $markerLenBytes{$nextMarker}) {
@@ -6222,6 +6250,14 @@ sub ProcessJPEG($$)
6222
6250
  # set some useful variables for the current segment
6223
6251
  my $markerName = JpegMarkerName($marker);
6224
6252
  $$path[$pn] = $markerName;
6253
+ # issue warning if we skipped some garbage
6254
+ if ($skipped and not $foundSOS) {
6255
+ $self->Warn("Skipped unknown $skipped bytes after JPEG $markerName segment", 1);
6256
+ if ($htmlDump) {
6257
+ $self->HDump($nextSegPos-4-$skipped, $skipped, "[unknown $skipped bytes]", undef, 0x08);
6258
+ $dumpEnd = $nextSegPos - 4;
6259
+ }
6260
+ }
6225
6261
  #
6226
6262
  # parse the current segment
6227
6263
  #
@@ -6761,6 +6797,12 @@ sub ProcessJPEG($$)
6761
6797
  # extract the Stim information (it is in standard TIFF format)
6762
6798
  my $tagTablePtr = GetTagTable('Image::ExifTool::Stim::Main');
6763
6799
  $self->ProcessTIFF(\%dirInfo, $tagTablePtr);
6800
+ } elsif ($$segDataPt =~ /^_JPSJPS_/) {
6801
+ $dumpType = 'JPS';
6802
+ $self->OverrideFileType('JPS') if $$self{FILE_TYPE} eq 'JPEG';
6803
+ SetByteOrder('MM');
6804
+ my $tagTablePtr = GetTagTable('Image::ExifTool::JPEG::JPS');
6805
+ $self->ProcessDirectory(\%dirInfo, $tagTablePtr);
6764
6806
  } elsif ($$self{Make} eq 'DJI') {
6765
6807
  $dumpType = 'DJI ThermalData';
6766
6808
  # add this data to the combined data if it exists