exiftool_vendored 12.06.0 → 12.12.0

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

Potentially problematic release.


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

Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/bin/Changes +96 -2
  3. data/bin/MANIFEST +5 -0
  4. data/bin/META.json +1 -1
  5. data/bin/META.yml +1 -1
  6. data/bin/README +43 -42
  7. data/bin/exiftool +156 -82
  8. data/bin/lib/Image/ExifTool.pm +22 -13
  9. data/bin/lib/Image/ExifTool.pod +59 -50
  10. data/bin/lib/Image/ExifTool/BuildTagLookup.pm +11 -5
  11. data/bin/lib/Image/ExifTool/Canon.pm +202 -13
  12. data/bin/lib/Image/ExifTool/DarwinCore.pm +9 -3
  13. data/bin/lib/Image/ExifTool/EXE.pm +8 -5
  14. data/bin/lib/Image/ExifTool/GIF.pm +2 -2
  15. data/bin/lib/Image/ExifTool/Geotag.pm +30 -11
  16. data/bin/lib/Image/ExifTool/GoPro.pm +47 -30
  17. data/bin/lib/Image/ExifTool/IPTC.pm +1 -0
  18. data/bin/lib/Image/ExifTool/Import.pm +14 -11
  19. data/bin/lib/Image/ExifTool/JSON.pm +27 -4
  20. data/bin/lib/Image/ExifTool/MPF.pm +2 -2
  21. data/bin/lib/Image/ExifTool/MacOS.pm +153 -37
  22. data/bin/lib/Image/ExifTool/Matroska.pm +3 -1
  23. data/bin/lib/Image/ExifTool/Minolta.pm +5 -1
  24. data/bin/lib/Image/ExifTool/Nikon.pm +11 -3
  25. data/bin/lib/Image/ExifTool/Olympus.pm +8 -1
  26. data/bin/lib/Image/ExifTool/Panasonic.pm +12 -12
  27. data/bin/lib/Image/ExifTool/PanasonicRaw.pm +1 -0
  28. data/bin/lib/Image/ExifTool/Pentax.pm +10 -3
  29. data/bin/lib/Image/ExifTool/QuickTime.pm +51 -16
  30. data/bin/lib/Image/ExifTool/QuickTimeStream.pl +68 -45
  31. data/bin/lib/Image/ExifTool/README +5 -2
  32. data/bin/lib/Image/ExifTool/RSRC.pm +17 -11
  33. data/bin/lib/Image/ExifTool/Radiance.pm +7 -2
  34. data/bin/lib/Image/ExifTool/Sony.pm +56 -35
  35. data/bin/lib/Image/ExifTool/Stim.pm +2 -2
  36. data/bin/lib/Image/ExifTool/TagLookup.pm +5756 -5710
  37. data/bin/lib/Image/ExifTool/TagNames.pod +248 -49
  38. data/bin/lib/Image/ExifTool/WriteQuickTime.pl +7 -6
  39. data/bin/lib/Image/ExifTool/Writer.pl +5 -3
  40. data/bin/lib/Image/ExifTool/XMP.pm +63 -18
  41. data/bin/lib/Image/ExifTool/XMP2.pl +1 -0
  42. data/bin/perl-Image-ExifTool.spec +42 -41
  43. data/lib/exiftool_vendored/version.rb +1 -1
  44. metadata +7 -7
@@ -28,7 +28,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes
28
28
  %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd
29
29
  %jpegMarker %specialTags %fileTypeLookup $testLen $exePath);
30
30
 
31
- $VERSION = '12.06';
31
+ $VERSION = '12.12';
32
32
  $RELEASE = '';
33
33
  @ISA = qw(Exporter);
34
34
  %EXPORT_TAGS = (
@@ -147,7 +147,7 @@ sub ReadValue($$$;$$$);
147
147
  ASF WTV DICOM FITS MIE JSON HTML XMP::SVG Palm Palm::MOBI Palm::EXTH Torrent
148
148
  EXE EXE::PEVersion EXE::PEString EXE::MachO EXE::PEF EXE::ELF EXE::AR
149
149
  EXE::CHM LNK Font VCard Text VCard::VCalendar RSRC Rawzor ZIP ZIP::GZIP
150
- ZIP::RAR RTF OOXML iWork ISO FLIR::AFF FLIR::FPF MacOS::MDItem MacOS::XAttr
150
+ ZIP::RAR RTF OOXML iWork ISO FLIR::AFF FLIR::FPF MacOS MacOS::MDItem
151
151
  FlashPix::DocTable
152
152
  );
153
153
 
@@ -188,8 +188,8 @@ $defaultLang = 'en'; # default language
188
188
  FLAC APE MPC MKV MXF DV PMP IND PGF ICC ITC FLIR FLIF FPF LFP
189
189
  HTML VRD RTF FITS XCF DSS QTIF FPX PICT ZIP GZIP PLIST RAR BZ2
190
190
  CZI TAR EXE EXR HDR CHM LNK WMF AVC DEX DPX RAW Font RSRC M2TS
191
- PHP PCX DCX DWF DWG WTV Torrent VCard LRI R3D AA PDB MOI ISO
192
- ALIAS JSON MP3 DICOM PCD TXT);
191
+ MacOS PHP PCX DCX DWF DWG WTV Torrent VCard LRI R3D AA PDB MOI
192
+ ISO ALIAS JSON MP3 DICOM PCD TXT);
193
193
 
194
194
  # file types that we can write (edit)
195
195
  my @writeTypes = qw(JPEG TIFF GIF CRW MRW ORF RAF RAW PNG MIE PSD XMP PPM EPS
@@ -208,10 +208,11 @@ my %writeTypes; # lookup for writable file types (hash filled if required)
208
208
  # - must update CanCreate() documentation if this list is changed!
209
209
  my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
210
210
 
211
- # file type lookup for all recognized file extensions
211
+ # file type lookup for all recognized file extensions (upper case)
212
212
  # (if extension may be more than one type, the type is a list where
213
213
  # the writable type should come first if it exists)
214
214
  %fileTypeLookup = (
215
+ '360' => ['MOV', 'GoPro 360 video'],
215
216
  '3FR' => ['TIFF', 'Hasselblad RAW format'],
216
217
  '3G2' => ['MOV', '3rd Gen. Partnership Project 2 audio/video'],
217
218
  '3GP' => ['MOV', '3rd Gen. Partnership Project audio/video'],
@@ -412,6 +413,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
412
413
  OFR => ['RIFF', 'OptimFROG audio'],
413
414
  OGG => ['OGG', 'Ogg Vorbis audio file'],
414
415
  OGV => ['OGG', 'Ogg Video file'],
416
+ ONP => ['JSON', 'ON1 Presets'],
415
417
  OPUS => ['OGG', 'Ogg Opus audio file'],
416
418
  ORF => ['ORF', 'Olympus RAW format'],
417
419
  OTF => ['Font', 'Open Type Font'],
@@ -517,6 +519,7 @@ my %createTypes = map { $_ => 1 } qw(XMP ICC MIE VRD DR4 EXIF EXV);
517
519
  WMV => ['ASF', 'Windows Media Video'],
518
520
  WV => ['RIFF', 'WavePack lossless audio'],
519
521
  X3F => ['X3F', 'Sigma RAW format'],
522
+ MACOS=> ['MacOS','MacOS ._ sidecar file'],
520
523
  XCF => ['XCF', 'GIMP native image format'],
521
524
  XHTML=> ['HTML', 'Extensible HyperText Markup Language'],
522
525
  XLA => ['FPX', 'Microsoft Excel Add-in'],
@@ -686,6 +689,7 @@ my %fileDescription = (
686
689
  ODT => 'application/vnd.oasis.opendocument.text',
687
690
  OGG => 'audio/ogg',
688
691
  OGV => 'video/ogg',
692
+ ONP => 'application/on1',
689
693
  ORF => 'image/x-olympus-orf',
690
694
  OTF => 'application/x-font-otf',
691
695
  PAGES=> 'application/x-iwork-pages-sffpages',
@@ -942,6 +946,7 @@ $testLen = 1024; # number of bytes to read when testing for magic number
942
946
  WMF => '(\xd7\xcd\xc6\x9a\0\0|\x01\0\x09\0\0\x03)',
943
947
  WTV => '\xb7\xd8\x00\x20\x37\x49\xda\x11\xa6\x4e\x00\x07\xe9\x5e\xad\x8d',
944
948
  X3F => 'FOVb',
949
+ MacOS=> '\0\x05\x16\x07\0.\0\0Mac OS X ',
945
950
  XCF => 'gimp xcf ',
946
951
  XMP => '\0{0,3}(\xfe\xff|\xff\xfe|\xef\xbb\xbf)?\0{0,3}\s*<',
947
952
  ZIP => 'PK\x03\x04',
@@ -2500,6 +2505,7 @@ sub ExtractInfo($;@)
2500
2505
  } else {
2501
2506
  $self->Error('Unknown file type');
2502
2507
  }
2508
+ $self->BuildCompositeTags() if $fast == 4 and $$options{Composite};
2503
2509
  last; # don't read the file
2504
2510
  }
2505
2511
  if (@fileTypeList) {
@@ -3996,7 +4002,9 @@ sub Open($*$;$)
3996
4002
  }
3997
4003
  my $share = 0;
3998
4004
  eval {
3999
- $share = Win32API::File::FILE_SHARE_READ() unless $access & Win32API::File::GENERIC_WRITE();
4005
+ unless ($access & Win32API::File::GENERIC_WRITE()) {
4006
+ $share = Win32API::File::FILE_SHARE_READ() | Win32API::File::FILE_SHARE_WRITE();
4007
+ }
4000
4008
  };
4001
4009
  my $wh = eval { Win32API::File::CreateFileW($file, $access, $share, [], $create, 0, []) };
4002
4010
  return undef unless $wh;
@@ -5727,12 +5735,12 @@ sub ConvertFileSize($)
5727
5735
  {
5728
5736
  my $val = shift;
5729
5737
  $val < 2048 and return "$val bytes";
5730
- $val < 10240 and return sprintf('%.1f kB', $val / 1024);
5731
- $val < 2097152 and return sprintf('%.0f kB', $val / 1024);
5732
- $val < 10485760 and return sprintf('%.1f MB', $val / 1048576);
5733
- $val < 2147483648 and return sprintf('%.0f MB', $val / 1048576);
5734
- $val < 10737418240 and return sprintf('%.1f GB', $val / 1073741824);
5735
- return sprintf('%.0f GB', $val / 1073741824);
5738
+ $val < 10240 and return sprintf('%.1f KiB', $val / 1024);
5739
+ $val < 2097152 and return sprintf('%.0f KiB', $val / 1024);
5740
+ $val < 10485760 and return sprintf('%.1f MiB', $val / 1048576);
5741
+ $val < 2147483648 and return sprintf('%.0f MiB', $val / 1048576);
5742
+ $val < 10737418240 and return sprintf('%.1f GiB', $val / 1073741824);
5743
+ return sprintf('%.0f GiB', $val / 1073741824);
5736
5744
  }
5737
5745
 
5738
5746
  #------------------------------------------------------------------------------
@@ -7142,6 +7150,7 @@ sub DoProcessTIFF($$;$)
7142
7150
  # no longer do this because various files use different values
7143
7151
  # (TIFF=0x2a, RW2/RWL=0x55, HDP=0xbc, BTF=0x2b, ORF=0x4f52/0x5352/0x????)
7144
7152
  # return 0 unless $identifier == 0x2a;
7153
+ $self->Warn('Invalid magic number in EXIF TIFF header') if $fileType eq 'APP1' and $identifier != 0x2a;
7145
7154
 
7146
7155
  # get offset to IFD0
7147
7156
  return 0 if length $$dataPt < 8;
@@ -7793,7 +7802,7 @@ sub HandleTag($$$$;%)
7793
7802
  my ($subdir, $format, $noTagInfo, $rational);
7794
7803
 
7795
7804
  if ($tagInfo) {
7796
- $subdir = $$tagInfo{SubDirectory}
7805
+ $subdir = $$tagInfo{SubDirectory};
7797
7806
  } else {
7798
7807
  return undef unless $verbose;
7799
7808
  $tagInfo = { Name => "tag $tag" }; # create temporary tagInfo hash
@@ -65,46 +65,47 @@ supported by ExifTool (r = read, w = write, c = create):
65
65
 
66
66
  File Types
67
67
  ------------+-------------+-------------+-------------+------------
68
- 3FR r | DPX r | ISO r | O r | RAW r/w
69
- 3G2 r/w | DR4 r/w/c | ITC r | ODP r | RIFF r
70
- 3GP r/w | DSS r | J2C r | ODS r | RSRC r
71
- A r | DV r | JNG r/w | ODT r | RTF r
72
- AA r | DVB r/w | JP2 r/w | OFR r | RW2 r/w
73
- AAE r | DVR-MS r | JPEG r/w | OGG r | RWL r/w
74
- AAX r/w | DYLIB r | JSON r | OGV r | RWZ r
75
- ACR r | EIP r | K25 r | OPUS r | RM r
76
- AFM r | EPS r/w | KDC r | ORF r/w | SEQ r
77
- AI r/w | EPUB r | KEY r | OTF r | SKETCH r
78
- AIFF r | ERF r/w | LA r | PAC r | SO r
79
- APE r | EXE r | LFP r | PAGES r | SR2 r/w
80
- ARQ r/w | EXIF r/w/c | LNK r | PBM r/w | SRF r
81
- ARW r/w | EXR r | LRV r/w | PCD r | SRW r/w
82
- ASF r | EXV r/w/c | M2TS r | PCX r | SVG r
83
- AVI r | F4A/V r/w | M4A/V r/w | PDB r | SWF r
84
- AVIF r/w | FFF r/w | MAX r | PDF r/w | THM r/w
85
- AZW r | FITS r | MEF r/w | PEF r/w | TIFF r/w
86
- BMP r | FLA r | MIE r/w/c | PFA r | TORRENT r
87
- BPG r | FLAC r | MIFF r | PFB r | TTC r
88
- BTF r | FLIF r/w | MKA r | PFM r | TTF r
89
- CHM r | FLV r | MKS r | PGF r | TXT r
90
- COS r | FPF r | MKV r | PGM r/w | VCF r
91
- CR2 r/w | FPX r | MNG r/w | PLIST r | VRD r/w/c
92
- CR3 r/w | GIF r/w | MOBI r | PICT r | VSD r
93
- CRM r/w | GPR r/w | MODD r | PMP r | WAV r
94
- CRW r/w | GZ r | MOI r | PNG r/w | WDP r/w
95
- CS1 r/w | HDP r/w | MOS r/w | PPM r/w | WEBP r
96
- CSV r | HDR r | MOV r/w | PPT r | WEBM r
97
- CZI r | HEIC r/w | MP3 r | PPTX r | WMA r
98
- DCM r | HEIF r/w | MP4 r/w | PS r/w | WMV r
99
- DCP r/w | HTML r | MPC r | PSB r/w | WTV r
100
- DCR r | ICC r/w/c | MPG r | PSD r/w | WV r
101
- DFONT r | ICS r | MPO r/w | PSP r | X3F r/w
102
- DIVX r | IDML r | MQV r/w | QTIF r/w | XCF r
103
- DJVU r | IIQ r/w | MRW r/w | R3D r | XLS r
104
- DLL r | IND r/w | MXF r | RA r | XLSX r
105
- DNG r/w | INSP r/w | NEF r/w | RAF r/w | XMP r/w/c
106
- DOC r | INSV r | NRW r/w | RAM r | ZIP r
107
- DOCX r | INX r | NUMBERS r | RAR r |
68
+ 360 r/w | DPX r | ITC r | ODP r | RIFF r
69
+ 3FR r | DR4 r/w/c | J2C r | ODS r | RSRC r
70
+ 3G2 r/w | DSS r | JNG r/w | ODT r | RTF r
71
+ 3GP r/w | DV r | JP2 r/w | OFR r | RW2 r/w
72
+ A r | DVB r/w | JPEG r/w | OGG r | RWL r/w
73
+ AA r | DVR-MS r | JSON r | OGV r | RWZ r
74
+ AAE r | DYLIB r | K25 r | ONP r | RM r
75
+ AAX r/w | EIP r | KDC r | OPUS r | SEQ r
76
+ ACR r | EPS r/w | KEY r | ORF r/w | SKETCH r
77
+ AFM r | EPUB r | LA r | OTF r | SO r
78
+ AI r/w | ERF r/w | LFP r | PAC r | SR2 r/w
79
+ AIFF r | EXE r | LNK r | PAGES r | SRF r
80
+ APE r | EXIF r/w/c | LRV r/w | PBM r/w | SRW r/w
81
+ ARQ r/w | EXR r | M2TS r | PCD r | SVG r
82
+ ARW r/w | EXV r/w/c | M4A/V r/w | PCX r | SWF r
83
+ ASF r | F4A/V r/w | MACOS r | PDB r | THM r/w
84
+ AVI r | FFF r/w | MAX r | PDF r/w | TIFF r/w
85
+ AVIF r/w | FITS r | MEF r/w | PEF r/w | TORRENT r
86
+ AZW r | FLA r | MIE r/w/c | PFA r | TTC r
87
+ BMP r | FLAC r | MIFF r | PFB r | TTF r
88
+ BPG r | FLIF r/w | MKA r | PFM r | TXT r
89
+ BTF r | FLV r | MKS r | PGF r | VCF r
90
+ CHM r | FPF r | MKV r | PGM r/w | VRD r/w/c
91
+ COS r | FPX r | MNG r/w | PLIST r | VSD r
92
+ CR2 r/w | GIF r/w | MOBI r | PICT r | WAV r
93
+ CR3 r/w | GPR r/w | MODD r | PMP r | WDP r/w
94
+ CRM r/w | GZ r | MOI r | PNG r/w | WEBP r
95
+ CRW r/w | HDP r/w | MOS r/w | PPM r/w | WEBM r
96
+ CS1 r/w | HDR r | MOV r/w | PPT r | WMA r
97
+ CSV r | HEIC r/w | MP3 r | PPTX r | WMV r
98
+ CZI r | HEIF r/w | MP4 r/w | PS r/w | WTV r
99
+ DCM r | HTML r | MPC r | PSB r/w | WV r
100
+ DCP r/w | ICC r/w/c | MPG r | PSD r/w | X3F r/w
101
+ DCR r | ICS r | MPO r/w | PSP r | XCF r
102
+ DFONT r | IDML r | MQV r/w | QTIF r/w | XLS r
103
+ DIVX r | IIQ r/w | MRW r/w | R3D r | XLSX r
104
+ DJVU r | IND r/w | MXF r | RA r | XMP r/w/c
105
+ DLL r | INSP r/w | NEF r/w | RAF r/w | ZIP r
106
+ DNG r/w | INSV r | NRW r/w | RAM r |
107
+ DOC r | INX r | NUMBERS r | RAR r |
108
+ DOCX r | ISO r | O r | RAW r/w |
108
109
 
109
110
  Meta Information
110
111
  ----------------------+----------------------+---------------------
@@ -306,7 +307,7 @@ L</Options> settings.
306
307
 
307
308
  =item Return Values:
308
309
 
309
- L</ImageInfo> returns a reference to a hash of tag key/value pairs. The tag
310
+ L</ImageInfo> returns a reference to a hash of tag-key/value pairs. The tag
310
311
  keys are identifiers -- essentially case-sensitive tag names with an
311
312
  appended instance number if multiple tags with the same name were extracted
312
313
  from the image. Many of the ExifTool functions require a tag key as an
@@ -643,10 +644,11 @@ file types. With a value of 2, ExifTool will also avoid extracting any EXIF
643
644
  MakerNote information, and will stop parsing at the IDAT chunk of PNG
644
645
  images. (By the PNG specification, metadata is allowed after IDAT, but
645
646
  ExifTool always writes it before because some utilities will ignore it
646
- otherwise.) When set to 3 or 4, only pseudo system tags and FileType are
647
- generated. For 3, the file header is read to provide an educated guess at
648
- FileType. For 4, the file is not read at all and FileType is determined
649
- based on the file's extension. Default is undef.
647
+ otherwise.) When set to 3 or higher, only pseudo system tags and FileType
648
+ are generated. For 3, the file header is read to provide an educated guess
649
+ at FileType. For 4, the file is not read at all and FileType is determined
650
+ based on the file's extension. For 5, generation of Composite tags is also
651
+ disabled (like setting L</Composite> to 0). Default is undef.
650
652
 
651
653
  =item Filter
652
654
 
@@ -849,9 +851,10 @@ causing conversion to local time when they are extracted and from local time
849
851
  when written. According to the QuickTime specification date/time values
850
852
  should be UTC, but many digital cameras store local time instead (presumably
851
853
  because they don't know the time zone), so the default is to not convert
852
- these times. This option also disables the autodetection of incorrect
853
- time-zero offsets in QuickTime date/time values, and enforces a time zero of
854
- 1904 as per the QuickTime specification.
854
+ these times (except for Canon CR3 files, which always use UTC times). This
855
+ option also disables the autodetection of incorrect time-zero offsets in
856
+ QuickTime date/time values, and enforces a time zero of 1904 as per the
857
+ QuickTime specification.
855
858
 
856
859
  =item RequestAll
857
860
 
@@ -1138,11 +1141,17 @@ created in the destination file as required to store the specified
1138
1141
  information. May be called repeatedly to write the same information to
1139
1142
  additional files without the need to call L</SetNewValue> again.
1140
1143
 
1141
- Note that it is NOT necessary to call L</ExtractInfo> or L</ImageInfo>
1144
+ ExifTool queues all new values that are assigned via calls to
1145
+ L</SetNewValue>, then applies them to any number of files through one or
1146
+ more calls to L</WriteInfo>. These queued values may be accessed through
1147
+ L</GetNewValue>, and are completely separate from metadata extracted from
1148
+ files via L</ExtractInfo> or L</ImageInfo> and accessed through L</GetInfo>
1149
+ or L</GetValue>.
1150
+
1151
+ To be clear, it is NOT necessary to call L</ExtractInfo> or L</ImageInfo>
1142
1152
  before L</WriteInfo>. L</WriteInfo> changes only metadata specified by
1143
1153
  previous calls to L</SetNewValue>.
1144
1154
 
1145
-
1146
1155
  # add information to a source file, writing output to new file
1147
1156
  $exifTool->WriteInfo($srcfile, $dstfile);
1148
1157
 
@@ -35,7 +35,7 @@ use Image::ExifTool::Sony;
35
35
  use Image::ExifTool::Validate;
36
36
  use Image::ExifTool::MacOS;
37
37
 
38
- $VERSION = '3.37';
38
+ $VERSION = '3.39';
39
39
  @ISA = qw(Exporter);
40
40
 
41
41
  sub NumbersFirst($$);
@@ -633,7 +633,8 @@ L<http://www.metadataworkinggroup.org/> for the official MWG specification.
633
633
  MacOS => q{
634
634
  On MacOS systems, the there are additional MDItem and XAttr Finder tags that
635
635
  may be extracted. These tags are not extracted by default -- they must be
636
- specifically requested or enabled via an API option.
636
+ specifically requested or enabled via an API option. (Except when reading
637
+ MacOS "._" files directly, see below.)
637
638
 
638
639
  The tables below list some of the tags that may be extracted, but ExifTool
639
640
  will extract all available information even for tags not listed.
@@ -1028,9 +1029,14 @@ TagID: foreach $tagID (@keys) {
1028
1029
  $note =~ s/(^[ \t]+|[ \t]+$)//mg;
1029
1030
  push @values, "($note)";
1030
1031
  }
1031
- if ($isXMP and lc $tagID ne lc $name) {
1032
- # add note about different XMP Tag ID
1033
- my $note = $$tagInfo{RootTagInfo} ? $tagID : "called $tagID by the spec";
1032
+ if ($isXMP and (lc $tagID ne lc $name or $$tagInfo{NotFlat})) {
1033
+ my $note;
1034
+ if ($$tagInfo{NotFlat}) {
1035
+ $note = 'NOT a flattened tag!';
1036
+ } else {
1037
+ # add note about different XMP Tag ID
1038
+ $note = $$tagInfo{RootTagInfo} ? $tagID : "called $tagID by the spec";
1039
+ }
1034
1040
  if ($$tagInfo{Notes}) {
1035
1041
  $values[-1] =~ s/^\(/($note; /;
1036
1042
  } else {
@@ -88,7 +88,7 @@ sub ProcessCTMD($$$);
88
88
  sub ProcessExifInfo($$$);
89
89
  sub SwapWords($);
90
90
 
91
- $VERSION = '4.39';
91
+ $VERSION = '4.42';
92
92
 
93
93
  # Note: Removed 'USM' from 'L' lenses since it is redundant - PH
94
94
  # (or is it? Ref 32 shows 5 non-USM L-type lenses)
@@ -487,8 +487,9 @@ $VERSION = '4.39';
487
487
  368.7 => 'Sigma 85mm f/1.4 DG HSM | A', #IB (016)
488
488
  368.8 => 'Sigma 105mm f/1.4 DG HSM', #IB (A018)
489
489
  368.9 => 'Sigma 14-24mm f/2.8 DG HSM', #IB (A018)
490
- 368.10 => 'Sigma 35mm f/1.4 DG HSM | A', #PH (012)
491
- '368.10' => 'Sigma 70mm f/2.8 DG Macro', #IB (A018)
490
+ '368.10' => 'Sigma 35mm f/1.4 DG HSM | A', #PH (012)
491
+ '368.11' => 'Sigma 70mm f/2.8 DG Macro', #IB (A018)
492
+ '368.12' => 'Sigma 18-35mm f/1.8 DC HSM | A', #50
492
493
  # Note: LensType 488 (0x1e8) is reported as 232 (0xe8) in 7D CameraSettings
493
494
  488 => 'Canon EF-S 15-85mm f/3.5-5.6 IS USM', #PH
494
495
  489 => 'Canon EF 70-300mm f/4-5.6L IS USM', #Gerald Kapounek
@@ -566,14 +567,28 @@ $VERSION = '4.39';
566
567
  61494 => 'Canon CN-E 85mm T1.3 L F', #PH
567
568
  61495 => 'Canon CN-E 135mm T2.2 L F', #PH
568
569
  61496 => 'Canon CN-E 35mm T1.5 L F', #PH
569
- 61182 => 'Canon RF 35mm F1.8 Macro IS STM or other Canon RF Lens', #IB
570
- 61182.1 => 'Canon RF 50mm F1.2 L USM', #IB
571
- 61182.2 => 'Canon RF 24-105mm F4 L IS USM', #IB
572
- 61182.3 => 'Canon RF 28-70mm F2 L USM', #IB
573
- 61182.4 => 'Canon RF 85mm F1.2L USM', #IB
574
- 61182.5 => 'Canon RF 24-240mm F4-6.3 IS USM', #IB
575
- 61182.6 => 'Canon RF 24-70mm F2.8 L IS USM', #PH
576
- 61182.7 => 'Canon RF 15-35mm F2.8 L IS USM', #PH
570
+ # see RFLensType tag for master list of 61182 RF lenses
571
+ 61182 => 'Canon RF 50mm F1.2L USM or other Canon RF Lens',
572
+ 61182.1 => 'Canon RF 24-105mm F4L IS USM',
573
+ 61182.2 => 'Canon RF 28-70mm F2L USM',
574
+ 61182.3 => 'Canon RF 35mm F1.8 MACRO IS STM',
575
+ 61182.4 => 'Canon RF 85mm F1.2L USM',
576
+ 61182.5 => 'Canon RF 85mm F1.2L USM DS',
577
+ 61182.6 => 'Canon RF 24-70mm F2.8L IS USM',
578
+ 61182.7 => 'Canon RF 15-35mm F2.8L IS USM',
579
+ 61182.8 => 'Canon RF 24-240mm F4-6.3 IS USM',
580
+ 61182.9 => 'Canon RF 70-200mm F2.8L IS USM',
581
+ 61182.10 => 'Canon RF 85mm F2 MACRO IS STM',
582
+ 61182.11 => 'Canon RF 600mm F11 IS STM',
583
+ 61182.12 => 'Canon RF 600mm F11 IS STM + RF1.4x',
584
+ 61182.13 => 'Canon RF 600mm F11 IS STM + RF2x',
585
+ 61182.14 => 'Canon RF 800mm F11 IS STM',
586
+ 61182.15 => 'Canon RF 800mm F11 IS STM + RF1.4x',
587
+ 61182.16 => 'Canon RF 800mm F11 IS STM + RF2x',
588
+ 61182.17 => 'Canon RF 24-105mm F4-7.1 IS STM',
589
+ 61182.18 => 'Canon RF 100-500mm F4.5-7.1L IS USM',
590
+ 61182.19 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF1.4x',
591
+ 61182.20 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
577
592
  65535 => 'n/a',
578
593
  );
579
594
 
@@ -919,6 +934,7 @@ $VERSION = '4.39';
919
934
  0x80000406 => 'EOS 6D Mark II', #IB/42
920
935
  0x80000408 => 'EOS 77D / 9000D',
921
936
  0x80000417 => 'EOS Rebel SL2 / 200D / Kiss X9', #IB/42
937
+ 0x80000421 => 'EOS R5', #PH
922
938
  0x80000422 => 'EOS Rebel T100 / 4000D / 3000D', #IB (3000D in China; Kiss? - PH)
923
939
  0x80000424 => 'EOS R', #IB
924
940
  0x80000428 => 'EOS-1D X Mark III', #IB
@@ -927,6 +943,8 @@ $VERSION = '4.39';
927
943
  0x80000435 => 'EOS Rebel T8i / 850D / X10i', #JR/PH
928
944
  0x80000436 => 'EOS SL3 / 250D / Kiss X10', #25
929
945
  0x80000437 => 'EOS 90D', #IB
946
+ 0x80000453 => 'EOS R6', #PH
947
+ 0x80000467 => 'PowerShot ZOOM',
930
948
  0x80000520 => 'EOS D2000C', #IB
931
949
  0x80000560 => 'EOS D6000C', #PH (guess)
932
950
  );
@@ -1883,6 +1901,11 @@ my %offOn = ( 0 => 'Off', 1 => 'On' );
1883
1901
  Name => 'ColorData9',
1884
1902
  SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData9' },
1885
1903
  },
1904
+ { # (int16u[2024|3656]) - 1DXmkIII (2024) ref IB, R5/R6 (3656) ref PH
1905
+ Condition => '$count == 2024 or $count == 3656',
1906
+ Name => 'ColorData10',
1907
+ SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorData10' },
1908
+ },
1886
1909
  {
1887
1910
  Name => 'ColorDataUnknown',
1888
1911
  SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorDataUnknown' },
@@ -5662,6 +5685,13 @@ my %ciMaxFocal = (
5662
5685
  ValueConv => 'unpack("H*",$val)',
5663
5686
  ValueConvInv => 'length($val) < 10 and $val = 0 x (10-length($val)) . $val; pack("H*",$val)',
5664
5687
  },
5688
+ 0x5c1 => {
5689
+ Name => 'FirmwareVersion',
5690
+ Format => 'string[6]',
5691
+ Writable => 0,
5692
+ Condition => '$$valPt =~ /^\d\.\d\.\d\0/',
5693
+ Notes => 'M50', # (firmware 1.0.0)
5694
+ },
5665
5695
  );
5666
5696
 
5667
5697
  # Picture Style information for various cameras (ref 48)
@@ -6694,7 +6724,18 @@ my %ciMaxFocal = (
6694
6724
  264 => 'Canon RF 15-35mm F2.8L IS USM',
6695
6725
  265 => 'Canon RF 24-240mm F4-6.3 IS USM',
6696
6726
  266 => 'Canon RF 70-200mm F2.8L IS USM',
6727
+ 267 => 'Canon RF 85mm F2 MACRO IS STM',
6728
+ 268 => 'Canon RF 600mm F11 IS STM',
6729
+ 269 => 'Canon RF 600mm F11 IS STM + RF1.4x',
6730
+ 270 => 'Canon RF 600mm F11 IS STM + RF2x',
6731
+ 271 => 'Canon RF 800mm F11 IS STM',
6732
+ 272 => 'Canon RF 800mm F11 IS STM + RF1.4x',
6733
+ 273 => 'Canon RF 800mm F11 IS STM + RF2x',
6697
6734
  274 => 'Canon RF 24-105mm F4-7.1 IS STM',
6735
+ 275 => 'Canon RF 100-500mm F4.5-7.1L IS USM',
6736
+ 276 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF1.4x',
6737
+ 277 => 'Canon RF 100-500mm F4.5-7.1L IS USM + RF2x',
6738
+ # Note: add new RF lenses to %canonLensTypes with ID 61182
6698
6739
  },
6699
6740
  },
6700
6741
  );
@@ -8039,7 +8080,6 @@ my %ciMaxFocal = (
8039
8080
  0x149 => { #IB
8040
8081
  Name => 'PerChannelBlackLevel',
8041
8082
  Format => 'int16u[4]',
8042
- Notes => '1300D',
8043
8083
  },
8044
8084
  # 0x318 - PerChannelBlackLevel again (ref IB)
8045
8085
  0x31c => { #IB
@@ -8057,6 +8097,128 @@ my %ciMaxFocal = (
8057
8097
  },
8058
8098
  );
8059
8099
 
8100
+ # Color data (MakerNotes tag 0x4001, count=2024,3656)
8101
+ # (same as ColorData9 but shifted up by 0x0e, ref PH)
8102
+ %Image::ExifTool::Canon::ColorData10 = (
8103
+ %binaryDataAttrs,
8104
+ FORMAT => 'int16s',
8105
+ FIRST_ENTRY => 0,
8106
+ GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
8107
+ DATAMEMBER => [ 0 ],
8108
+ IS_SUBDIR => [ 0x118 ],
8109
+ 0x00 => {
8110
+ Name => 'ColorDataVersion',
8111
+ DataMember => 'ColorDataVersion',
8112
+ RawConv => '$$self{ColorDataVersion} = $val',
8113
+ PrintConv => {
8114
+ 32 => '32 (1DXmkIII)', #IB
8115
+ 33 => '33 (R5/R6)',
8116
+ },
8117
+ },
8118
+ 0x55 => { Name => 'WB_RGGBLevelsAsShot', Format => 'int16s[4]' },
8119
+ 0x59 => 'ColorTempAsShot',
8120
+ 0x5a => { Name => 'WB_RGGBLevelsAuto', Format => 'int16s[4]' },
8121
+ 0x5e => 'ColorTempAuto',
8122
+ 0x5f => { Name => 'WB_RGGBLevelsMeasured', Format => 'int16s[4]' },
8123
+ 0x63 => 'ColorTempMeasured',
8124
+ 0x64 => { Name => 'WB_RGGBLevelsUnknown', Format => 'int16s[4]', Unknown => 1 },
8125
+ 0x68 => { Name => 'ColorTempUnknown', Unknown => 1 },
8126
+ 0x69 => { Name => 'WB_RGGBLevelsUnknown2', Format => 'int16s[4]', Unknown => 1 },
8127
+ 0x6d => { Name => 'ColorTempUnknown2', Unknown => 1 },
8128
+ 0x6e => { Name => 'WB_RGGBLevelsUnknown3', Format => 'int16s[4]', Unknown => 1 },
8129
+ 0x72 => { Name => 'ColorTempUnknown3', Unknown => 1 },
8130
+ 0x73 => { Name => 'WB_RGGBLevelsUnknown4', Format => 'int16s[4]', Unknown => 1 },
8131
+ 0x77 => { Name => 'ColorTempUnknown4', Unknown => 1 },
8132
+ 0x78 => { Name => 'WB_RGGBLevelsUnknown5', Format => 'int16s[4]', Unknown => 1 },
8133
+ 0x7c => { Name => 'ColorTempUnknown5', Unknown => 1 },
8134
+ 0x7d => { Name => 'WB_RGGBLevelsUnknown6', Format => 'int16s[4]', Unknown => 1 },
8135
+ 0x81 => { Name => 'ColorTempUnknown6', Unknown => 1 },
8136
+ 0x82 => { Name => 'WB_RGGBLevelsUnknown7', Format => 'int16s[4]', Unknown => 1 },
8137
+ 0x86 => { Name => 'ColorTempUnknown7', Unknown => 1 },
8138
+ 0x87 => { Name => 'WB_RGGBLevelsUnknown8', Format => 'int16s[4]', Unknown => 1 },
8139
+ 0x8b => { Name => 'ColorTempUnknown8', Unknown => 1 },
8140
+ 0x8c => { Name => 'WB_RGGBLevelsUnknown9', Format => 'int16s[4]', Unknown => 1 },
8141
+ 0x90 => { Name => 'ColorTempUnknown9', Unknown => 1 },
8142
+ 0x91 => { Name => 'WB_RGGBLevelsUnknown10', Format => 'int16s[4]', Unknown => 1 },
8143
+ 0x95 => { Name => 'ColorTempUnknown10', Unknown => 1 },
8144
+ 0x96 => { Name => 'WB_RGGBLevelsDaylight', Format => 'int16s[4]' },
8145
+ 0x9a => 'ColorTempDaylight',
8146
+ 0x9b => { Name => 'WB_RGGBLevelsShade', Format => 'int16s[4]' },
8147
+ 0x9f => 'ColorTempShade',
8148
+ 0xa0 => { Name => 'WB_RGGBLevelsCloudy', Format => 'int16s[4]' },
8149
+ 0xa4 => 'ColorTempCloudy',
8150
+ 0xa5 => { Name => 'WB_RGGBLevelsTungsten', Format => 'int16s[4]' },
8151
+ 0xa9 => 'ColorTempTungsten',
8152
+ 0xaa => { Name => 'WB_RGGBLevelsFluorescent',Format => 'int16s[4]' },
8153
+ 0xae => 'ColorTempFluorescent',
8154
+ 0xaf => { Name => 'WB_RGGBLevelsKelvin', Format => 'int16s[4]' },
8155
+ 0xb3 => 'ColorTempKelvin',
8156
+ 0xb4 => { Name => 'WB_RGGBLevelsFlash', Format => 'int16s[4]' },
8157
+ 0xb8 => 'ColorTempFlash',
8158
+ 0xb9 => { Name => 'WB_RGGBLevelsUnknown11', Format => 'int16s[4]', Unknown => 1 },
8159
+ 0xbd => { Name => 'ColorTempUnknown11', Unknown => 1 },
8160
+ 0xbe => { Name => 'WB_RGGBLevelsUnknown12', Format => 'int16s[4]', Unknown => 1 },
8161
+ 0xc2 => { Name => 'ColorTempUnknown12', Unknown => 1 },
8162
+ 0xc3 => { Name => 'WB_RGGBLevelsUnknown13', Format => 'int16s[4]', Unknown => 1 },
8163
+ 0xc7 => { Name => 'ColorTempUnknown13', Unknown => 1 },
8164
+ 0xc8 => { Name => 'WB_RGGBLevelsUnknown14', Format => 'int16s[4]', Unknown => 1 },
8165
+ 0xcc => { Name => 'ColorTempUnknown14', Unknown => 1 },
8166
+ 0xcd => { Name => 'WB_RGGBLevelsUnknown15', Format => 'int16s[4]', Unknown => 1 },
8167
+ 0xd1 => { Name => 'ColorTempUnknown15', Unknown => 1 },
8168
+ 0xd2 => { Name => 'WB_RGGBLevelsUnknown16', Format => 'int16s[4]', Unknown => 1 },
8169
+ 0xd6 => { Name => 'ColorTempUnknown16', Unknown => 1 },
8170
+ 0xd7 => { Name => 'WB_RGGBLevelsUnknown17', Format => 'int16s[4]', Unknown => 1 },
8171
+ 0xdb => { Name => 'ColorTempUnknown17', Unknown => 1 },
8172
+ 0xdc => { Name => 'WB_RGGBLevelsUnknown18', Format => 'int16s[4]', Unknown => 1 },
8173
+ 0xe0 => { Name => 'ColorTempUnknown18', Unknown => 1 },
8174
+ 0xe1 => { Name => 'WB_RGGBLevelsUnknown19', Format => 'int16s[4]', Unknown => 1 },
8175
+ 0xe5 => { Name => 'ColorTempUnknown19', Unknown => 1 },
8176
+ 0xe6 => { Name => 'WB_RGGBLevelsUnknown20', Format => 'int16s[4]', Unknown => 1 },
8177
+ 0xea => { Name => 'ColorTempUnknown20', Unknown => 1 },
8178
+ 0xeb => { Name => 'WB_RGGBLevelsUnknown21', Format => 'int16s[4]', Unknown => 1 },
8179
+ 0xef => { Name => 'ColorTempUnknown21', Unknown => 1 },
8180
+ 0xf0 => { Name => 'WB_RGGBLevelsUnknown22', Format => 'int16s[4]', Unknown => 1 },
8181
+ 0xf4 => { Name => 'ColorTempUnknown22', Unknown => 1 },
8182
+ 0xf5 => { Name => 'WB_RGGBLevelsUnknown23', Format => 'int16s[4]', Unknown => 1 },
8183
+ 0xf9 => { Name => 'ColorTempUnknown23', Unknown => 1 },
8184
+ 0xfa => { Name => 'WB_RGGBLevelsUnknown24', Format => 'int16s[4]', Unknown => 1 },
8185
+ 0xfe => { Name => 'ColorTempUnknown24', Unknown => 1 },
8186
+ 0xff => { Name => 'WB_RGGBLevelsUnknown25', Format => 'int16s[4]', Unknown => 1 },
8187
+ 0x103=> { Name => 'ColorTempUnknown25', Unknown => 1 },
8188
+ 0x104=> { Name => 'WB_RGGBLevelsUnknown26', Format => 'int16s[4]', Unknown => 1 },
8189
+ 0x108=> { Name => 'ColorTempUnknown26', Unknown => 1 },
8190
+ 0x109=> { Name => 'WB_RGGBLevelsUnknown27', Format => 'int16s[4]', Unknown => 1 },
8191
+ 0x10d=> { Name => 'ColorTempUnknown27', Unknown => 1 },
8192
+ 0x10e=> { Name => 'WB_RGGBLevelsUnknown28', Format => 'int16s[4]', Unknown => 1 },
8193
+ 0x112=> { Name => 'ColorTempUnknown28', Unknown => 1 },
8194
+ 0x113=> { Name => 'WB_RGGBLevelsUnknown29', Format => 'int16s[4]', Unknown => 1 },
8195
+ 0x117=> { Name => 'ColorTempUnknown29', Unknown => 1 },
8196
+ 0x118 => {
8197
+ Name => 'ColorCalib',
8198
+ Format => 'undef[120]',
8199
+ Unknown => 1,
8200
+ SubDirectory => { TagTable => 'Image::ExifTool::Canon::ColorCalib' }
8201
+ },
8202
+ 0x157 => {
8203
+ Name => 'PerChannelBlackLevel',
8204
+ Format => 'int16u[4]',
8205
+ },
8206
+ # 0x326 - PerChannelBlackLevel again
8207
+ 0x32a => {
8208
+ Name => 'NormalWhiteLevel',
8209
+ Format => 'int16u',
8210
+ RawConv => '$val || undef',
8211
+ },
8212
+ 0x32b => {
8213
+ Name => 'SpecularWhiteLevel',
8214
+ Format => 'int16u',
8215
+ },
8216
+ 0x32c => {
8217
+ Name => 'LinearityUpperMargin',
8218
+ Format => 'int16u',
8219
+ },
8220
+ );
8221
+
8060
8222
  # Unknown color data (MakerNotes tag 0x4001)
8061
8223
  %Image::ExifTool::Canon::ColorDataUnknown = (
8062
8224
  PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
@@ -8565,7 +8727,7 @@ my %filterConv = (
8565
8727
  Name => 'MakerNoteCanon',
8566
8728
  SubDirectory => {
8567
8729
  TagTable => 'Image::ExifTool::Canon::Main',
8568
- ProcessProc => \&Image::ExifTool::ProcessTIFF,
8730
+ ProcessProc => \&ProcessCMT3,
8569
8731
  WriteProc => \&Image::ExifTool::WriteTIFF,
8570
8732
  },
8571
8733
  },
@@ -9511,6 +9673,33 @@ sub CanonEvInv($)
9511
9673
  return $sign * ($val * 0x20 + $frac);
9512
9674
  }
9513
9675
 
9676
+ #------------------------------------------------------------------------------
9677
+ # Read CMT3 maker notes from CR3 file
9678
+ # Inputs: 0) ExifTool object reference, 1) dirInfo ref, 2) tag table ref
9679
+ # Returns: data block (may be empty if no Exif data) or undef on error
9680
+ sub ProcessCMT3($$$)
9681
+ {
9682
+ my ($et, $dirInfo, $tagTablePtr) = @_;
9683
+
9684
+ # extract the static maker notes to copying to other file types if requested
9685
+ # Note: this won't copy makernotes in the timed metadata since these are stored
9686
+ # separately, but the only records they have that aren't in the static maker notes
9687
+ # (for the M50) are: ColorData9, Flavor, CanonCameraInfoUnknown,
9688
+ # VignettingCorrUnknown1, Canon_0x4033 and Canon_0x402e
9689
+ if (($et->Options('MakerNotes') or $$et{REQ_TAG_LOOKUP}{makernotecanon}) and
9690
+ $$dirInfo{DirLen} > 8)
9691
+ {
9692
+ my $dataPt = $$dirInfo{DataPt};
9693
+ # remove old (unused) trailer
9694
+ $$dataPt =~ s/(II\x2a\0|MM\0\x2a)\0{4,10}$//;
9695
+ # remove TIFF header and append as the Canon makernote trailer
9696
+ # (so offsets will be interpreted correctly)
9697
+ my $val = substr($$dataPt,8) . substr($$dataPt,0,8);
9698
+ $et->FoundTag($Image::ExifTool::Canon::uuid{CMT3}, \$val);
9699
+ }
9700
+ return $et->ProcessTIFF($dirInfo, $tagTablePtr);
9701
+ }
9702
+
9514
9703
  #------------------------------------------------------------------------------
9515
9704
  # Process CTMD EXIF information
9516
9705
  # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref