exiftool-vendored.exe 12.56.0 → 12.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/bin/exiftool_files/Changes +115 -5
  2. package/bin/exiftool_files/LICENSE +674 -0
  3. package/bin/exiftool_files/README +45 -44
  4. package/bin/exiftool_files/config_files/example.config +1 -0
  5. package/bin/exiftool_files/config_files/rotate_regions.config +1 -1
  6. package/bin/exiftool_files/exiftool.pl +262 -160
  7. package/bin/exiftool_files/lib/Image/ExifTool/AIFF.pm +2 -2
  8. package/bin/exiftool_files/lib/Image/ExifTool/APE.pm +2 -2
  9. package/bin/exiftool_files/lib/Image/ExifTool/BMP.pm +0 -1
  10. package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +23 -19
  11. package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +26 -6
  12. package/bin/exiftool_files/lib/Image/ExifTool/CanonRaw.pm +5 -1
  13. package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +28 -2
  14. package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +77 -19
  15. package/bin/exiftool_files/lib/Image/ExifTool/FlashPix.pm +33 -10
  16. package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +7 -3
  17. package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +7 -2
  18. package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +30 -7
  19. package/bin/exiftool_files/lib/Image/ExifTool/JPEG.pm +14 -2
  20. package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +36 -11
  21. package/bin/exiftool_files/lib/Image/ExifTool/LIF.pm +10 -2
  22. package/bin/exiftool_files/lib/Image/ExifTool/LNK.pm +5 -4
  23. package/bin/exiftool_files/lib/Image/ExifTool/MIE.pm +3 -3
  24. package/bin/exiftool_files/lib/Image/ExifTool/MPEG.pm +2 -2
  25. package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +3 -2
  26. package/bin/exiftool_files/lib/Image/ExifTool/Minolta.pm +6 -7
  27. package/bin/exiftool_files/lib/Image/ExifTool/MinoltaRaw.pm +2 -1
  28. package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +1005 -909
  29. package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +2 -2
  30. package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +1 -1
  31. package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +88 -6
  32. package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +17 -8
  33. package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +10 -2
  34. package/bin/exiftool_files/lib/Image/ExifTool/PanasonicRaw.pm +27 -1
  35. package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +8 -5
  36. package/bin/exiftool_files/lib/Image/ExifTool/PhaseOne.pm +14 -1
  37. package/bin/exiftool_files/lib/Image/ExifTool/Photoshop.pm +38 -7
  38. package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +48 -14
  39. package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +91 -27
  40. package/bin/exiftool_files/lib/Image/ExifTool/README +19 -2
  41. package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +34 -13
  42. package/bin/exiftool_files/lib/Image/ExifTool/Rawzor.pm +2 -2
  43. package/bin/exiftool_files/lib/Image/ExifTool/Ricoh.pm +2 -1
  44. package/bin/exiftool_files/lib/Image/ExifTool/Sigma.pm +5 -4
  45. package/bin/exiftool_files/lib/Image/ExifTool/SigmaRaw.pm +9 -3
  46. package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +39 -10
  47. package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +4687 -4628
  48. package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +338 -117
  49. package/bin/exiftool_files/lib/Image/ExifTool/Validate.pm +5 -5
  50. package/bin/exiftool_files/lib/Image/ExifTool/WPG.pm +296 -0
  51. package/bin/exiftool_files/lib/Image/ExifTool/WriteExif.pl +42 -0
  52. package/bin/exiftool_files/lib/Image/ExifTool/WritePDF.pl +7 -8
  53. package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +1 -1
  54. package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +162 -40
  55. package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +35 -8
  56. package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +2 -1
  57. package/bin/exiftool_files/lib/Image/ExifTool/ZIP.pm +159 -41
  58. package/bin/exiftool_files/lib/Image/ExifTool.pm +286 -65
  59. package/bin/exiftool_files/lib/Image/ExifTool.pod +95 -51
  60. package/package.json +2 -2
@@ -17,7 +17,7 @@ package Image::ExifTool::Validate;
17
17
  use strict;
18
18
  use vars qw($VERSION %exifSpec);
19
19
 
20
- $VERSION = '1.19';
20
+ $VERSION = '1.20';
21
21
 
22
22
  use Image::ExifTool qw(:Utils);
23
23
  use Image::ExifTool::Exif;
@@ -437,8 +437,8 @@ sub ValidateExif($$$$$$$$)
437
437
  $et->Warn(sprintf('Wrong IFD for 0x%.4x %s (should be %s not %s)', $tag, $$ti{Name}, $wgp, $ifd));
438
438
  }
439
439
  }
440
- } elsif (not $otherSpec{$$et{VALUE}{FileType}} or
441
- (not $otherSpec{$$et{VALUE}{FileType}}{$tag} and not $otherSpec{$$et{VALUE}{FileType}}{All}))
440
+ } elsif (not $otherSpec{$$et{FileType}} or
441
+ (not $otherSpec{$$et{FileType}}{$tag} and not $otherSpec{$$et{FileType}}{All}))
442
442
  {
443
443
  if ($tagTablePtr eq \%Image::ExifTool::Exif::Main or $$tagInfo{Unknown}) {
444
444
  $et->Warn(sprintf('Non-standard %s tag 0x%.4x %s', $ifd, $tag, $$ti{Name}), 1);
@@ -459,8 +459,8 @@ sub ValidateExif($$$$$$$$)
459
459
  $et->Warn(sprintf('Non-standard count (%d) for %s 0x%.4x %s', $count, $ifd, $tag, $$ti{Name}));
460
460
  }
461
461
  }
462
- } elsif (not $otherSpec{$$et{VALUE}{FileType}} or
463
- (not $otherSpec{$$et{VALUE}{FileType}}{$tag} and not $otherSpec{$$et{VALUE}{FileType}}{All}))
462
+ } elsif (not $otherSpec{$$et{FileType}} or
463
+ (not $otherSpec{$$et{FileType}}{$tag} and not $otherSpec{$$et{FileType}}{All}))
464
464
  {
465
465
  $et->Warn(sprintf('Unknown %s tag 0x%.4x', $ifd, $tag), 1);
466
466
  }
@@ -0,0 +1,296 @@
1
+ #------------------------------------------------------------------------------
2
+ # File: WPG.pm
3
+ #
4
+ # Description: Read WordPerfect Graphics meta information
5
+ #
6
+ # Revisions: 2023-05-01 - P. Harvey Created
7
+ #
8
+ # References: 1) https://www.fileformat.info/format/wpg/egff.htm
9
+ # 2) https://archive.org/details/mac_Graphics_File_Formats_Second_Edition_1996/page/n991/mode/2up
10
+ # 3) http://libwpg.sourceforge.net/
11
+ #------------------------------------------------------------------------------
12
+
13
+ package Image::ExifTool::WPG;
14
+
15
+ use strict;
16
+ use vars qw($VERSION);
17
+ use Image::ExifTool qw(:DataAccess :Utils);
18
+
19
+ $VERSION = '1.00';
20
+
21
+ sub PrintRecord($$$);
22
+
23
+ # WPG metadata
24
+ %Image::ExifTool::WPG::Main = (
25
+ GROUPS => { 0 => 'File', 1 => 'File', 2 => 'Image' },
26
+ VARS => { NO_ID => 1 },
27
+ NOTES => 'Tags extracted from WordPerfect Graphics (WPG) images.',
28
+ WPGVersion => { },
29
+ ImageWidthInches => { PrintConv => 'sprintf("%.2f",$val)' },
30
+ ImageHeightInches => { PrintConv => 'sprintf("%.2f",$val)' },
31
+ Records => {
32
+ Notes => 'records for version 1.0 files',
33
+ List => 1,
34
+ PrintHex => 2,
35
+ PrintConvColumns => 2,
36
+ PrintConv => {
37
+ OTHER => \&PrintRecord,
38
+ 0x01 => 'Fill Attributes',
39
+ 0x02 => 'Line Attributes',
40
+ 0x03 => 'Marker Attributes',
41
+ 0x04 => 'Polymarker',
42
+ 0x05 => 'Line',
43
+ 0x06 => 'Polyline',
44
+ 0x07 => 'Rectangle',
45
+ 0x08 => 'Polygon',
46
+ 0x09 => 'Ellipse',
47
+ 0x0a => 'Reserved',
48
+ 0x0b => 'Bitmap (Type 1)',
49
+ 0x0c => 'Graphics Text (Type 1)',
50
+ 0x0d => 'Graphics Text Attributes',
51
+ 0x0e => 'Color Map',
52
+ 0x0f => 'Start WPG (Type 1)',
53
+ 0x10 => 'End WPG',
54
+ 0x11 => 'PostScript Data (Type 1)',
55
+ 0x12 => 'Output Attributes',
56
+ 0x13 => 'Curved Polyline',
57
+ 0x14 => 'Bitmap (Type 2)',
58
+ 0x15 => 'Start Figure',
59
+ 0x16 => 'Start Chart',
60
+ 0x17 => 'PlanPerfect Data',
61
+ 0x18 => 'Graphics Text (Type 2)',
62
+ 0x19 => 'Start WPG (Type 2)',
63
+ 0x1a => 'Graphics Text (Type 3)',
64
+ 0x1b => 'PostScript Data (Type 2)',
65
+ },
66
+ },
67
+ RecordsV2 => {
68
+ Notes => 'records for version 2.0 files',
69
+ List => 1,
70
+ PrintHex => 2,
71
+ PrintConvColumns => 2,
72
+ PrintConv => {
73
+ OTHER => \&PrintRecord,
74
+ 0x00 => 'End Marker',
75
+ 0x01 => 'Start WPG',
76
+ 0x02 => 'End WPG',
77
+ 0x03 => 'Form Settings',
78
+ 0x04 => 'Ruler Settings',
79
+ 0x05 => 'Grid Settings',
80
+ 0x06 => 'Layer',
81
+ 0x08 => 'Pen Style Definition',
82
+ 0x09 => 'Pattern Definition',
83
+ 0x0a => 'Comment',
84
+ 0x0b => 'Color Transfer',
85
+ 0x0c => 'Color Palette',
86
+ 0x0d => 'DP Color Palette',
87
+ 0x0e => 'Bitmap Data',
88
+ 0x0f => 'Text Data',
89
+ 0x10 => 'Chart Style',
90
+ 0x11 => 'Chart Data',
91
+ 0x12 => 'Object Image',
92
+ 0x15 => 'Polyline',
93
+ 0x16 => 'Polyspline',
94
+ 0x17 => 'Polycurve',
95
+ 0x18 => 'Rectangle',
96
+ 0x19 => 'Arc',
97
+ 0x1a => 'Compound Polygon',
98
+ 0x1b => 'Bitmap',
99
+ 0x1c => 'Text Line',
100
+ 0x1d => 'Text Block',
101
+ 0x1e => 'Text Path',
102
+ 0x1f => 'Chart',
103
+ 0x20 => 'Group',
104
+ 0x21 => 'Object Capsule',
105
+ 0x22 => 'Font Settings',
106
+ 0x25 => 'Pen Fore Color',
107
+ 0x26 => 'DP Pen Fore Color',
108
+ 0x27 => 'Pen Back Color',
109
+ 0x28 => 'DP Pen Back Color',
110
+ 0x29 => 'Pen Style',
111
+ 0x2a => 'Pen Pattern',
112
+ 0x2b => 'Pen Size',
113
+ 0x2c => 'DP Pen Size',
114
+ 0x2d => 'Line Cap',
115
+ 0x2e => 'Line Join',
116
+ 0x2f => 'Brush Gradient',
117
+ 0x30 => 'DP Brush Gradient',
118
+ 0x31 => 'Brush Fore Color',
119
+ 0x32 => 'DP Brush Fore Color',
120
+ 0x33 => 'Brush Back Color',
121
+ 0x34 => 'DP Brush Back Color',
122
+ 0x35 => 'Brush Pattern',
123
+ 0x36 => 'Horizontal Line',
124
+ 0x37 => 'Vertical Line',
125
+ 0x38 => 'Poster Settings',
126
+ 0x39 => 'Image State',
127
+ 0x3a => 'Envelope Definition',
128
+ 0x3b => 'Envelope',
129
+ 0x3c => 'Texture Definition',
130
+ 0x3d => 'Brush Texture',
131
+ 0x3e => 'Texture Alignment',
132
+ 0x3f => 'Pen Texture ',
133
+ }
134
+ },
135
+ );
136
+
137
+ #------------------------------------------------------------------------------
138
+ # Print record type
139
+ # Inputs: 0) record type and count, 1) inverse flag, 2) PrintConv hash ref
140
+ # Returns: converted record name
141
+ sub PrintRecord($$$)
142
+ {
143
+ my ($val, $inv, $printConv) = @_;
144
+ my ($type, $count) = split 'x', $val;
145
+ my $prt = $$printConv{$type} || sprintf('Unknown (0x%.2x)', $type);
146
+ $prt .= " x $count" if $count;
147
+ return $prt;
148
+ }
149
+
150
+ #------------------------------------------------------------------------------
151
+ # Read variable-length integer
152
+ # Inputs: 0) RAF ref
153
+ # Returns: integer value
154
+ sub ReadVarInt($)
155
+ {
156
+ my $raf = shift;
157
+ my $buff;
158
+ $raf->Read($buff, 1) or return 0;
159
+ my $val = ord($buff);
160
+ if ($val == 0xff) {
161
+ $raf->Read($buff, 2) == 2 or return 0;
162
+ $val = unpack('v', $buff);
163
+ if ($val & 0x8000) {
164
+ $raf->Read($buff, 2) == 2 or return 0;
165
+ $val = (($val & 0x7fff) << 16) | unpack('v', $buff);
166
+ }
167
+ }
168
+ return $val;
169
+ }
170
+
171
+ #------------------------------------------------------------------------------
172
+ # Read WPG version 1 or 2 image
173
+ # Inputs: 0) ExifTool object reference, 1) dirInfo reference
174
+ # Returns: 1 on success, 0 if this wasn't a valid WPG file
175
+ sub ProcessWPG($$)
176
+ {
177
+ my ($et, $dirInfo) = @_;
178
+ my $raf = $$dirInfo{RAF};
179
+ my ($buff, $lastType, $count);
180
+
181
+ # verify this is a valid WPG file
182
+ return 0 unless $raf->Read($buff, 16) == 16;
183
+ return 0 unless $buff =~ /^\xff\x57\x50\x43/;
184
+ $et->SetFileType();
185
+ SetByteOrder('II');
186
+ my $tagTablePtr = GetTagTable('Image::ExifTool::WPG::Main');
187
+ my $offset = Get32u(\$buff, 4);
188
+ my ($ver, $rev) = unpack('x10CC', $buff);
189
+ $et->HandleTag($tagTablePtr, WPGVersion => "$ver.$rev");
190
+ if ($ver < 1 or $ver > 2) {
191
+ # currently support only version 1 and 2 formats
192
+ $et->Warn('Unsupported WPG version');
193
+ return 1;
194
+ }
195
+ my $tag = $ver == 1 ? 'Records' : 'RecordsV2';
196
+ $raf->Seek($offset - 16, 1) or return 1 if $offset > 16;
197
+ # loop through records
198
+ for (;;) {
199
+ my ($type, $len, $getSize);
200
+ if ($raf->Read($buff, $ver) == $ver) { # read 1 or 2 bytes, based on version
201
+ if ($ver == 1) {
202
+ # read version 1 record header
203
+ $type = ord($buff);
204
+ $len = ReadVarInt($raf);
205
+ $getSize = 1 if $type == 0x0f; # Start WPG (Type 1)
206
+ } else {
207
+ # read version 2 record header
208
+ $type = unpack('xC', $buff);
209
+ ReadVarInt($raf); # skip extensions
210
+ $len = ReadVarInt($raf);
211
+ $getSize = 1 if $type == 0x01; # Start WPG
212
+ undef $type if $type > 0x3f;
213
+ }
214
+ if ($getSize) {
215
+ # read Start record to obtain image size
216
+ $raf->Read($buff, $len) == $len or $et->Warn('File format error'), last;
217
+ my ($w, $h, $xres, $yres);
218
+ if ($ver == 1) {
219
+ ($w, $h) = unpack('x2vv', $buff);
220
+ } else {
221
+ my ($precision, $format);
222
+ ($xres, $yres, $precision) = unpack('vvC', $buff);
223
+ if ($precision == 0 and $len >= 21) {
224
+ $format = 'int16s';
225
+ } elsif ($precision == 1 and $len >= 29) {
226
+ $format = 'int32s';
227
+ } else {
228
+ $et->Warn('Invalid integer precision');
229
+ next;
230
+ }
231
+ my ($x1,$y1,$x2,$y2) = ReadValue(\$buff, 13, $format, 4, $len-13);
232
+ $w = abs($x2 - $x1);
233
+ $h = abs($y2 - $y1);
234
+ }
235
+ $et->HandleTag($tagTablePtr, ImageWidthInches => $w / ($xres || 1200));
236
+ $et->HandleTag($tagTablePtr, ImageHeightInches => $h / ($yres || 1200));
237
+ } else {
238
+ $raf->Seek($len, 1) or last; # skip to the next record
239
+ }
240
+ }
241
+ # go to some trouble to collapse identical sequential entries in record list
242
+ # (trying to keep the length of the list managable for complex images)
243
+ $lastType and $type and $type == $lastType and ++$count, next;
244
+ if ($lastType) {
245
+ my $val = $count > 1 ? "${lastType}x$count" : $lastType;
246
+ $et->HandleTag($tagTablePtr, $tag => $val);
247
+ }
248
+ last unless $type;
249
+ $lastType = $type;
250
+ $count = 1;
251
+ }
252
+ return 1;
253
+ }
254
+
255
+ 1; # end
256
+
257
+ __END__
258
+
259
+ =head1 NAME
260
+
261
+ Image::ExifTool::WPG - Read WPG meta information
262
+
263
+ =head1 SYNOPSIS
264
+
265
+ This module is used by Image::ExifTool
266
+
267
+ =head1 DESCRIPTION
268
+
269
+ This module contains definitions required by Image::ExifTool to read WPG
270
+ (WordPerfect Graphics) images.
271
+
272
+ =head1 AUTHOR
273
+
274
+ Copyright 2003-2023, Phil Harvey (philharvey66 at gmail.com)
275
+
276
+ This library is free software; you can redistribute it and/or modify it
277
+ under the same terms as Perl itself.
278
+
279
+ =head1 REFERENCES
280
+
281
+ =over 4
282
+
283
+ =item L<https://www.fileformat.info/format/wpg/egff.htm>
284
+
285
+ =item L<https://archive.org/details/mac_Graphics_File_Formats_Second_Edition_1996/page/n991/mode/2up>
286
+
287
+ =item L<http://libwpg.sourceforge.net/>
288
+
289
+ =back
290
+
291
+ =head1 SEE ALSO
292
+
293
+ L<Image::ExifTool::TagNames/WPG Tags>,
294
+ L<Image::ExifTool(3pm)|Image::ExifTool>
295
+
296
+ =cut
@@ -419,6 +419,48 @@ sub ValidateImageData($$$;$)
419
419
  }
420
420
  }
421
421
 
422
+ #------------------------------------------------------------------------------
423
+ # Add specified image data to ImageDataMD5 hash
424
+ # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) lookup for [tagInfo,value] based on tagID
425
+ sub AddImageDataMD5($$$)
426
+ {
427
+ my ($et, $dirInfo, $offsetInfo) = @_;
428
+ my ($tagID, $offset, $buff);
429
+
430
+ my $verbose = $et->Options('Verbose');
431
+ my $md5 = $$et{ImageDataMD5};
432
+ my $raf = $$dirInfo{RAF};
433
+
434
+ foreach $tagID (sort keys %$offsetInfo) {
435
+ next unless ref $$offsetInfo{$tagID} eq 'ARRAY'; # ignore scalar tag values used for Validate
436
+ my $tagInfo = $$offsetInfo{$tagID}[0];
437
+ next unless $$tagInfo{IsImageData}; # only consider image data
438
+ my $sizeID = $$tagInfo{OffsetPair};
439
+ my @sizes;
440
+ if ($$tagInfo{NotRealPair}) {
441
+ @sizes = 999999999; # (Panasonic hack: raw data runs to end of file)
442
+ } elsif ($sizeID and $$offsetInfo{$sizeID}) {
443
+ @sizes = split ' ', $$offsetInfo{$sizeID}[1];
444
+ } else {
445
+ next;
446
+ }
447
+ my @offsets = split ' ', $$offsetInfo{$tagID}[1];
448
+ $sizes[0] = 999999999 if $$tagInfo{NotRealPair};
449
+ my $total = 0;
450
+ foreach $offset (@offsets) {
451
+ my $size = shift @sizes;
452
+ next unless $offset =~ /^\d+$/ and $size and $size =~ /^\d+$/ and $size;
453
+ next unless $raf->Seek($offset, 0); # (offset is absolute)
454
+ $total += $et->ImageDataMD5($raf, $size);
455
+ }
456
+ if ($verbose) {
457
+ my $name = "$$dirInfo{DirName}:$$tagInfo{Name}";
458
+ $name =~ s/Offsets?|Start$//;
459
+ $et->VPrint(0, "$$et{INDENT}(ImageDataMD5: $total bytes of $name data)\n");
460
+ }
461
+ }
462
+ }
463
+
422
464
  #------------------------------------------------------------------------------
423
465
  # Handle error while writing EXIF
424
466
  # Inputs: 0) ExifTool ref, 1) error string, 2) tag table ref
@@ -23,7 +23,7 @@ my $beginComment = '%BeginExifToolUpdate';
23
23
  my $endComment = '%EndExifToolUpdate ';
24
24
 
25
25
  my $keyExt; # crypt key extension
26
- my $pdfVer; # version of PDF file we are currently writing
26
+ my $pdfVer; # version of PDF file we are writing (highest Version in Root dictionaries)
27
27
 
28
28
  # internal tags used in dictionary objects
29
29
  my %myDictTags = (
@@ -297,15 +297,11 @@ sub WritePDF($$)
297
297
  $$newTool{PDF_CAPTURE} = \%capture;
298
298
  my $info = $newTool->ImageInfo($raf, 'XMP', 'PDF:*', 'Error', 'Warning');
299
299
  # not a valid PDF file unless we got a version number
300
- # (note: can't just check $$info{PDFVersion} due to possibility of XMP-pdf:PDFVersion)
301
- my $vers = $newTool->GetInfo('PDF:PDFVersion');
302
- # take highest version number if multiple versions in an incremental save
303
- ($pdfVer) = sort { $b <=> $a } values %$vers;
300
+ $pdfVer = $$newTool{PDFVersion};
304
301
  $pdfVer or $et->Error('Missing PDF:PDFVersion'), return 0;
305
302
  # check version number
306
- if ($pdfVer > 1.7) {
307
- $et->Warn("The PDF $pdfVer specification is not freely available", 1);
308
- # (so writing by ExifTool is based on trial and error)
303
+ if ($pdfVer > 2.0) {
304
+ $et->Error("Writing PDF $pdfVer is untested", 1) and return 0;
309
305
  }
310
306
  # fail if we had any serious errors while extracting information
311
307
  if ($capture{Error} or $$info{Error}) {
@@ -412,6 +408,9 @@ sub WritePDF($$)
412
408
  my $tagID;
413
409
  foreach $tagID (sort keys %$newTags) {
414
410
  my $tagInfo = $$newTags{$tagID};
411
+ if ($pdfVer >= 2.0 and not $$tagInfo{PDF2}) {
412
+ next if $et->Warn("Writing PDF:$$tagInfo{Name} is deprecated for PDF 2.0 documents",2);
413
+ }
415
414
  my $nvHash = $et->GetNewValueHash($tagInfo);
416
415
  my (@vals, $deleted);
417
416
  my $tag = $$tagInfo{Name};
@@ -1490,7 +1490,7 @@ sub WriteXMP($$;$)
1490
1490
  my @ns = sort keys %nsCur;
1491
1491
  $long[-2] .= "$nl$sp<$prop rdf:about='${about}'";
1492
1492
  # generate et:toolkit attribute if this is an exiftool RDF/XML output file
1493
- if (@ns and $nsCur{$ns[0]} =~ m{^http://ns.exiftool.(?:ca|org)/}) {
1493
+ if ($$et{XMP_NO_XMPMETA} and @ns and $nsCur{$ns[0]} =~ m{^http://ns.exiftool.(?:ca|org)/}) {
1494
1494
  $long[-2] .= "\n$sp${sp}xmlns:et='http://ns.exiftool.org/1.0/'" .
1495
1495
  " et:toolkit='Image::ExifTool $Image::ExifTool::VERSION'";
1496
1496
  }