1 | #------------------------------------------------------------------------------
|
---|
2 | # File: Nikon.pm
|
---|
3 | #
|
---|
4 | # Description: Nikon EXIF maker notes tags
|
---|
5 | #
|
---|
6 | # Revisions: 12/09/2003 - P. Harvey Created
|
---|
7 | # 05/17/2004 - P. Harvey Added information from Joseph Heled
|
---|
8 | # 09/21/2004 - P. Harvey Changed tag 2 to ISOUsed & added PrintConv
|
---|
9 | # 12/01/2004 - P. Harvey Added default PRINT_CONV
|
---|
10 | # 12/06/2004 - P. Harvey Added SceneMode
|
---|
11 | # 01/01/2005 - P. Harvey Decode preview image and preview IFD
|
---|
12 | # 03/35/2005 - T. Christiansen additions
|
---|
13 | # 05/10/2005 - P. Harvey Decode encrypted lens data
|
---|
14 | #
|
---|
15 | # References: 1) http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
|
---|
16 | # 2) Joseph Heled private communication (tests with D70)
|
---|
17 | # 3) Thomas Walter private communication (tests with Coolpix 5400)
|
---|
18 | # 4) http://www.cybercom.net/~dcoffin/dcraw/
|
---|
19 | # 5) Brian Ristuccia private communication (tests with D70)
|
---|
20 | # 6) Danek Duvall private communication (tests with D70)
|
---|
21 | # 7) Tom Christiansen private communication (tests with D70)
|
---|
22 | # 8) Robert Rottmerhusen private communication
|
---|
23 | # 9) http://members.aol.com/khancock/pilot/nbuddy/
|
---|
24 | # 10) Werner Kober private communication (D2H, D2X, D100, D70, D200)
|
---|
25 | # 11) http://www.rottmerhusen.com/objektives/lensid/thirdparty.html
|
---|
26 | # 12) http://libexif.sourceforge.net/internals/mnote-olympus-tag_8h-source.html
|
---|
27 | # 13) Roger Larsson private communication (tests with D200)
|
---|
28 | # 14) http://homepage3.nifty.com/kamisaka/makernote/makernote_nikon.htm
|
---|
29 | # 15) http://tomtia.plala.jp/DigitalCamera/MakerNote/index.asp
|
---|
30 | # 16) Jeffrey Friedl private communication (D200 with firmware update)
|
---|
31 | # 17) http://www.wohlberg.net/public/software/photo/nstiffexif/
|
---|
32 | # 18) Anonymous user private communication (D70, D200, D2x)
|
---|
33 | # 19) Jens Duttke private communication
|
---|
34 | # 20) Bruce Stevens private communication
|
---|
35 | # 21) Vladimir Sauta private communication (D80)
|
---|
36 | #------------------------------------------------------------------------------
|
---|
37 |
|
---|
38 | package Image::ExifTool::Nikon;
|
---|
39 |
|
---|
40 | use strict;
|
---|
41 | use vars qw($VERSION);
|
---|
42 | use Image::ExifTool qw(:DataAccess :Utils);
|
---|
43 | use Image::ExifTool::Exif;
|
---|
44 |
|
---|
45 | $VERSION = '1.76';
|
---|
46 |
|
---|
47 | # nikon lens ID numbers (ref 8/11)
|
---|
48 | my %nikonLensIDs = (
|
---|
49 | Notes => q{
|
---|
50 | The Nikon LensID is constructed as a Composite tag from the raw hex values
|
---|
51 | of 8 other tags: LensIDNumber, LensFStops, MinFocalLength, MaxFocalLength,
|
---|
52 | MaxApertureAtMinFocal, MaxApertureAtMaxFocal, MCUVersion and LensType, in
|
---|
53 | that order. (source:
|
---|
54 | L<http://www.rottmerhusen.com/objektives/lensid/thirdparty.html>)
|
---|
55 | },
|
---|
56 | # (hex digits must be uppercase in keys below)
|
---|
57 | '01 58 50 50 14 14 02 00' => 'AF Nikkor 50mm f/1.8',
|
---|
58 | '01 00 00 00 00 00 02 00' => 'AF Teleconverter TC-16A 1.6x',
|
---|
59 | '01 00 00 00 00 00 08 00' => 'AF Teleconverter TC-16A 1.6x',
|
---|
60 | '02 42 44 5C 2A 34 02 00' => 'AF Zoom-Nikkor 35-70mm f/3.3-4.5',
|
---|
61 | '02 42 44 5C 2A 34 08 00' => 'AF Zoom-Nikkor 35-70mm f/3.3-4.5',
|
---|
62 | '03 48 5C 81 30 30 02 00' => 'AF Zoom-Nikkor 70-210mm f/4',
|
---|
63 | '04 48 3C 3C 24 24 03 00' => 'AF Nikkor 28mm f/2.8',
|
---|
64 | '05 54 50 50 0C 0C 04 00' => 'AF Nikkor 50mm f/1.4',
|
---|
65 | '06 54 53 53 24 24 06 00' => 'AF Micro-Nikkor 55mm f/2.8',
|
---|
66 | '07 40 3C 62 2C 34 03 00' => 'AF Zoom-Nikkor 28-85mm f/3.5-4.5',
|
---|
67 | '08 40 44 6A 2C 34 04 00' => 'AF Zoom-Nikkor 35-105mm f/3.5-4.5',
|
---|
68 | '09 48 37 37 24 24 04 00' => 'AF Nikkor 24mm f/2.8',
|
---|
69 | '0A 48 8E 8E 24 24 03 00' => 'AF Nikkor 300mm f/2.8 IF-ED',
|
---|
70 | '0B 48 7C 7C 24 24 05 00' => 'AF Nikkor 180mm f/2.8 IF-ED',
|
---|
71 | '0D 40 44 72 2C 34 07 00' => 'AF Zoom-Nikkor 35-135mm f/3.5-4.5',
|
---|
72 | '0E 48 5C 81 30 30 05 00' => 'AF Zoom-Nikkor 70-210mm f/4',
|
---|
73 | '0F 58 50 50 14 14 05 00' => 'AF Nikkor 50mm f/1.8 N',
|
---|
74 | '10 48 8E 8E 30 30 08 00' => 'AF Nikkor 300mm f/4 IF-ED',
|
---|
75 | '11 48 44 5C 24 24 08 00' => 'AF Zoom-Nikkor 35-70mm f/2.8',
|
---|
76 | '12 48 5C 81 30 3C 09 00' => 'AF Nikkor 70-210mm f/4-5.6',
|
---|
77 | '13 42 37 50 2A 34 0B 00' => 'AF Zoom-Nikkor 24-50mm f/3.3-4.5',
|
---|
78 | '14 48 60 80 24 24 0B 00' => 'AF Zoom-Nikkor 80-200mm f/2.8 ED',
|
---|
79 | '15 4C 62 62 14 14 0C 00' => 'AF Nikkor 85mm f/1.8',
|
---|
80 | '17 3C A0 A0 30 30 11 00' => 'Nikkor 500mm f/4 P',
|
---|
81 | '18 40 44 72 2C 34 0E 00' => 'AF Zoom-Nikkor 35-135mm f/3.5-4.5 N',
|
---|
82 | '1A 54 44 44 18 18 11 00' => 'AF Nikkor 35mm f/2',
|
---|
83 | '1B 44 5E 8E 34 3C 10 00' => 'AF Zoom-Nikkor 75-300mm f/4.5-5.6',
|
---|
84 | '1C 48 30 30 24 24 12 00' => 'AF Nikkor 20mm f/2.8',
|
---|
85 | '1D 42 44 5C 2A 34 12 00' => 'AF Zoom-Nikkor 35-70mm f/3.3-4.5 N',
|
---|
86 | '1E 54 56 56 24 24 13 00' => 'AF Micro-Nikkor 60mm f/2.8',
|
---|
87 | '1F 54 6A 6A 24 24 14 00' => 'AF Micro-Nikkor 105mm f/2.8',
|
---|
88 | '20 48 60 80 24 24 15 00' => 'AF Zoom-Nikkor ED 80-200mm f/2.8',
|
---|
89 | '21 40 3C 5C 2C 34 16 00' => 'AF Zoom-Nikkor 28-70mm f/3.5-4.5',
|
---|
90 | '22 48 72 72 18 18 16 00' => 'AF DC-Nikkor 135mm f/2',
|
---|
91 | '24 48 60 80 24 24 1A 02' => 'AF Zoom-Nikkor ED 80-200mm f/2.8D',
|
---|
92 | '25 48 44 5C 24 24 1B 02' => 'AF Zoom-Nikkor 35-70mm f/2.8D',
|
---|
93 | '25 48 44 5C 24 24 52 02' => 'AF Zoom-Nikkor 35-70mm f/2.8D N',
|
---|
94 | '27 48 8E 8E 24 24 F2 02' => 'AF-I Nikkor 300mm f/2.8D IF-ED',
|
---|
95 | '27 48 8E 8E 24 24 1D 02' => 'AF-I Nikkor 300mm f/2.8D IF-ED',
|
---|
96 | '28 3C A6 A6 30 30 1D 02' => 'AF-I Nikkor 600mm f/4D IF-ED',
|
---|
97 | '2A 54 3C 3C 0C 0C 26 02' => 'AF Nikkor 28mm f/1.4D',
|
---|
98 | '2C 48 6A 6A 18 18 27 02' => 'AF DC-Nikkor 105mm f/2D',
|
---|
99 | '2D 48 80 80 30 30 21 02' => 'AF Micro-Nikkor 200mm f/4D IF-ED',
|
---|
100 | '2E 48 5C 82 30 3C 28 02' => 'AF Nikkor 70-210mm f/4-5.6D',
|
---|
101 | '2F 48 30 44 24 24 29 02' => 'AF Zoom-Nikkor 20-35mm f/2.8(IF)',
|
---|
102 | '31 54 56 56 24 24 25 02' => 'AF Micro-Nikkor 60mm f/2.8D',
|
---|
103 | '32 54 6A 6A 24 24 35 02' => 'AF Micro-Nikkor 105mm f/2.8D',
|
---|
104 | '33 48 2D 2D 24 24 31 02' => 'AF Nikkor 18mm f/2.8D',
|
---|
105 | '34 48 29 29 24 24 32 02' => 'AF Fisheye Nikkor 16mm f/2.8D',
|
---|
106 | '36 48 37 37 24 24 34 02' => 'AF Nikkor 24mm f/2.8D',
|
---|
107 | '37 48 30 30 24 24 36 02' => 'AF Nikkor 20mm f/2.8D',
|
---|
108 | '38 4C 62 62 14 14 37 02' => 'AF Nikkor 85mm f/1.8D',
|
---|
109 | '3B 48 44 5C 24 24 3A 02' => 'AF Zoom-Nikkor 35-70mm f/2.8D N',
|
---|
110 | '3D 3C 44 60 30 3C 3E 02' => 'AF Zoom-Nikkor 35-80mm f/4-5.6D',
|
---|
111 | '3E 48 3C 3C 24 24 3D 02' => 'AF Nikkor 28mm f/2.8D',
|
---|
112 | '41 48 7C 7C 24 24 43 02' => 'AF Nikkor 180mm f/2.8D IF-ED',
|
---|
113 | '42 54 44 44 18 18 44 02' => 'AF Nikkor 35mm f/2D',
|
---|
114 | '43 54 50 50 0C 0C 46 02' => 'AF Nikkor 50mm f/1.4D',
|
---|
115 | '46 3C 44 60 30 3C 49 02' => 'AF Zoom-Nikkor 35-80mm f/4-5.6D N',
|
---|
116 | '47 42 37 50 2A 34 4A 02' => 'AF Zoom-Nikkor 24-50mm f/3.3-4.5D',
|
---|
117 | '48 48 8E 8E 24 24 4B 02' => 'AF-S Nikkor 300mm f/2.8D IF-ED',
|
---|
118 | '4A 54 62 62 0C 0C 4D 02' => 'AF Nikkor 85mm f/1.4D IF',
|
---|
119 | '4C 40 37 6E 2C 3C 4F 02' => 'AF Zoom-Nikkor 24-120mm f/3.5-5.6D IF',
|
---|
120 | '4D 40 3C 80 2C 3C 62 02' => 'AF Zoom-Nikkor 28-200mm f/3.5-5.6D IF',
|
---|
121 | '4E 48 72 72 18 18 51 02' => 'AF DC-Nikkor 135mm f/2D',
|
---|
122 | '4F 40 37 5C 2C 3C 53 06' => 'IX-Nikkor 24-70mm f/3.5-5.6',
|
---|
123 | '53 48 60 80 24 24 60 02' => 'AF Zoom-Nikkor 80-200mm f/2.8D ED',
|
---|
124 | '54 44 5C 7C 34 3C 58 02' => 'AF Zoom-Micro Nikkor 70-180mm f/4.5-5.6D ED',
|
---|
125 | '56 48 5C 8E 30 3C 5A 02' => 'AF Zoom-Nikkor 70-300mm f/4-5.6D ED',
|
---|
126 | '59 48 98 98 24 24 5D 02' => 'AF-S Nikkor 400mm f/2.8D IF-ED',
|
---|
127 | '5A 3C 3E 56 30 3C 5E 06' => 'IX-Nikkor 30-60mm f/4-5.6',
|
---|
128 | '5D 48 3C 5C 24 24 63 02' => 'AF-S Zoom-Nikkor 28-70mm f/2.8D IF-ED',
|
---|
129 | '5E 48 60 80 24 24 64 02' => 'AF-S Zoom-Nikkor 80-200mm f/2.8D IF-ED',
|
---|
130 | '5F 40 3C 6A 2C 34 65 02' => 'AF Zoom-Nikkor 28-105mm f/3.5-4.5D IF',
|
---|
131 | '60 40 3C 60 2C 3C 66 02' => 'AF Zoom-Nikkor 28-80mm f/3.5-5.6D', #(http://www.exif.org/forum/topic.asp?TOPIC_ID=16)
|
---|
132 | '61 44 5E 86 34 3C 67 02' => 'AF Zoom-Nikkor 75-240mm f/4.5-5.6D',
|
---|
133 | '63 48 2B 44 24 24 68 02' => 'AF-S Nikkor 17-35mm f/2.8D IF-ED',
|
---|
134 | '64 00 62 62 24 24 6A 02' => 'PC Micro-Nikkor 85mm f/2.8D',
|
---|
135 | '65 44 60 98 34 3C 6B 0A' => 'AF VR Zoom-Nikkor 80-400mm f/4.5-5.6D ED',
|
---|
136 | '66 40 2D 44 2C 34 6C 02' => 'AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED',
|
---|
137 | '67 48 37 62 24 30 6D 02' => 'AF Zoom-Nikkor 24-85mm f/2.8-4D IF',
|
---|
138 | '68 42 3C 60 2A 3C 6E 06' => 'AF Zoom-Nikkor 28-80mm f/3.3-5.6G',
|
---|
139 | '69 48 5C 8E 30 3C 6F 06' => 'AF Zoom-Nikkor 70-300mm f/4-5.6G',
|
---|
140 | '6A 48 8E 8E 30 30 70 02' => 'AF-S Nikkor 300mm f/4D IF-ED',
|
---|
141 | '6B 48 24 24 24 24 71 02' => 'AF Nikkor ED 14mm f/2.8D',
|
---|
142 | '6D 48 8E 8E 24 24 73 02' => 'AF-S Nikkor 300mm f/2.8D IF-ED II',
|
---|
143 | '6E 48 98 98 24 24 74 02' => 'AF-S Nikkor 400mm f/2.8D IF-ED II',
|
---|
144 | '6F 3C A0 A0 30 30 75 02' => 'AF-S Nikkor 500mm f/4D IF-ED',
|
---|
145 | '70 3C A6 A6 30 30 76 02' => 'AF-S Nikkor 600mm f/4D IF-ED',
|
---|
146 | '72 48 4C 4C 24 24 77 00' => 'Nikkor 45mm f/2.8 P',
|
---|
147 | '74 40 37 62 2C 34 78 06' => 'AF-S Zoom-Nikkor 24-85mm f/3.5-4.5G IF-ED',
|
---|
148 | '75 40 3C 68 2C 3C 79 06' => 'AF Zoom-Nikkor 28-100mm f/3.5-5.6G',
|
---|
149 | '76 58 50 50 14 14 7A 02' => 'AF Nikkor 50mm f/1.8D',
|
---|
150 | '77 48 5C 80 24 24 7B 0E' => 'AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED',
|
---|
151 | '78 40 37 6E 2C 3C 7C 0E' => 'AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED',
|
---|
152 | '79 40 3C 80 2C 3C 7F 06' => 'AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED',
|
---|
153 | '7A 3C 1F 37 30 30 7E 06' => 'AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED',
|
---|
154 | '7B 48 80 98 30 30 80 0E' => 'AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED',
|
---|
155 | '7D 48 2B 53 24 24 82 06' => 'AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED',
|
---|
156 | '7F 40 2D 5C 2C 34 84 06' => 'AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED',
|
---|
157 | '80 48 1A 1A 24 24 85 06' => 'AF DX Fisheye-Nikkor 10.5mm f/2.8G ED',
|
---|
158 | '81 54 80 80 18 18 86 0E' => 'AF-S VR Nikkor 200mm f/2G IF-ED',
|
---|
159 | '82 48 8E 8E 24 24 87 0E' => 'AF-S VR Nikkor 300mm f/2.8G IF-ED',
|
---|
160 | '89 3C 53 80 30 3C 8B 06' => 'AF-S DX Zoom-Nikkor 55-200mm f/4-5.6G ED',
|
---|
161 | '8A 54 6A 6A 24 24 8C 0E' => 'AF-S VR Micro-Nikkor 105mm f/2.8G IF-ED', #10
|
---|
162 | '8B 40 2D 80 2C 3C FD 0E' => 'AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED', #21
|
---|
163 | '8B 40 2D 80 2C 3C 8D 0E' => 'AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED',
|
---|
164 | '8C 40 2D 53 2C 3C 8E 06' => 'AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED',
|
---|
165 | '8D 44 5C 8E 34 3C 8F 0E' => 'AF-S VR Zoom-Nikkor 70-300mm f/4.5-5.6G IF-ED', #10
|
---|
166 | '8F 40 2D 72 2C 3C 91 06' => 'AF-S DX Zoom-Nikkor 18-135mm f/3.5-5.6G IF-ED',
|
---|
167 | '90 3B 53 80 30 3C 92 0E' => 'AF-S DX VR Zoom-Nikkor 55-200mm f/4-5.6G IF-ED',
|
---|
168 | '93 48 37 5C 24 24 95 06' => 'AF-S Nikkor 24-70 f/2.8G ED',
|
---|
169 | '94 40 2D 53 2C 3C 96 06' => 'AF-S DX Zoom-Nikkor 18-55mm f/3.5-5.6G ED II', #10 (D40)
|
---|
170 | '96 48 98 98 24 24 98 0E' => 'AF-S Nikkor 400mm f/2.8G ED VR',
|
---|
171 | '98 3C A6 A6 30 30 9A 0E' => 'AF-S Nikkor 600mm f/4G ED VR',
|
---|
172 | #
|
---|
173 | '06 3F 68 68 2C 2C 06 00' => 'Cosina 100mm f/3.5 Macro',
|
---|
174 | #
|
---|
175 | '26 48 11 11 30 30 1C 02' => 'Sigma 8mm F4 EX Circular Fisheye',
|
---|
176 | '79 40 11 11 2C 2C 1C 06' => 'Sigma 8mm F3.5 EX', #19
|
---|
177 | '48 3C 19 31 30 3C 4B 06' => 'Sigma 10-20mm F4-5.6 EX DC HSM',
|
---|
178 | '48 38 1F 37 34 3C 4B 06' => 'Sigma 12-24mm F4.5-5.6 EX Aspherical DG HSM',
|
---|
179 | '02 3F 24 24 2C 2C 02 00' => 'Sigma 14mm F3.5',
|
---|
180 | '48 48 24 24 24 24 4B 02' => 'Sigma 14mm F2.8 EX ASPHERICAL HSM',
|
---|
181 | '26 48 27 27 24 24 1C 02' => 'Sigma 15mm F2.8 EX Diagonal Fish-Eye',
|
---|
182 | '26 40 27 3F 2C 34 1C 02' => 'Sigma 15-30mm F3.5-4.5 EX Aspherical DG DF',
|
---|
183 | '48 48 2B 44 24 30 4B 06' => 'Sigma 17-35mm F2.8-4 EX DG Aspherical HSM',
|
---|
184 | '26 54 2B 44 24 30 1C 02' => 'Sigma 17-35mm F2.8-4 EX ASPHERICAL',
|
---|
185 | '7F 48 2B 5C 24 34 1C 06' => 'Sigma 17-70mm F2.8-4.5 DC MACRO Asp. IF',
|
---|
186 | '26 48 2D 50 24 24 1C 06' => 'Sigma 18-50mm F2.8 EX DC',
|
---|
187 | '26 40 2D 50 2C 3C 1C 06' => 'Sigma 18-50mm F3.5-5.6 DC',
|
---|
188 | '7A 40 2D 50 2C 3C 4B 06' => 'Sigma 18-50mm F3.5-5.6 DC HSM',
|
---|
189 | '26 40 2D 70 2B 3C 1C 06' => 'Sigma 18-125mm F3.5-5.6 DC',
|
---|
190 | '26 40 2D 80 2C 40 1C 06' => 'Sigma 18-200mm F3.5-6.3 DC',
|
---|
191 | '26 58 31 31 14 14 1C 02' => 'Sigma 20mm F1.8 EX Aspherical DG DF RF',
|
---|
192 | '26 58 37 37 14 14 1C 02' => 'Sigma 24mm F1.8 EX Aspherical DG DF MACRO',
|
---|
193 | '02 46 37 37 25 25 02 00' => 'Sigma 24mm F2.8 Macro',
|
---|
194 | '26 48 37 56 24 24 1C 02' => 'Sigma 24-60mm F2.8 EX DG',
|
---|
195 | '26 54 37 5C 24 24 1C 02' => 'Sigma 24-70mm F2.8 EX DG Macro',
|
---|
196 | '67 54 37 5C 24 24 1C 02' => 'Sigma 24-70mm F2.8 EX DG Macro',
|
---|
197 | '26 40 37 5C 2C 3C 1C 02' => 'Sigma 24-70mm F3.5-5.6 ASPHERICAL HF',
|
---|
198 | '26 54 37 73 24 34 1C 02' => 'Sigma 24-135mm F2.8-4.5',
|
---|
199 | '26 58 3C 3C 14 14 1C 02' => 'Sigma 28mm F1.8 EX DG DF',
|
---|
200 | '26 48 3C 5C 24 24 1C 06' => 'Sigma 28-70mm F2.8 EX DG',
|
---|
201 | '26 48 3C 5C 24 30 1C 02' => 'Sigma 28-70mm F2.8-4 HIGH SPEED ZOOM',
|
---|
202 | '02 46 3C 5C 25 25 02 00' => 'Sigma 28-70mm F2.8',
|
---|
203 | '02 3F 3C 5C 2D 35 02 00' => 'Sigma 28-70mm F3.5-4.5 UC',
|
---|
204 | '26 40 3C 60 2C 3C 1C 02' => 'Sigma 28-80mm F3.5-5.6 Mini Zoom Macro II Aspherical',
|
---|
205 | '26 3E 3C 6A 2E 3C 1C 02' => 'Sigma 28-105mm F3.8-5.6 UC-III ASPHERICAL IF',
|
---|
206 | '26 40 3C 80 2C 3C 1C 02' => 'Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro',
|
---|
207 | '26 40 3C 80 2B 3C 1C 02' => 'Sigma 28-200mm F3.5-5.6 Compact Aspherical Hyperzoom Macro',
|
---|
208 | '26 41 3C 8E 2C 40 1C 02' => 'Sigma 28-300mm F3.5-6.3 DG MACRO',
|
---|
209 | '26 40 3C 8E 2C 40 1C 02' => 'Sigma 28-300mm F3.5-6.3 Macro',
|
---|
210 | '48 54 3E 3E 0C 0C 4B 06' => 'Sigma 30mm F1.4 EX DC HSM',
|
---|
211 | '02 40 44 73 2B 36 02 00' => 'Sigma 35-135mm F3.5-4.5 a',
|
---|
212 | '32 54 50 50 24 24 35 02' => 'Sigma 50mm F2.8 EX DG Macro',
|
---|
213 | '7A 47 50 76 24 24 4B 06' => 'Sigma APO 50-150mm F2.8 EX DC HSM',
|
---|
214 | '48 3C 50 A0 30 40 4B 02' => 'Sigma 50-500mm F4-6.3 EX APO RF HSM',
|
---|
215 | '26 3C 54 80 30 3C 1C 06' => 'Sigma 55-200mm F4-5.6 DC',
|
---|
216 | '7A 3B 53 80 30 3C 4B 06' => 'Sigma 55-200mm F4-5.6 DC HSM',
|
---|
217 | '79 48 5C 5C 24 24 1C 06' => 'Sigma 70mm F2.8 EX DG Macro', #19
|
---|
218 | '48 54 5C 80 24 24 4B 02' => 'Sigma 70-200mm F2.8 EX APO IF HSM',
|
---|
219 | '02 46 5C 82 25 25 02 00' => 'Sigma 70-210mm F2.8 APO', #19
|
---|
220 | '26 3C 5C 82 30 3C 1C 02' => 'Sigma 70-210mm F4-5.6 UC-II',
|
---|
221 | '26 3C 5C 8E 30 3C 1C 02' => 'Sigma 70-300mm F4-5.6 DG MACRO',
|
---|
222 | '56 3C 5C 8E 30 3C 1C 02' => 'Sigma 70-300mm F4-5.6 APO Macro Super II',
|
---|
223 | '02 37 5E 8E 35 3D 02 00' => 'Sigma 75-300mm F4.5-5.6 APO',
|
---|
224 | '02 48 65 65 24 24 02 00' => 'Sigma 90mm F2.8 Macro',
|
---|
225 | '77 44 61 98 34 3C 7B 0E' => 'Sigma 80-400mm f4.5-5.6 EX OS',
|
---|
226 | '48 48 68 8E 30 30 4B 02' => 'Sigma 100-300mm F4 EX IF HSM',
|
---|
227 | '48 54 6F 8E 24 24 4B 02' => 'Sigma APO 120-300mm F2.8 EX DG HSM',
|
---|
228 | '26 44 73 98 34 3C 1C 02' => 'Sigma 135-400mm F4.5-5.6 APO Aspherical',
|
---|
229 | '48 48 76 76 24 24 4B 06' => 'Sigma 150mm F2.8 EX DG APO Macro HSM',
|
---|
230 | '48 4C 7C 7C 2C 2C 4B 02' => 'Sigma 180mm F3.5 EX DG Macro', #19
|
---|
231 | '26 40 7B A0 34 40 1C 02' => 'Sigma APO 170-500mm F5-6.3 ASPHERICAL RF',
|
---|
232 | '48 4C 7D 7D 2C 2C 4B 02' => 'Sigma APO MACRO 180mm F3.5 EX DG HSM',
|
---|
233 | '48 54 8E 8E 24 24 4B 02' => 'Sigma APO 300mm F2.8 EX DG HSM',
|
---|
234 | '26 48 8E 8E 30 30 1C 02' => 'Sigma APO TELE MACRO 300mm F4',
|
---|
235 | '48 3C 8E B0 3C 3C 4B 02' => 'Sigma APO 300-800 F5.6 EX DG HSM',
|
---|
236 | '02 2F 98 98 3D 3D 02 00' => 'Sigma 400mm F5.6 APO',
|
---|
237 | '02 37 A0 A0 34 34 02 00' => 'Sigma APO 500mm F4.5', #20
|
---|
238 | #
|
---|
239 | '03 43 5C 81 35 35 02 00' => 'Soligor AF C/D ZOOM UMCS 70-210mm 1:4.5',
|
---|
240 | #
|
---|
241 | '00 40 18 2B 2C 34 00 06' => 'Tokina AT-X 107 DX Fish-Eye - AF 10-17mm F3.5-4.5',
|
---|
242 | '00 3C 1F 37 30 30 00 06' => 'Tokina AT-X 124 AF PRO DX - AF 12-24mm F4',
|
---|
243 | '00 48 29 50 24 24 00 06' => 'Tokina AT-X 165 PRO DX - AF 16-50mm F2.8',
|
---|
244 | '00 40 2B 2B 2C 2C 00 02' => 'Tokina AT-X 17 AF PRO - AF 17mm F3.5',
|
---|
245 | '25 48 3C 5C 24 24 1B 02' => 'Tokina AT-X 287 AF PRO SV 28-70mm F2.8',
|
---|
246 | '00 48 3C 60 24 24 00 02' => 'Tokina AT-X 280 AF PRO 28-80mm F2.8 ASPHERICAL',
|
---|
247 | '00 48 50 72 24 24 00 06' => 'Tokina AT-X 535 PRO DX - AF 50-135mm F2.8',
|
---|
248 | '14 54 60 80 24 24 0B 00' => 'Tokina AT-X 828 AF 80-200mm F2.8',
|
---|
249 | '24 44 60 98 34 3C 1A 02' => 'Tokina AT-X 840 AF II 80-400mm F4.5-5.6',
|
---|
250 | '00 44 60 98 34 3C 00 02' => 'Tokina AT-X 840D 80-400mm F4.5-5.6', #PH
|
---|
251 | '00 54 68 68 24 24 00 02' => 'Tokina AT-X M100 PRO D - 100mm F2.8',
|
---|
252 | '14 48 68 8E 30 30 0B 00' => 'Tokina AT-X 340 AF II 100-300mm F4',
|
---|
253 | '00 54 8E 8E 24 24 00 02' => 'Tokina AT-X 300 AF PRO 300mm F2.8',
|
---|
254 | #
|
---|
255 | '00 36 1C 2D 34 3C 00 06' => 'Tamron SP AF11-18mm f/4.5-5.6 Di II LD Aspherical (IF)',
|
---|
256 | '07 46 2B 44 24 30 03 02' => 'Tamron SP AF17-35mm f/2.8-4 Di LD Aspherical (IF)',
|
---|
257 | '00 53 2B 50 24 24 00 06' => 'Tamron SP AF17-50mm f/2.8 (A16)', #PH
|
---|
258 | '00 3F 2D 80 2B 40 00 06' => 'Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF)',
|
---|
259 | '00 3F 2D 80 2C 40 00 06' => 'Tamron AF18-200mm f/3.5-6.3 XR Di II LD Aspherical (IF) Macro',
|
---|
260 | '07 40 2F 44 2C 34 03 02' => 'Tamron AF19-35mm f/3.5-4.5 N',
|
---|
261 | '07 40 30 45 2D 35 03 02' => 'Tamron AF19-35mm f/3.5-4.5',
|
---|
262 | '00 49 30 48 22 2B 00 02' => 'Tamron SP AF20-40mm f/2.7-3.5',
|
---|
263 | '0E 4A 31 48 23 2D 0E 02' => 'Tamron SP AF20-40mm f/2.7-3.5',
|
---|
264 | '45 41 37 72 2C 3C 48 02' => 'Tamron SP AF24-135mm f/3.5-5.6 AD Aspherical (IF) Macro',
|
---|
265 | '33 54 3C 5E 24 24 62 02' => 'Tamron SP AF28-75mm f/2.8 XR Di LD Aspherical (IF) Macro',
|
---|
266 | '10 3D 3C 60 2C 3C D2 02' => 'Tamron AF28-80mm f/3.5-5.6 Aspherical',
|
---|
267 | '45 3D 3C 60 2C 3C 48 02' => 'Tamron AF28-80mm f/3.5-5.6 Aspherical',
|
---|
268 | '00 48 3C 6A 24 24 00 02' => 'Tamron SP AF28-105mm f/2.8',
|
---|
269 | '0B 3E 3D 7F 2F 3D 0E 02' => 'Tamron AF28-200mm f/3.8-5.6D',
|
---|
270 | '0B 3E 3D 7F 2F 3D 0E 00' => 'Tamron AF28-200mm f/3.8-5.6',
|
---|
271 | '4D 41 3C 8E 2B 40 62 02' => 'Tamron AF28-300mm f/3.5-6.3 XR Di LD Aspherical (IF)',
|
---|
272 | '4D 41 3C 8E 2C 40 62 02' => 'Tamron AF28-300mm f/3.5-6.3D',
|
---|
273 | '69 48 5C 8E 30 3C 6F 02' => 'Tamron AF70-300mm f/4-5.6 LD Macro 1:2',
|
---|
274 | '32 53 64 64 24 24 35 02' => 'Tamron SP AF90mm f/2.8 Di 1:1 Macro',
|
---|
275 | '00 4C 7C 7C 2C 2C 00 02' => 'Tamron SP AF180mm f/3.5 Di Model B01',
|
---|
276 | '20 3C 80 98 3D 3D 1E 02' => 'Tamron AF200-400mm f/5.6 LD IF',
|
---|
277 | '00 3E 80 A0 38 3F 00 02' => 'Tamron SP AF200-500mm f/5-6.3 Di LD (IF)',
|
---|
278 | '00 3F 80 A0 38 3F 00 02' => 'Tamron SP AF200-500mm f/5-6.3 Di',
|
---|
279 | #
|
---|
280 | '00 00 00 00 00 00 00 01' => 'Manual Lens No CPU',
|
---|
281 | '1E 5D 64 64 20 20 13 00' => 'Unknown 90mm f/2.5',
|
---|
282 | '2F 40 30 44 2C 34 29 02' => 'Unknown 20-35mm f/3.5-4.5D',
|
---|
283 | '12 3B 68 8D 3D 43 09 02' => 'Unknown 100-290mm f/5.6-6.7',
|
---|
284 | );
|
---|
285 |
|
---|
286 | # Nikon maker note tags
|
---|
287 | %Image::ExifTool::Nikon::Main = (
|
---|
288 | PROCESS_PROC => \&Image::ExifTool::Nikon::ProcessNikon,
|
---|
289 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
|
---|
290 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
|
---|
291 | WRITABLE => 1,
|
---|
292 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
293 | PRINT_CONV => 'Image::ExifTool::Nikon::FormatString($val)',
|
---|
294 | 0x0001 => { #2
|
---|
295 | # the format differs for different models. for D70, this is a string '0210',
|
---|
296 | # but for the E775 it is binary: "\x00\x01\x00\x00"
|
---|
297 | Name => 'MakerNoteVersion',
|
---|
298 | Writable => 'undef',
|
---|
299 | Count => 4,
|
---|
300 | # convert to string if binary
|
---|
301 | ValueConv => '$_=$val; /^[\x00-\x09]/ and $_=join("",unpack("CCCC",$_)); $_',
|
---|
302 | ValueConvInv => '$val',
|
---|
303 | PrintConv => '$_=$val;s/^(\d{2})/$1\./;s/^0//;$_',
|
---|
304 | PrintConvInv => '$_=$val;s/\.//;"0$_"',
|
---|
305 | },
|
---|
306 | 0x0002 => {
|
---|
307 | # this is the ISO actually used by the camera
|
---|
308 | # (may be different than ISO setting if auto)
|
---|
309 | Name => 'ISO',
|
---|
310 | Writable => 'int16u',
|
---|
311 | Count => 2,
|
---|
312 | Priority => 0, # the EXIF ISO is more reliable
|
---|
313 | Groups => { 2 => 'Image' },
|
---|
314 | # first number is 1 for "Hi ISO" modes (H0.3, H0.7 and H1.0 on D80) - PH
|
---|
315 | PrintConv => '$_=$val;s/^0 //;s/^1 (\d+)/Hi $1/;$_',
|
---|
316 | PrintConvInv => '$_=$val;/^\d+/ ? "0 $_" : (s/Hi ?//i ? "1 $_" : $_)',
|
---|
317 | },
|
---|
318 | 0x0003 => { Name => 'ColorMode', Writable => 'string' },
|
---|
319 | 0x0004 => { Name => 'Quality', Writable => 'string' },
|
---|
320 | 0x0005 => { Name => 'WhiteBalance', Writable => 'string' },
|
---|
321 | 0x0006 => { Name => 'Sharpness', Writable => 'string' },
|
---|
322 | 0x0007 => { Name => 'FocusMode', Writable => 'string' },
|
---|
323 | 0x0008 => { Name => 'FlashSetting', Writable => 'string' },
|
---|
324 | # FlashType shows 'Built-in,TTL' when builtin flash fires,
|
---|
325 | # and 'Optional,TTL' when external flash is used (ref 2)
|
---|
326 | 0x0009 => { #2
|
---|
327 | Name => 'FlashType',
|
---|
328 | Writable => 'string',
|
---|
329 | Count => 13,
|
---|
330 | },
|
---|
331 | 0x000b => { Name => 'WhiteBalanceFineTune', Writable => 'int16s' }, #2
|
---|
332 | 0x000c => {
|
---|
333 | Name => 'ColorBalance1',
|
---|
334 | Writable => 'rational64u',
|
---|
335 | Count => 4,
|
---|
336 | },
|
---|
337 | 0x000d => { #15
|
---|
338 | Name => 'ProgramShift',
|
---|
339 | Writable => 'undef',
|
---|
340 | Count => 4,
|
---|
341 | ValueConv => 'my ($a,$b,$c)=unpack("c3",$val); $c ? $a*($b/$c) : 0',
|
---|
342 | ValueConvInv => q{
|
---|
343 | my $a = int($val*6 + ($val>0 ? 0.5 : -0.5));
|
---|
344 | $a<-128 or $a>127 ? undef : pack("c4",$a,1,6,0);
|
---|
345 | },
|
---|
346 | PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
|
---|
347 | PrintConvInv => 'eval $val',
|
---|
348 | },
|
---|
349 | 0x000e => {
|
---|
350 | Name => 'ExposureDifference',
|
---|
351 | Writable => 'undef',
|
---|
352 | Count => 4,
|
---|
353 | ValueConv => 'my ($a,$b,$c)=unpack("c3",$val); $c ? $a*($b/$c) : 0',
|
---|
354 | ValueConvInv => q{
|
---|
355 | my $a = int($val*12 + ($val>0 ? 0.5 : -0.5));
|
---|
356 | $a<-128 or $a>127 ? undef : pack("c4",$a,1,12,0);
|
---|
357 | },
|
---|
358 | PrintConv => '$val ? sprintf("%+.1f",$val) : 0',
|
---|
359 | PrintConvInv => '$val',
|
---|
360 | },
|
---|
361 | 0x000f => { Name => 'ISOSelection', Writable => 'string' }, #2
|
---|
362 | 0x0010 => {
|
---|
363 | Name => 'DataDump',
|
---|
364 | Writable => 0,
|
---|
365 | Binary => 1,
|
---|
366 | },
|
---|
367 | 0x0011 => {
|
---|
368 | Name => 'NikonPreview',
|
---|
369 | Groups => { 1 => 'NikonPreview', 2 => 'Image' },
|
---|
370 | Flags => 'SubIFD',
|
---|
371 | SubDirectory => {
|
---|
372 | TagTable => 'Image::ExifTool::Nikon::PreviewImage',
|
---|
373 | Start => '$val',
|
---|
374 | },
|
---|
375 | },
|
---|
376 | 0x0012 => { #2
|
---|
377 | Name => 'FlashExposureComp',
|
---|
378 | Description => 'Flash Exposure Compensation',
|
---|
379 | Writable => 'undef',
|
---|
380 | Count => 4,
|
---|
381 | ValueConv => 'my ($a,$b,$c)=unpack("c3",$val); $c ? $a*($b/$c) : 0',
|
---|
382 | ValueConvInv => q{
|
---|
383 | my $a = int($val*6 + ($val>0 ? 0.5 : -0.5));
|
---|
384 | $a<-128 or $a>127 ? undef : pack("c4",$a,1,6,0);
|
---|
385 | },
|
---|
386 | PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
|
---|
387 | PrintConvInv => 'eval $val',
|
---|
388 | },
|
---|
389 | # D70 - another ISO tag
|
---|
390 | 0x0013 => { #2
|
---|
391 | Name => 'ISOSetting',
|
---|
392 | Writable => 'int16u',
|
---|
393 | Count => 2,
|
---|
394 | PrintConv => '$_=$val;s/^0 //;$_',
|
---|
395 | PrintConvInv => '"0 $val"',
|
---|
396 | },
|
---|
397 | # D70 Image boundary?? top x,y bot-right x,y
|
---|
398 | 0x0016 => { #2
|
---|
399 | Name => 'ImageBoundary',
|
---|
400 | Writable => 'int16u',
|
---|
401 | Count => 4,
|
---|
402 | },
|
---|
403 | 0x0018 => { #5
|
---|
404 | Name => 'FlashExposureBracketValue',
|
---|
405 | Writable => 'undef',
|
---|
406 | Count => 4,
|
---|
407 | ValueConv => 'my ($a,$b,$c)=unpack("c3",$val); $c ? $a*($b/$c) : 0',
|
---|
408 | ValueConvInv => q{
|
---|
409 | my $a = int($val*6 + ($val>0 ? 0.5 : -0.5));
|
---|
410 | $a<-128 or $a>127 ? undef : pack("c4",$a,1,6,0);
|
---|
411 | },
|
---|
412 | PrintConv => 'sprintf("%.1f",$val)',
|
---|
413 | PrintConvInv => '$val',
|
---|
414 | },
|
---|
415 | 0x0019 => { #5
|
---|
416 | Name => 'ExposureBracketValue',
|
---|
417 | Writable => 'rational64s',
|
---|
418 | PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
|
---|
419 | PrintConvInv => 'eval $val',
|
---|
420 | },
|
---|
421 | 0x001a => { #PH
|
---|
422 | Name => 'ImageProcessing',
|
---|
423 | Writable => 'string',
|
---|
424 | },
|
---|
425 | 0x001b => { #15
|
---|
426 | Name => 'CropHiSpeed',
|
---|
427 | Writable => 'int16u',
|
---|
428 | Count => 7,
|
---|
429 | PrintConv => q{
|
---|
430 | my @a = split ' ', $val;
|
---|
431 | return "Unknown ($val)" unless @a == 7;
|
---|
432 | $a[0] = $a[0] ? "On" : "Off";
|
---|
433 | return "$a[0] ($a[1]x$a[2] cropped to $a[3]x$a[4] at pixel $a[5],$a[6])";
|
---|
434 | }
|
---|
435 | },
|
---|
436 | 0x001d => { #4
|
---|
437 | Name => 'SerialNumber',
|
---|
438 | Writable => 0,
|
---|
439 | Notes => 'Not writable because this value is used as a key to decrypt other information',
|
---|
440 | RawConv => '$self->{NikonInfo}->{SerialNumber} = $val',
|
---|
441 | },
|
---|
442 | 0x001e => { #14
|
---|
443 | Name => 'ColorSpace',
|
---|
444 | Writable => 'int16u',
|
---|
445 | PrintConv => {
|
---|
446 | 1 => 'sRGB',
|
---|
447 | 2 => 'Adobe RGB',
|
---|
448 | },
|
---|
449 | },
|
---|
450 | 0x0020 => { #16
|
---|
451 | Name => 'ImageAuthentication',
|
---|
452 | Writable => 'int8u',
|
---|
453 | PrintConv => { 0 => 'Off', 1 => 'On' },
|
---|
454 | },
|
---|
455 | 0x0080 => { Name => 'ImageAdjustment', Writable => 'string' },
|
---|
456 | 0x0081 => { Name => 'ToneComp', Writable => 'string' }, #2
|
---|
457 | 0x0082 => { Name => 'AuxiliaryLens', Writable => 'string' },
|
---|
458 | 0x0083 => {
|
---|
459 | Name => 'LensType',
|
---|
460 | Writable => 'int8u',
|
---|
461 | # credit to Tom Christiansen (ref 7) for figuring this out...
|
---|
462 | PrintConv => q[$_ = $val ? Image::ExifTool::DecodeBits($val,
|
---|
463 | {
|
---|
464 | 0 => 'MF',
|
---|
465 | 1 => 'D',
|
---|
466 | 2 => 'G',
|
---|
467 | 3 => 'VR',
|
---|
468 | }) : 'AF';
|
---|
469 | # remove commas and change "D G" to just "G"
|
---|
470 | s/,//g; s/\bD G\b/G/; $_
|
---|
471 | ],
|
---|
472 | PrintConvInv => q[
|
---|
473 | my $bits = 0;
|
---|
474 | $bits |= 0x01 if $val =~ /\bMF\b/i;
|
---|
475 | $bits |= 0x02 if $val =~ /\bD\b/i;
|
---|
476 | $bits |= 0x06 if $val =~ /\bG\b/i;
|
---|
477 | $bits |= 0x08 if $val =~ /\bVR\b/i;
|
---|
478 | return $bits;
|
---|
479 | ],
|
---|
480 | },
|
---|
481 | 0x0084 => { #2
|
---|
482 | Name => "Lens",
|
---|
483 | Writable => 'rational64u',
|
---|
484 | Count => 4,
|
---|
485 | # short focal, long focal, aperture at short focal, aperture at long focal
|
---|
486 | PrintConv => q{
|
---|
487 | $val =~ tr/,/./; # in case locale is whacky
|
---|
488 | my ($a,$b,$c,$d) = split ' ', $val;
|
---|
489 | ($a==$b ? $a : "$a-$b") . "mm f/" . ($c==$d ? $c : "$c-$d")
|
---|
490 | },
|
---|
491 | PrintConvInv => '$_=$val; tr/a-z\///d; s/(^|\s)([0-9.]+)(?=\s|$)/$1$2-$2/g; s/-/ /g; $_',
|
---|
492 | },
|
---|
493 | 0x0085 => {
|
---|
494 | Name => 'ManualFocusDistance',
|
---|
495 | Writable => 'rational64u',
|
---|
496 | },
|
---|
497 | 0x0086 => {
|
---|
498 | Name => 'DigitalZoom',
|
---|
499 | Writable => 'rational64u',
|
---|
500 | },
|
---|
501 | 0x0087 => { #5
|
---|
502 | Name => 'FlashMode',
|
---|
503 | Writable => 'int8u',
|
---|
504 | PrintConv => {
|
---|
505 | 0 => 'Did Not Fire',
|
---|
506 | 1 => 'Fired, Manual', #14
|
---|
507 | 7 => 'Fired, External', #14
|
---|
508 | 8 => 'Fired, Commander Mode',
|
---|
509 | 9 => 'Fired, TTL Mode',
|
---|
510 | },
|
---|
511 | },
|
---|
512 | 0x0088 => {
|
---|
513 | Name => 'AFInfo',
|
---|
514 | SubDirectory => {
|
---|
515 | TagTable => 'Image::ExifTool::Nikon::AFInfo',
|
---|
516 | },
|
---|
517 | },
|
---|
518 | 0x0089 => { #5
|
---|
519 | Name => 'ShootingMode',
|
---|
520 | Writable => 'int16u',
|
---|
521 | # credit to Tom Christiansen (ref 7) for figuring this out...
|
---|
522 | # The (new?) bit 5 seriously complicates our life here: after firmwareB's
|
---|
523 | # 1.03, bit 5 turns on when you ask for BUT DO NOT USE the long-range
|
---|
524 | # noise reduction feature, probably because even not using it, it still
|
---|
525 | # slows down your drive operation to 50% (1.5fps max not 3fps). But no
|
---|
526 | # longer does !$val alone indicate single-frame operation. - TC
|
---|
527 | PrintConv => q[
|
---|
528 | $_ = '';
|
---|
529 | unless ($val & 0x87) {
|
---|
530 | return 'Single-Frame' unless $val;
|
---|
531 | $_ = 'Single-Frame, ';
|
---|
532 | }
|
---|
533 | return $_ . Image::ExifTool::DecodeBits($val,
|
---|
534 | {
|
---|
535 | 0 => 'Continuous',
|
---|
536 | 1 => 'Delay',
|
---|
537 | 2 => 'PC Control',
|
---|
538 | 4 => 'Exposure Bracketing',
|
---|
539 | 5 => 'Unused LE-NR Slowdown',
|
---|
540 | 6 => 'White-Balance Bracketing',
|
---|
541 | 7 => 'IR Control',
|
---|
542 | });
|
---|
543 | ],
|
---|
544 | },
|
---|
545 | 0x008a => { #15
|
---|
546 | Name => 'AutoBracketRelease',
|
---|
547 | Writable => 'int16u',
|
---|
548 | PrintConv => {
|
---|
549 | 0 => 'None',
|
---|
550 | 1 => 'Auto Release',
|
---|
551 | 2 => 'Manual Release',
|
---|
552 | },
|
---|
553 | },
|
---|
554 | 0x008b => { #8
|
---|
555 | Name => 'LensFStops',
|
---|
556 | ValueConv => 'my ($a,$b,$c)=unpack("C3",$val); $c ? $a*($b/$c) : 0',
|
---|
557 | ValueConvInv => 'my $a=int($val*12+0.5);$a<256 ? pack("C4",$a,1,12,0) : undef',
|
---|
558 | PrintConv => 'sprintf("%.2f", $val)',
|
---|
559 | PrintConvInv => '$val',
|
---|
560 | Writable => 'undef',
|
---|
561 | Count => 4,
|
---|
562 | },
|
---|
563 | 0x008c => {
|
---|
564 | Name => 'NEFCurve1',
|
---|
565 | Writable => 0,
|
---|
566 | Binary => 1,
|
---|
567 | },
|
---|
568 | 0x008d => { Name => 'ColorHue' , Writable => 'string' }, #2
|
---|
569 | # SceneMode takes on the following values: PORTRAIT, PARTY/INDOOR, NIGHT PORTRAIT,
|
---|
570 | # BEACH/SNOW, LANDSCAPE, SUNSET, NIGHT SCENE, MUSEUM, FIREWORKS, CLOSE UP, COPY,
|
---|
571 | # BACK LIGHT, PANORAMA ASSIST, SPORT, DAWN/DUSK
|
---|
572 | 0x008f => { Name => 'SceneMode', Writable => 'string' }, #2
|
---|
573 | # LightSource shows 3 values COLORED SPEEDLIGHT NATURAL.
|
---|
574 | # (SPEEDLIGHT when flash goes. Have no idea about difference between other two.)
|
---|
575 | 0x0090 => { Name => 'LightSource', Writable => 'string' }, #2
|
---|
576 | 0x0091 => [ #18
|
---|
577 | {
|
---|
578 | Condition => '$$valPt =~ /^02/',
|
---|
579 | Name => 'ShotInfo',
|
---|
580 | Writable => 0, # can't yet write encrypted data
|
---|
581 | SubDirectory => {
|
---|
582 | TagTable => 'Image::ExifTool::Nikon::ShotInfo',
|
---|
583 | ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
|
---|
584 | DecryptStart => 4,
|
---|
585 | DecryptLen => 0x24e,
|
---|
586 | },
|
---|
587 | },
|
---|
588 | {
|
---|
589 | Name => 'ShotInfo',
|
---|
590 | Writable => 0,
|
---|
591 | Unknown => 1, # no tags known so don't process unless necessary
|
---|
592 | SubDirectory => {
|
---|
593 | TagTable => 'Image::ExifTool::Nikon::ShotInfo',
|
---|
594 | DirOffset => 4,
|
---|
595 | },
|
---|
596 | },
|
---|
597 | ],
|
---|
598 | 0x0092 => { #2
|
---|
599 | Name => 'HueAdjustment',
|
---|
600 | Writable => 'int16s',
|
---|
601 | },
|
---|
602 | # this doesn't look right:
|
---|
603 | # 0x0093 => { #15
|
---|
604 | # Name => 'SaturationAdjustment',
|
---|
605 | # Writable => 'int16s',
|
---|
606 | # },
|
---|
607 | 0x0094 => { Name => 'Saturation', Writable => 'int16s' },
|
---|
608 | 0x0095 => { Name => 'NoiseReduction', Writable => 'string' },
|
---|
609 | 0x0096 => {
|
---|
610 | Name => 'NEFCurve2',
|
---|
611 | Writable => 0,
|
---|
612 | Binary => 1,
|
---|
613 | },
|
---|
614 | 0x0097 => [ #4
|
---|
615 | {
|
---|
616 | Condition => '$$valPt =~ /^0100/', # (D100)
|
---|
617 | Name => 'ColorBalance0100',
|
---|
618 | SubDirectory => {
|
---|
619 | Start => '$valuePtr + 72',
|
---|
620 | TagTable => 'Image::ExifTool::Nikon::ColorBalance1',
|
---|
621 | },
|
---|
622 | },
|
---|
623 | {
|
---|
624 | Condition => '$$valPt =~ /^0102/', # (D2H)
|
---|
625 | Name => 'ColorBalance0102',
|
---|
626 | SubDirectory => {
|
---|
627 | Start => '$valuePtr + 10',
|
---|
628 | TagTable => 'Image::ExifTool::Nikon::ColorBalance2',
|
---|
629 | },
|
---|
630 | },
|
---|
631 | {
|
---|
632 | Condition => '$$valPt =~ /^0103/', # (D70)
|
---|
633 | Name => 'ColorBalance0103',
|
---|
634 | # D70: at file offset 'tag-value + base + 20', 4 16 bits numbers,
|
---|
635 | # v[0]/v[1] , v[2]/v[3] are the red/blue multipliers.
|
---|
636 | SubDirectory => {
|
---|
637 | Start => '$valuePtr + 20',
|
---|
638 | TagTable => 'Image::ExifTool::Nikon::ColorBalance3',
|
---|
639 | },
|
---|
640 | },
|
---|
641 | {
|
---|
642 | Condition => '$$valPt =~ /^0205/', # (D50)
|
---|
643 | Name => 'ColorBalance0205',
|
---|
644 | Writable => 0, # can't yet write encrypted data
|
---|
645 | SubDirectory => {
|
---|
646 | TagTable => 'Image::ExifTool::Nikon::ColorBalance2',
|
---|
647 | ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
|
---|
648 | DecryptStart => 4,
|
---|
649 | DecryptLen => 22, # 284 bytes encrypted, but don't need to decrypt it all
|
---|
650 | DirOffset => 14,
|
---|
651 | },
|
---|
652 | },
|
---|
653 | {
|
---|
654 | Condition => '$$valPt =~ /^02/', # (D2X=0204,D2Hs=0206,D200=0207,D40=0208)
|
---|
655 | Name => 'ColorBalance02',
|
---|
656 | Writable => 0, # can't yet write encrypted data
|
---|
657 | SubDirectory => {
|
---|
658 | TagTable => 'Image::ExifTool::Nikon::ColorBalance2',
|
---|
659 | ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
|
---|
660 | DecryptStart => 284,
|
---|
661 | DecryptLen => 14, # 324 bytes encrypted, but don't need to decrypt it all
|
---|
662 | DirOffset => 6,
|
---|
663 | },
|
---|
664 | },
|
---|
665 | {
|
---|
666 | Name => 'ColorBalanceUnknown',
|
---|
667 | Writable => 0,
|
---|
668 | },
|
---|
669 | ],
|
---|
670 | 0x0098 => [
|
---|
671 | { #8
|
---|
672 | Condition => '$$valPt =~ /^0100/', # D100, D1X - PH
|
---|
673 | Name => 'LensData0100',
|
---|
674 | SubDirectory => {
|
---|
675 | TagTable => 'Image::ExifTool::Nikon::LensData00',
|
---|
676 | },
|
---|
677 | },
|
---|
678 | { #8
|
---|
679 | Condition => '$$valPt =~ /^0101/', # D70, D70s - PH
|
---|
680 | Name => 'LensData0101',
|
---|
681 | SubDirectory => {
|
---|
682 | TagTable => 'Image::ExifTool::Nikon::LensData01',
|
---|
683 | },
|
---|
684 | },
|
---|
685 | # note: this information is encrypted if the version is 02xx
|
---|
686 | { #8
|
---|
687 | # 0201 - D200, D2Hs, D2X and D2Xs
|
---|
688 | # 0202 - D40, D40X and D80
|
---|
689 | # 0203 - D300
|
---|
690 | Condition => '$$valPt =~ /^020[1-3]/',
|
---|
691 | Name => 'LensData0201',
|
---|
692 | Writable => 0, # can't yet write encrypted data
|
---|
693 | SubDirectory => {
|
---|
694 | TagTable => 'Image::ExifTool::Nikon::LensData01',
|
---|
695 | ProcessProc => \&Image::ExifTool::Nikon::ProcessNikonEncrypted,
|
---|
696 | DecryptStart => 4,
|
---|
697 | },
|
---|
698 | },
|
---|
699 | {
|
---|
700 | Name => 'LensDataUnknown',
|
---|
701 | Writable => 0,
|
---|
702 | },
|
---|
703 | ],
|
---|
704 | 0x0099 => { #2/15
|
---|
705 | Name => 'RawImageCenter',
|
---|
706 | Writable => 'int16u',
|
---|
707 | Count => 2,
|
---|
708 | },
|
---|
709 | 0x009a => { #10
|
---|
710 | Name => 'SensorPixelSize',
|
---|
711 | Writable => 'rational64u',
|
---|
712 | Count => 2,
|
---|
713 | PrintConv => '$val=~s/ / x /;"$val um"',
|
---|
714 | PrintConvInv => '$val=~tr/a-zA-Z/ /;$val',
|
---|
715 | },
|
---|
716 | # 0x009c - observed values: "", "TWO-SHOT" - PH
|
---|
717 | 0x00a0 => { Name => 'SerialNumber', Writable => 'string' }, #2
|
---|
718 | 0x00a2 => { # size of compressed image data plus EOI segment (ref 10)
|
---|
719 | Name => 'ImageDataSize',
|
---|
720 | Writable => 'int32u',
|
---|
721 | },
|
---|
722 | 0x00a5 => { #15
|
---|
723 | Name => 'ImageCount',
|
---|
724 | Writable => 'int32u',
|
---|
725 | },
|
---|
726 | 0x00a6 => { #15
|
---|
727 | Name => 'DeletedImageCount',
|
---|
728 | Writable => 'int32u',
|
---|
729 | },
|
---|
730 | # the sum of 0xa5 and 0xa6 is equal to 0xa7 ShutterCount (D2X,D2Hs,D2H,D200, ref 10)
|
---|
731 | 0x00a7 => { # Number of shots taken by camera so far (ref 2)
|
---|
732 | Name => 'ShutterCount',
|
---|
733 | Writable => 0,
|
---|
734 | Notes => 'Not writable because this value is used as a key to decrypt other information',
|
---|
735 | RawConv => '$self->{NikonInfo}->{ShutterCount} = $val',
|
---|
736 | },
|
---|
737 | 0x00a9 => { #2
|
---|
738 | Name => 'ImageOptimization',
|
---|
739 | Writable => 'string',
|
---|
740 | Count => 16,
|
---|
741 | },
|
---|
742 | 0x00aa => { Name => 'Saturation', Writable => 'string' }, #2
|
---|
743 | 0x00ab => { Name => 'VariProgram', Writable => 'string' }, #2
|
---|
744 | 0x00ac => { Name => 'ImageStabilization',Writable=> 'string' }, #14
|
---|
745 | 0x00ad => { Name => 'AFResponse', Writable => 'string' }, #14
|
---|
746 | 0x00b0 => { #PH
|
---|
747 | Name => 'MultiExposure',
|
---|
748 | Condition => '$$valPt =~ /^0100/',
|
---|
749 | SubDirectory => {
|
---|
750 | TagTable => 'Image::ExifTool::Nikon::MultiExposure',
|
---|
751 | },
|
---|
752 | },
|
---|
753 | 0x00b1 => { #14/PH/19 (D80)
|
---|
754 | Name => 'HighISONoiseReduction',
|
---|
755 | Writable => 'int16u',
|
---|
756 | PrintConv => {
|
---|
757 | 0 => 'Off',
|
---|
758 | 1 => 'Minimal', # for high ISO (>800) when setting is "Off"
|
---|
759 | 2 => 'Low', # Low,Normal,High take effect for ISO > 400
|
---|
760 | 4 => 'Normal',
|
---|
761 | 6 => 'High',
|
---|
762 | },
|
---|
763 | },
|
---|
764 | # 0x00b2 (string: 'Normal', 0xc3's, 0xff's or 0x20's)
|
---|
765 | 0x0e00 => {
|
---|
766 | Name => 'PrintIM',
|
---|
767 | Description => 'Print Image Matching',
|
---|
768 | Writable => 0,
|
---|
769 | SubDirectory => {
|
---|
770 | TagTable => 'Image::ExifTool::PrintIM::Main',
|
---|
771 | },
|
---|
772 | },
|
---|
773 | # 0x0e01 I don't know what this is, but in D70 NEF files produced by Nikon
|
---|
774 | # Capture, the data for this tag extends 4 bytes past the end of the maker notes.
|
---|
775 | # Very odd. I hope these 4 bytes aren't useful because they will get lost by any
|
---|
776 | # utility that blindly copies the maker notes (not ExifTool) - PH
|
---|
777 | 0x0e01 => {
|
---|
778 | Name => 'NikonCaptureData',
|
---|
779 | SubDirectory => {
|
---|
780 | TagTable => 'Image::ExifTool::NikonCapture::Main',
|
---|
781 | },
|
---|
782 | },
|
---|
783 | 0x0e09 => { #12
|
---|
784 | Name => 'NikonCaptureVersion',
|
---|
785 | Writable => 'string',
|
---|
786 | },
|
---|
787 | # 0x0e0e is in D70 Nikon Capture files (not out-of-the-camera D70 files) - PH
|
---|
788 | 0x0e0e => { #PH
|
---|
789 | Name => 'NikonCaptureOffsets',
|
---|
790 | SubDirectory => {
|
---|
791 | TagTable => 'Image::ExifTool::Nikon::CaptureOffsets',
|
---|
792 | Validate => '$val =~ /^0100/',
|
---|
793 | Start => '$valuePtr + 4',
|
---|
794 | },
|
---|
795 | },
|
---|
796 | 0x0e10 => { #17
|
---|
797 | Name => 'NikonScanIFD',
|
---|
798 | Groups => { 1 => 'NikonScan', 2 => 'Image' },
|
---|
799 | Flags => 'SubIFD',
|
---|
800 | SubDirectory => {
|
---|
801 | TagTable => 'Image::ExifTool::Nikon::Scan',
|
---|
802 | Start => '$val',
|
---|
803 | },
|
---|
804 | },
|
---|
805 | # 0x0e13 - some sort of edit history written by Nikon Capture
|
---|
806 | );
|
---|
807 |
|
---|
808 | # NikonScan IFD entries (ref 17)
|
---|
809 | %Image::ExifTool::Nikon::Scan = (
|
---|
810 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
|
---|
811 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
|
---|
812 | WRITE_GROUP => 'NikonScan',
|
---|
813 | WRITABLE => 1,
|
---|
814 | GROUPS => { 0 => 'MakerNotes', 1 => 'NikonScan', 2 => 'Image' },
|
---|
815 | NOTES => 'This information is written by the Nikon Scan software.',
|
---|
816 | 0x02 => { Name => 'FilmType', Writable => 'string', },
|
---|
817 | 0x40 => { Name => 'MultiSample', Writable => 'string' },
|
---|
818 | 0x41 => { Name => 'BitDepth', Writable => 'int16u' },
|
---|
819 | 0x50 => {
|
---|
820 | Name => 'MasterGain',
|
---|
821 | Writable => 'rational64s',
|
---|
822 | PrintConv => 'sprintf("%.2f",$val)',
|
---|
823 | PrintConvInv => '$val',
|
---|
824 | },
|
---|
825 | 0x51 => {
|
---|
826 | Name => 'ColorGain',
|
---|
827 | Writable => 'rational64s',
|
---|
828 | Count => 3,
|
---|
829 | PrintConv => 'sprintf("%.2f %.2f %.2f",split(" ",$val))',
|
---|
830 | PrintConvInv => '$val',
|
---|
831 | },
|
---|
832 | 0x100 => { Name => 'DigitalICE', Writable => 'string' },
|
---|
833 | 0x110 => {
|
---|
834 | Name => 'ROCInfo',
|
---|
835 | SubDirectory => { TagTable => 'Image::ExifTool::Nikon::ROC' },
|
---|
836 | },
|
---|
837 | 0x120 => {
|
---|
838 | Name => 'GEMInfo',
|
---|
839 | SubDirectory => { TagTable => 'Image::ExifTool::Nikon::GEM' },
|
---|
840 | },
|
---|
841 | );
|
---|
842 |
|
---|
843 | # ref 17
|
---|
844 | %Image::ExifTool::Nikon::ROC = (
|
---|
845 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
846 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
847 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
848 | FORMAT => 'int32u',
|
---|
849 | WRITABLE => 1,
|
---|
850 | FIRST_ENTRY => 0,
|
---|
851 | GROUPS => { 0 => 'MakerNotes', 1 => 'NikonScan', 2 => 'Image' },
|
---|
852 | 0 => {
|
---|
853 | Name => 'DigitalROC',
|
---|
854 | ValueConv => '$val / 10',
|
---|
855 | ValueConvInv => 'int($val * 10)',
|
---|
856 | },
|
---|
857 | );
|
---|
858 |
|
---|
859 | # ref 17
|
---|
860 | %Image::ExifTool::Nikon::GEM = (
|
---|
861 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
862 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
863 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
864 | FORMAT => 'int32u',
|
---|
865 | WRITABLE => 1,
|
---|
866 | FIRST_ENTRY => 0,
|
---|
867 | GROUPS => { 0 => 'MakerNotes', 1 => 'NikonScan', 2 => 'Image' },
|
---|
868 | 0 => {
|
---|
869 | Name => 'DigitalGEM',
|
---|
870 | ValueConv => '$val<95 ? $val/20-1 : 4',
|
---|
871 | ValueConvInv => '$val == 4 ? 95 : int(($val + 1) * 20)',
|
---|
872 | },
|
---|
873 | );
|
---|
874 |
|
---|
875 | # Nikon AF information (ref 13)
|
---|
876 | %Image::ExifTool::Nikon::AFInfo = (
|
---|
877 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
878 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
879 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
880 | WRITABLE => 1,
|
---|
881 | FIRST_ENTRY => 0,
|
---|
882 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
883 | 0 => {
|
---|
884 | Name => 'AFAreaMode',
|
---|
885 | PrintConv => {
|
---|
886 | 0 => 'Single Area',
|
---|
887 | 1 => 'Dynamic Area',
|
---|
888 | 2 => 'Dynamic Area, Closest Subject',
|
---|
889 | 3 => 'Group Dynamic',
|
---|
890 | 4 => 'Single Area (wide)',
|
---|
891 | 5 => 'Dynamic Area (wide)',
|
---|
892 | },
|
---|
893 | },
|
---|
894 | 1 => {
|
---|
895 | Name => 'AFPoint',
|
---|
896 | Notes => 'in some focus modes this value is not meaningful',
|
---|
897 | PrintConv => {
|
---|
898 | 0 => 'Center',
|
---|
899 | 1 => 'Top',
|
---|
900 | 2 => 'Bottom',
|
---|
901 | 3 => 'Left',
|
---|
902 | 4 => 'Right',
|
---|
903 | 5 => 'Upper-left',
|
---|
904 | 6 => 'Upper-right',
|
---|
905 | 7 => 'Lower-left',
|
---|
906 | 8 => 'Lower-right',
|
---|
907 | 9 => 'Far Left',
|
---|
908 | 10 => 'Far Right',
|
---|
909 | },
|
---|
910 | },
|
---|
911 | 2 => {
|
---|
912 | Name => 'AFPointsInFocus',
|
---|
913 | Format => 'int16u',
|
---|
914 | PrintConv => {
|
---|
915 | BITMASK => {
|
---|
916 | 0 => 'Center',
|
---|
917 | 1 => 'Top',
|
---|
918 | 2 => 'Bottom',
|
---|
919 | 3 => 'Left',
|
---|
920 | 4 => 'Right',
|
---|
921 | 5 => 'Upper-left',
|
---|
922 | 6 => 'Upper-right',
|
---|
923 | 7 => 'Lower-left',
|
---|
924 | 8 => 'Lower-right',
|
---|
925 | 9 => 'Far Left',
|
---|
926 | 10 => 'Far Right',
|
---|
927 | },
|
---|
928 | },
|
---|
929 | },
|
---|
930 | );
|
---|
931 |
|
---|
932 | # ref PH
|
---|
933 | %Image::ExifTool::Nikon::CaptureOffsets = (
|
---|
934 | PROCESS_PROC => \&ProcessNikonCaptureOffsets,
|
---|
935 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
936 | 1 => 'IFD0_Offset',
|
---|
937 | 2 => 'PreviewIFD_Offset',
|
---|
938 | 3 => 'SubIFD_Offset',
|
---|
939 | );
|
---|
940 |
|
---|
941 | # ref 4
|
---|
942 | %Image::ExifTool::Nikon::ColorBalance1 = (
|
---|
943 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
944 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
945 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
946 | WRITABLE => 1,
|
---|
947 | FORMAT => 'int16u',
|
---|
948 | FIRST_ENTRY => 0,
|
---|
949 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
950 | 0 => {
|
---|
951 | Name => 'WB_RBGGLevels',
|
---|
952 | Format => 'int16u[4]',
|
---|
953 | Protected => 1,
|
---|
954 | },
|
---|
955 | );
|
---|
956 |
|
---|
957 | # ref 4
|
---|
958 | %Image::ExifTool::Nikon::ColorBalance2 = (
|
---|
959 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
960 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
961 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
962 | WRITABLE => 1,
|
---|
963 | FORMAT => 'int16u',
|
---|
964 | FIRST_ENTRY => 0,
|
---|
965 | NOTES => q{
|
---|
966 | This information is encrypted for most camera models, and if encrypted is
|
---|
967 | not currently writable by exiftool.
|
---|
968 | },
|
---|
969 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
970 | 0 => {
|
---|
971 | Name => 'WB_RGGBLevels',
|
---|
972 | Format => 'int16u[4]',
|
---|
973 | Protected => 1,
|
---|
974 | },
|
---|
975 | );
|
---|
976 |
|
---|
977 | # ref 4
|
---|
978 | %Image::ExifTool::Nikon::ColorBalance3 = (
|
---|
979 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
980 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
981 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
982 | WRITABLE => 1,
|
---|
983 | FORMAT => 'int16u',
|
---|
984 | FIRST_ENTRY => 0,
|
---|
985 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
986 | 0 => {
|
---|
987 | Name => 'WB_RGBGLevels',
|
---|
988 | Format => 'int16u[4]',
|
---|
989 | Protected => 1,
|
---|
990 | },
|
---|
991 | );
|
---|
992 |
|
---|
993 | %Image::ExifTool::Nikon::Type2 = (
|
---|
994 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
|
---|
995 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
|
---|
996 | WRITABLE => 1,
|
---|
997 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
998 | 0x0003 => 'Quality',
|
---|
999 | 0x0004 => 'ColorMode',
|
---|
1000 | 0x0005 => 'ImageAdjustment',
|
---|
1001 | 0x0006 => 'CCDSensitivity',
|
---|
1002 | 0x0007 => 'WhiteBalance',
|
---|
1003 | 0x0008 => 'Focus',
|
---|
1004 | 0x000A => 'DigitalZoom',
|
---|
1005 | 0x000B => 'Converter',
|
---|
1006 | );
|
---|
1007 |
|
---|
1008 | # these are standard EXIF tags, but they are duplicated here so we
|
---|
1009 | # can change some names to extract the Nikon preview separately
|
---|
1010 | %Image::ExifTool::Nikon::PreviewImage = (
|
---|
1011 | WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
|
---|
1012 | CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
|
---|
1013 | GROUPS => { 0 => 'MakerNotes', 1 => 'NikonPreview', 2 => 'Image'},
|
---|
1014 | 0x103 => {
|
---|
1015 | Name => 'Compression',
|
---|
1016 | PrintConv => \%Image::ExifTool::Exif::compression,
|
---|
1017 | Priority => 0,
|
---|
1018 | },
|
---|
1019 | 0x11a => {
|
---|
1020 | Name => 'XResolution',
|
---|
1021 | Priority => 0,
|
---|
1022 | },
|
---|
1023 | 0x11b => {
|
---|
1024 | Name => 'YResolution',
|
---|
1025 | Priority => 0,
|
---|
1026 | },
|
---|
1027 | 0x128 => {
|
---|
1028 | Name => 'ResolutionUnit',
|
---|
1029 | PrintConv => {
|
---|
1030 | 1 => 'None',
|
---|
1031 | 2 => 'inches',
|
---|
1032 | 3 => 'cm',
|
---|
1033 | },
|
---|
1034 | Priority => 0,
|
---|
1035 | },
|
---|
1036 | 0x201 => {
|
---|
1037 | Name => 'PreviewImageStart',
|
---|
1038 | Flags => [ 'IsOffset', 'Permanent' ],
|
---|
1039 | OffsetPair => 0x202, # point to associated byte count
|
---|
1040 | DataTag => 'PreviewImage',
|
---|
1041 | Writable => 'int32u',
|
---|
1042 | WriteGroup => 'NikonPreview',
|
---|
1043 | Protected => 2,
|
---|
1044 | },
|
---|
1045 | 0x202 => {
|
---|
1046 | Name => 'PreviewImageLength',
|
---|
1047 | Flags => 'Permanent' ,
|
---|
1048 | OffsetPair => 0x201, # point to associated offset
|
---|
1049 | DataTag => 'PreviewImage',
|
---|
1050 | Writable => 'int32u',
|
---|
1051 | WriteGroup => 'NikonPreview',
|
---|
1052 | Protected => 2,
|
---|
1053 | },
|
---|
1054 | 0x213 => {
|
---|
1055 | Name => 'YCbCrPositioning',
|
---|
1056 | PrintConv => {
|
---|
1057 | 1 => 'Centered',
|
---|
1058 | 2 => 'Co-sited',
|
---|
1059 | },
|
---|
1060 | Priority => 0,
|
---|
1061 | },
|
---|
1062 | );
|
---|
1063 |
|
---|
1064 | # these are duplicated enough times to make it worthwhile to define them centrally
|
---|
1065 | my %nikonApertureConversions = (
|
---|
1066 | ValueConv => '2**($val/24)',
|
---|
1067 | ValueConvInv => '$val>0 ? 24*log($val)/log(2) : 0',
|
---|
1068 | PrintConv => 'sprintf("%.1f",$val)',
|
---|
1069 | PrintConvInv => '$val',
|
---|
1070 | );
|
---|
1071 |
|
---|
1072 | my %nikonFocalConversions = (
|
---|
1073 | ValueConv => '5 * 2**($val/24)',
|
---|
1074 | ValueConvInv => '$val>0 ? 24*log($val/5)/log(2) : 0',
|
---|
1075 | PrintConv => 'sprintf("%.1fmm",$val)',
|
---|
1076 | PrintConvInv => '$val=~s/\s*mm$//;$val',
|
---|
1077 | );
|
---|
1078 |
|
---|
1079 | # Version 100 Nikon lens data
|
---|
1080 | %Image::ExifTool::Nikon::LensData00 = (
|
---|
1081 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
1082 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
1083 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
1084 | WRITABLE => 1,
|
---|
1085 | FIRST_ENTRY => 0,
|
---|
1086 | NOTES => 'This structure is used by the D100, and D1X with firmware version 1.1.',
|
---|
1087 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
1088 | 0x00 => {
|
---|
1089 | Name => 'LensDataVersion',
|
---|
1090 | Format => 'undef[4]',
|
---|
1091 | },
|
---|
1092 | 0x06 => { #8
|
---|
1093 | Name => 'LensIDNumber',
|
---|
1094 | Notes => 'see LensID values below',
|
---|
1095 | },
|
---|
1096 | 0x07 => { #8
|
---|
1097 | Name => 'LensFStops',
|
---|
1098 | ValueConv => '$val / 12',
|
---|
1099 | ValueConvInv => '$val * 12',
|
---|
1100 | PrintConv => 'sprintf("%.2f", $val)',
|
---|
1101 | PrintConvInv => '$val',
|
---|
1102 | },
|
---|
1103 | 0x08 => { #8/9
|
---|
1104 | Name => 'MinFocalLength',
|
---|
1105 | %nikonFocalConversions,
|
---|
1106 | },
|
---|
1107 | 0x09 => { #8/9
|
---|
1108 | Name => 'MaxFocalLength',
|
---|
1109 | %nikonFocalConversions,
|
---|
1110 | },
|
---|
1111 | 0x0a => { #8
|
---|
1112 | Name => 'MaxApertureAtMinFocal',
|
---|
1113 | %nikonApertureConversions,
|
---|
1114 | },
|
---|
1115 | 0x0b => { #8
|
---|
1116 | Name => 'MaxApertureAtMaxFocal',
|
---|
1117 | %nikonApertureConversions,
|
---|
1118 | },
|
---|
1119 | 0x0c => 'MCUVersion', #8
|
---|
1120 | );
|
---|
1121 |
|
---|
1122 | # Nikon lens data (note: needs decrypting if LensDataVersion is 020x)
|
---|
1123 | %Image::ExifTool::Nikon::LensData01 = (
|
---|
1124 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
1125 | FIRST_ENTRY => 0,
|
---|
1126 | NOTES => q{
|
---|
1127 | Nikon encrypts the LensData information below if LensDataVersion is 0201 or
|
---|
1128 | higher, but the decryption algorithm is known so the information can be
|
---|
1129 | extracted. It isn't yet writable, however, because the encryption adds
|
---|
1130 | complications which make writing more difficult.
|
---|
1131 | },
|
---|
1132 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
1133 | 0x00 => {
|
---|
1134 | Name => 'LensDataVersion',
|
---|
1135 | Format => 'string[4]',
|
---|
1136 | },
|
---|
1137 | 0x04 => { #8
|
---|
1138 | Name => 'ExitPupilPosition',
|
---|
1139 | ValueConv => '$val ? 2048 / $val : $val',
|
---|
1140 | ValueConvInv => '$val ? 2048 / $val : $val',
|
---|
1141 | PrintConv => 'sprintf("%.1fmm",$val)',
|
---|
1142 | PrintConvInv => '$val=~s/ ?mm$//; $val',
|
---|
1143 | },
|
---|
1144 | 0x05 => { #8
|
---|
1145 | Name => 'AFAperture',
|
---|
1146 | %nikonApertureConversions,
|
---|
1147 | },
|
---|
1148 | 0x08 => { #8
|
---|
1149 | Name => 'FocusPosition',
|
---|
1150 | PrintConv => 'sprintf("0x%02x", $val)',
|
---|
1151 | PrintConvInv => '$val',
|
---|
1152 | },
|
---|
1153 | 0x09 => { #8/9
|
---|
1154 | # With older AF lenses this does not work... (ref 13)
|
---|
1155 | # ie) AF Nikkor 50mm f/1.4 => 48 (0x30)
|
---|
1156 | # AF Zoom-Nikkor 35-105mm f/3.5-4.5 => @35mm => 15 (0x0f), @105mm => 141 (0x8d)
|
---|
1157 | Notes => 'this focus distance is approximate, and not very accurate for some lenses',
|
---|
1158 | Name => 'FocusDistance',
|
---|
1159 | ValueConv => '0.01 * 10**($val/40)', # in m
|
---|
1160 | ValueConvInv => '$val>0 ? 40*log($val*100)/log(10) : 0',
|
---|
1161 | PrintConv => '$val ? sprintf("%.2f m",$val) : "inf"',
|
---|
1162 | PrintConvInv => '$val eq "inf" ? 0 : $val =~ s/\s*m$//, $val',
|
---|
1163 | },
|
---|
1164 | 0x0a => { #8/9
|
---|
1165 | Name => 'FocalLength',
|
---|
1166 | Priority => 0,
|
---|
1167 | %nikonFocalConversions,
|
---|
1168 | },
|
---|
1169 | 0x0b => { #8
|
---|
1170 | Name => 'LensIDNumber',
|
---|
1171 | Notes => 'see LensID values below',
|
---|
1172 | },
|
---|
1173 | 0x0c => { #8
|
---|
1174 | Name => 'LensFStops',
|
---|
1175 | ValueConv => '$val / 12',
|
---|
1176 | ValueConvInv => '$val * 12',
|
---|
1177 | PrintConv => 'sprintf("%.2f", $val)',
|
---|
1178 | PrintConvInv => '$val',
|
---|
1179 | },
|
---|
1180 | 0x0d => { #8/9
|
---|
1181 | Name => 'MinFocalLength',
|
---|
1182 | %nikonFocalConversions,
|
---|
1183 | },
|
---|
1184 | 0x0e => { #8/9
|
---|
1185 | Name => 'MaxFocalLength',
|
---|
1186 | %nikonFocalConversions,
|
---|
1187 | },
|
---|
1188 | 0x0f => { #8
|
---|
1189 | Name => 'MaxApertureAtMinFocal',
|
---|
1190 | %nikonApertureConversions,
|
---|
1191 | },
|
---|
1192 | 0x10 => { #8
|
---|
1193 | Name => 'MaxApertureAtMaxFocal',
|
---|
1194 | %nikonApertureConversions,
|
---|
1195 | },
|
---|
1196 | 0x11 => 'MCUVersion', #8
|
---|
1197 | 0x12 => { #8
|
---|
1198 | Name => 'EffectiveMaxAperture',
|
---|
1199 | %nikonApertureConversions,
|
---|
1200 | },
|
---|
1201 | );
|
---|
1202 |
|
---|
1203 | # information encrypted in some cameras - ref 18
|
---|
1204 | %Image::ExifTool::Nikon::ShotInfo = (
|
---|
1205 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
1206 | FIRST_ENTRY => 0,
|
---|
1207 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
1208 | DATAMEMBER => [ 0 ],
|
---|
1209 | NOTES => q{
|
---|
1210 | This information is encrypted for ShotInfoVersion 02xx, and some tags are
|
---|
1211 | only valid for specific versions.
|
---|
1212 | },
|
---|
1213 | 0x00 => {
|
---|
1214 | Name => 'ShotInfoVersion',
|
---|
1215 | RawConv => '$$self{ShotInfoVersion} = $val',
|
---|
1216 | Format => 'string[4]',
|
---|
1217 | },
|
---|
1218 | 0x66 => {
|
---|
1219 | Name => 'VR_0x66',
|
---|
1220 | Condition => '$$self{ShotInfoVersion} =~ /^(0204)$/',
|
---|
1221 | Format => 'int8u',
|
---|
1222 | Unknown => 1,
|
---|
1223 | Notes => 'D2X, D2Xs (unverified)',
|
---|
1224 | PrintConv => {
|
---|
1225 | 0 => 'Off',
|
---|
1226 | 1 => 'On (normal)',
|
---|
1227 | 2 => 'On (active)',
|
---|
1228 | },
|
---|
1229 | },
|
---|
1230 | # 6a, 6e not correct for 0103 (D70), 0207 (D200)
|
---|
1231 | 0x6a => {
|
---|
1232 | Name => 'ShutterCount',
|
---|
1233 | Condition => '$$self{ShotInfoVersion} =~ /^(0204)$/',
|
---|
1234 | Format => 'int32u',
|
---|
1235 | Priority => 0,
|
---|
1236 | Notes => 'D2X, D2Xs',
|
---|
1237 | },
|
---|
1238 | 0x6e => {
|
---|
1239 | Name => 'DeletedImageCount',
|
---|
1240 | Condition => '$$self{ShotInfoVersion} =~ /^(0204)$/',
|
---|
1241 | Format => 'int32u',
|
---|
1242 | Priority => 0,
|
---|
1243 | Notes => 'D2X, D2Xs',
|
---|
1244 | },
|
---|
1245 | 0x75 => { #19
|
---|
1246 | Name => 'VibrationReduction',
|
---|
1247 | Condition => '$$self{ShotInfoVersion} =~ /^(0207)$/',
|
---|
1248 | Format => 'int8u',
|
---|
1249 | Notes => 'D200',
|
---|
1250 | PrintConv => {
|
---|
1251 | 0 => 'Off',
|
---|
1252 | 1 => 'On (1)',
|
---|
1253 | 2 => 'On (2)',
|
---|
1254 | },
|
---|
1255 | },
|
---|
1256 | 0x82 => { # educated guess, needs verification
|
---|
1257 | Name => 'VibrationReduction',
|
---|
1258 | Condition => '$$self{ShotInfoVersion} =~ /^(0204)$/',
|
---|
1259 | Format => 'int8u',
|
---|
1260 | Notes => 'D2X, D2Xs',
|
---|
1261 | PrintConv => {
|
---|
1262 | 0 => 'Off',
|
---|
1263 | 1 => 'On',
|
---|
1264 | },
|
---|
1265 | },
|
---|
1266 | 0x157 => { #19
|
---|
1267 | Name => 'ShutterCount',
|
---|
1268 | Condition => '$$self{ShotInfoVersion} =~ /^(0205)$/',
|
---|
1269 | Format => 'undef[2]',
|
---|
1270 | Priority => 0,
|
---|
1271 | Notes => 'D50',
|
---|
1272 | # treat as a 2-byte big-endian integer
|
---|
1273 | ValueConv => 'unpack("n", $val)',
|
---|
1274 | ValueConvInv => 'pack("n",$val)',
|
---|
1275 | },
|
---|
1276 | 0x1ae => { #19
|
---|
1277 | Name => 'VibrationReduction',
|
---|
1278 | Condition => '$$self{ShotInfoVersion} =~ /^(0205)$/',
|
---|
1279 | Format => 'int8u',
|
---|
1280 | Notes => 'D50',
|
---|
1281 | PrintHex => 1,
|
---|
1282 | PrintConv => {
|
---|
1283 | 0x00 => 'n/a',
|
---|
1284 | 0x0c => 'Off',
|
---|
1285 | 0x0f => 'On',
|
---|
1286 | },
|
---|
1287 | },
|
---|
1288 | 0x24a => { #19
|
---|
1289 | Name => 'ShutterCount',
|
---|
1290 | Condition => '$$self{ShotInfoVersion} =~ /^(0208)$/',
|
---|
1291 | Format => 'int32u',
|
---|
1292 | Priority => 0,
|
---|
1293 | Notes => 'D80',
|
---|
1294 | },
|
---|
1295 | 0x24e => { #19
|
---|
1296 | Name => 'VibrationReduction',
|
---|
1297 | Condition => '$$self{ShotInfoVersion} =~ /^(0208)$/',
|
---|
1298 | Notes => 'D80',
|
---|
1299 | PrintHex => 1,
|
---|
1300 | PrintConv => {
|
---|
1301 | 0x00 => 'Off, Horizontal',
|
---|
1302 | 0x01 => 'Off, Rotated 270 CW',
|
---|
1303 | 0x02 => 'Off, Rotated 90 CW',
|
---|
1304 | 0x03 => 'Off, Rotated 180',
|
---|
1305 | 0x18 => 'On, Horizontal',
|
---|
1306 | 0x19 => 'On, Rotated 270 CW',
|
---|
1307 | 0x1a => 'On, Rotated 90 CW',
|
---|
1308 | 0x1b => 'On, Rotated 180',
|
---|
1309 | },
|
---|
1310 | },
|
---|
1311 | # note: DecryptLen currently set to 0x24e
|
---|
1312 | );
|
---|
1313 |
|
---|
1314 | # Multi exposure / image overlay information (ref PH)
|
---|
1315 | %Image::ExifTool::Nikon::MultiExposure = (
|
---|
1316 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
1317 | WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
|
---|
1318 | CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
|
---|
1319 | WRITABLE => 1,
|
---|
1320 | FIRST_ENTRY => 0,
|
---|
1321 | FORMAT => 'int32u',
|
---|
1322 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
1323 | 0 => {
|
---|
1324 | Name => 'MultiExposureVersion',
|
---|
1325 | Format => 'string[4]',
|
---|
1326 | },
|
---|
1327 | 1 => {
|
---|
1328 | Name => 'MultiExposureMode',
|
---|
1329 | PrintConv => {
|
---|
1330 | 0 => 'Off',
|
---|
1331 | 1 => 'Multiple Exposure',
|
---|
1332 | 2 => 'Image Overlay',
|
---|
1333 | },
|
---|
1334 | },
|
---|
1335 | 2 => 'MultiExposureShots',
|
---|
1336 | 3 => {
|
---|
1337 | Name => 'MultiExposureAutoGain',
|
---|
1338 | PrintConv => { 0 => 'Off', 1 => 'On' },
|
---|
1339 | },
|
---|
1340 | );
|
---|
1341 |
|
---|
1342 | # tags in Nikon QuickTime videos (PH - observations with Coolpix S3)
|
---|
1343 | # (note: very similar to information in Pentax videos)
|
---|
1344 | %Image::ExifTool::Nikon::MOV = (
|
---|
1345 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
1346 | GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
|
---|
1347 | NOTES => q{
|
---|
1348 | This information is found in Nikon QT video images, and is very similar to
|
---|
1349 | information found in Pentax MOV videos.
|
---|
1350 | },
|
---|
1351 | 0x00 => {
|
---|
1352 | Name => 'Make',
|
---|
1353 | Format => 'string[5]',
|
---|
1354 | PrintConv => 'ucfirst(lc($val))',
|
---|
1355 | },
|
---|
1356 | 0x18 => {
|
---|
1357 | Name => 'Model',
|
---|
1358 | Description => 'Camera Model Name',
|
---|
1359 | Format => 'string[8]',
|
---|
1360 | },
|
---|
1361 | 0x26 => {
|
---|
1362 | Name => 'ExposureTime',
|
---|
1363 | Format => 'int32u',
|
---|
1364 | ValueConv => '$val ? 10 / $val : 0',
|
---|
1365 | PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
|
---|
1366 | },
|
---|
1367 | 0x2a => {
|
---|
1368 | Name => 'FNumber',
|
---|
1369 | Format => 'int32u',
|
---|
1370 | ValueConv => '$val * 0.1',
|
---|
1371 | PrintConv => 'sprintf("%.1f",$val)',
|
---|
1372 | },
|
---|
1373 | 0x32 => {
|
---|
1374 | Name => 'ExposureCompensation',
|
---|
1375 | Format => 'int32s',
|
---|
1376 | ValueConv => '$val * 0.1',
|
---|
1377 | PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
|
---|
1378 | },
|
---|
1379 | 0x44 => {
|
---|
1380 | Name => 'WhiteBalance',
|
---|
1381 | Format => 'int16u',
|
---|
1382 | PrintConv => {
|
---|
1383 | 0 => 'Auto',
|
---|
1384 | 1 => 'Daylight',
|
---|
1385 | 2 => 'Shade',
|
---|
1386 | 3 => 'Fluorescent', #2
|
---|
1387 | 4 => 'Tungsten',
|
---|
1388 | 5 => 'Manual',
|
---|
1389 | },
|
---|
1390 | },
|
---|
1391 | 0x48 => {
|
---|
1392 | Name => 'FocalLength',
|
---|
1393 | Writable => 'int32u',
|
---|
1394 | ValueConv => '$val * 0.1',
|
---|
1395 | PrintConv => 'sprintf("%.1fmm",$val)',
|
---|
1396 | },
|
---|
1397 | 0xaf => {
|
---|
1398 | Name => 'Software',
|
---|
1399 | Format => 'string[16]',
|
---|
1400 | },
|
---|
1401 | 0xdf => { # (this is a guess ... could also be offset 0xdb)
|
---|
1402 | Name => 'ISO',
|
---|
1403 | Format => 'int16u',
|
---|
1404 | },
|
---|
1405 | );
|
---|
1406 |
|
---|
1407 |
|
---|
1408 | # Nikon composite tags
|
---|
1409 | %Image::ExifTool::Nikon::Composite = (
|
---|
1410 | GROUPS => { 2 => 'Camera' },
|
---|
1411 | LensSpec => {
|
---|
1412 | Description => 'Lens',
|
---|
1413 | Require => {
|
---|
1414 | 0 => 'Nikon:Lens',
|
---|
1415 | 1 => 'Nikon:LensType',
|
---|
1416 | },
|
---|
1417 | ValueConv => '"$val[0] $val[1]"',
|
---|
1418 | PrintConv => '"$prt[0] $prt[1]"',
|
---|
1419 | },
|
---|
1420 | LensID => {
|
---|
1421 | SeparateTable => 'Nikon LensID', # print values in a separate table
|
---|
1422 | Require => {
|
---|
1423 | 0 => 'Nikon:LensIDNumber',
|
---|
1424 | 1 => 'LensFStops',
|
---|
1425 | 2 => 'MinFocalLength',
|
---|
1426 | 3 => 'MaxFocalLength',
|
---|
1427 | 4 => 'MaxApertureAtMinFocal',
|
---|
1428 | 5 => 'MaxApertureAtMaxFocal',
|
---|
1429 | 6 => 'MCUVersion',
|
---|
1430 | 7 => 'Nikon:LensType',
|
---|
1431 | },
|
---|
1432 | # construct lens ID string as per ref 11
|
---|
1433 | ValueConv => 'uc(join(" ",(unpack("H*",pack("C*",@raw)) =~ /../g)))',
|
---|
1434 | PrintConv => \%nikonLensIDs,
|
---|
1435 | },
|
---|
1436 | );
|
---|
1437 |
|
---|
1438 | # add our composite tags
|
---|
1439 | Image::ExifTool::AddCompositeTags('Image::ExifTool::Nikon');
|
---|
1440 |
|
---|
1441 |
|
---|
1442 | #------------------------------------------------------------------------------
|
---|
1443 | # Clean up formatting of string values
|
---|
1444 | # Inputs: 0) string value
|
---|
1445 | # Returns: formatted string value
|
---|
1446 | # - removes trailing spaces and changes case to something more sensible
|
---|
1447 | sub FormatString($)
|
---|
1448 | {
|
---|
1449 | my $str = shift;
|
---|
1450 | # limit string length (can be very long for some unknown tags)
|
---|
1451 | if (length($str) > 60) {
|
---|
1452 | $str = substr($str,0,55) . "[...]";
|
---|
1453 | } else {
|
---|
1454 | $str =~ s/\s+$//; # remove trailing white space and null terminator
|
---|
1455 | # Don't change case of hyphenated strings (like AF-S) or non-words (no vowels)
|
---|
1456 | unless ($str =~ /-/ or $str !~ /[AEIOUY]/) {
|
---|
1457 | # change all letters but the first to lower case
|
---|
1458 | $str =~ s/([A-Z]{1})([A-Z]+)/$1\L$2/g;
|
---|
1459 | }
|
---|
1460 | }
|
---|
1461 | return $str;
|
---|
1462 | }
|
---|
1463 |
|
---|
1464 | #------------------------------------------------------------------------------
|
---|
1465 | # decoding tables from ref 4
|
---|
1466 | my @xlat = (
|
---|
1467 | [ 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d,
|
---|
1468 | 0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d,
|
---|
1469 | 0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f,
|
---|
1470 | 0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f,
|
---|
1471 | 0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1,
|
---|
1472 | 0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17,
|
---|
1473 | 0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89,
|
---|
1474 | 0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f,
|
---|
1475 | 0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b,
|
---|
1476 | 0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb,
|
---|
1477 | 0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3,
|
---|
1478 | 0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f,
|
---|
1479 | 0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35,
|
---|
1480 | 0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43,
|
---|
1481 | 0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5,
|
---|
1482 | 0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 ],
|
---|
1483 | [ 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c,
|
---|
1484 | 0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34,
|
---|
1485 | 0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad,
|
---|
1486 | 0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05,
|
---|
1487 | 0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee,
|
---|
1488 | 0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d,
|
---|
1489 | 0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b,
|
---|
1490 | 0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b,
|
---|
1491 | 0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc,
|
---|
1492 | 0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33,
|
---|
1493 | 0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8,
|
---|
1494 | 0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6,
|
---|
1495 | 0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c,
|
---|
1496 | 0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49,
|
---|
1497 | 0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb,
|
---|
1498 | 0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f ]
|
---|
1499 | );
|
---|
1500 |
|
---|
1501 | # decrypt Nikon data block (ref 4)
|
---|
1502 | # Inputs: 0) reference to data block, 1) serial number key, 2) shutter count key
|
---|
1503 | # 4) optional start offset (default 0)
|
---|
1504 | # 5) optional number of bytes to decode (default to the end of the data)
|
---|
1505 | # Returns: Decrypted data block
|
---|
1506 | sub Decrypt($$$;$$)
|
---|
1507 | {
|
---|
1508 | my ($dataPt, $serial, $count, $start, $len) = @_;
|
---|
1509 | $start or $start = 0;
|
---|
1510 | my $end = $len ? $start + $len : length($$dataPt);
|
---|
1511 | my $i;
|
---|
1512 | my $key = 0;
|
---|
1513 | for ($i=0; $i<4; ++$i) {
|
---|
1514 | $key ^= ($count >> ($i*8)) & 0xff;
|
---|
1515 | }
|
---|
1516 | my $ci = $xlat[0][$serial & 0xff];
|
---|
1517 | my $cj = $xlat[1][$key];
|
---|
1518 | my $ck = 0x60;
|
---|
1519 | my @data = unpack('C*',$$dataPt);
|
---|
1520 | for ($i=$start; $i<$end; ++$i) {
|
---|
1521 | $cj = ($cj + $ci * $ck) & 0xff;
|
---|
1522 | $ck = ($ck + 1) & 0xff;
|
---|
1523 | $data[$i] ^= $cj;
|
---|
1524 | }
|
---|
1525 | return pack('C*',@data);
|
---|
1526 | }
|
---|
1527 |
|
---|
1528 | #------------------------------------------------------------------------------
|
---|
1529 | # process Nikon Encrypted data block
|
---|
1530 | # Inputs: 0) ExifTool object reference, 1) reference to directory information
|
---|
1531 | # 2) pointer to tag table
|
---|
1532 | # Returns: 1 on success
|
---|
1533 | sub ProcessNikonEncrypted($$$)
|
---|
1534 | {
|
---|
1535 | my ($exifTool, $dirInfo, $tagTablePtr) = @_;
|
---|
1536 | # get the encrypted directory data
|
---|
1537 | my $buff = substr(${$$dirInfo{DataPt}}, $$dirInfo{DirStart}, $$dirInfo{DirLen});
|
---|
1538 | # save it until we have enough information to decrypt it later
|
---|
1539 | push @{$exifTool->{NikonInfo}->{Encrypted}}, [ $tagTablePtr, $buff, $$dirInfo{TagInfo}];
|
---|
1540 | if ($exifTool->Options('Verbose')) {
|
---|
1541 | my $indent = substr($exifTool->{INDENT}, 0, -2);
|
---|
1542 | $exifTool->VPrint(0, $indent, "[$dirInfo->{TagInfo}->{Name} directory to be decrypted later]\n");
|
---|
1543 | }
|
---|
1544 | return 1;
|
---|
1545 | }
|
---|
1546 |
|
---|
1547 | #------------------------------------------------------------------------------
|
---|
1548 | # process Nikon Capture Offsets IFD (ref PH)
|
---|
1549 | # Inputs: 0) ExifTool object reference, 1) reference to directory information
|
---|
1550 | # 2) pointer to tag table
|
---|
1551 | # Returns: 1 on success
|
---|
1552 | # Notes: This isn't a normal IFD, but is close...
|
---|
1553 | sub ProcessNikonCaptureOffsets($$$)
|
---|
1554 | {
|
---|
1555 | my ($exifTool, $dirInfo, $tagTablePtr) = @_;
|
---|
1556 | my $dataPt = $$dirInfo{DataPt};
|
---|
1557 | my $dirStart = $$dirInfo{DirStart};
|
---|
1558 | my $dirLen = $$dirInfo{DirLen};
|
---|
1559 | my $success = 0;
|
---|
1560 | return 0 unless $dirLen > 2;
|
---|
1561 | my $count = Get16u($dataPt, $dirStart);
|
---|
1562 | return 0 unless $count and $count * 12 + 2 <= $dirLen;
|
---|
1563 | if ($exifTool->Options('Verbose')) {
|
---|
1564 | $exifTool->VerboseDir('NikonCaptureOffsets', $count);
|
---|
1565 | }
|
---|
1566 | my $index;
|
---|
1567 | for ($index=0; $index<$count; ++$index) {
|
---|
1568 | my $pos = $dirStart + 12 * $index + 2;
|
---|
1569 | my $tagID = Get32u($dataPt, $pos);
|
---|
1570 | my $value = Get32u($dataPt, $pos + 4);
|
---|
1571 | $exifTool->HandleTag($tagTablePtr, $tagID, $value,
|
---|
1572 | Index => $index,
|
---|
1573 | DataPt => $dataPt,
|
---|
1574 | Start => $pos,
|
---|
1575 | Size => 12,
|
---|
1576 | ) and $success = 1;
|
---|
1577 | }
|
---|
1578 | return $success;
|
---|
1579 | }
|
---|
1580 |
|
---|
1581 | #------------------------------------------------------------------------------
|
---|
1582 | # Process Nikon Makernotes directory
|
---|
1583 | # Inputs: 0) ExifTool object reference
|
---|
1584 | # 1) Reference to directory information hash
|
---|
1585 | # 2) Pointer to tag table for this directory
|
---|
1586 | # Returns: 1 on success, otherwise returns 0 and sets a Warning
|
---|
1587 | sub ProcessNikon($$$)
|
---|
1588 | {
|
---|
1589 | my ($exifTool, $dirInfo, $tagTablePtr) = @_;
|
---|
1590 | my $verbose = $exifTool->Options('Verbose');
|
---|
1591 | my $nikonInfo = $exifTool->{NikonInfo} = { };
|
---|
1592 | my @encrypted; # list to save encrypted data
|
---|
1593 | $$nikonInfo{Encrypted} = \@encrypted;
|
---|
1594 | my $rtnVal = Image::ExifTool::Exif::ProcessExif($exifTool, $dirInfo, $tagTablePtr);
|
---|
1595 | # process any encrypted information we found
|
---|
1596 | my $encryptedDir;
|
---|
1597 | if (@encrypted) {
|
---|
1598 | my $serial = $exifTool->{NikonInfo}->{SerialNumber} || 0;
|
---|
1599 | my $count = $exifTool->{NikonInfo}->{ShutterCount};
|
---|
1600 | unless (defined $count) {
|
---|
1601 | $exifTool->Warn("Can't decrypt Nikon information (no ShutterCount key)");
|
---|
1602 | undef @encrypted;
|
---|
1603 | }
|
---|
1604 | foreach $encryptedDir (@encrypted) {
|
---|
1605 | my ($subTablePtr, $data, $tagInfo) = @$encryptedDir;
|
---|
1606 | my ($start, $len, $offset);
|
---|
1607 | if ($tagInfo and $$tagInfo{SubDirectory}) {
|
---|
1608 | $start = $tagInfo->{SubDirectory}->{DecryptStart};
|
---|
1609 | # may decrypt only part of the information to save time
|
---|
1610 | if ($verbose < 3 and $exifTool->Options('Unknown') < 2) {
|
---|
1611 | $len = $tagInfo->{SubDirectory}->{DecryptLen};
|
---|
1612 | }
|
---|
1613 | $offset = $tagInfo->{SubDirectory}->{DirOffset};
|
---|
1614 | }
|
---|
1615 | $start or $start = 0;
|
---|
1616 | if (defined $offset) {
|
---|
1617 | # offset, if specified, is releative to start of encrypted data
|
---|
1618 | $offset += $start;
|
---|
1619 | } else {
|
---|
1620 | $offset = 0;
|
---|
1621 | }
|
---|
1622 | my $maxLen = length($data) - $start;
|
---|
1623 | if ($len) {
|
---|
1624 | $len = $maxLen if $len > $maxLen;
|
---|
1625 | } else {
|
---|
1626 | $len = $maxLen;
|
---|
1627 | }
|
---|
1628 | # use fixed serial numbers if no good serial number found
|
---|
1629 | unless ($serial =~ /^\d+$/) {
|
---|
1630 | if ($exifTool->{CameraModel} =~ /\bD50$/) {
|
---|
1631 | $serial = 0x22; # D50 (ref 8)
|
---|
1632 | } else {
|
---|
1633 | $serial = 0x60; # D200 (ref 10), D40X (ref PH)
|
---|
1634 | }
|
---|
1635 | }
|
---|
1636 | $data = Decrypt(\$data, $serial, $count, $start, $len);
|
---|
1637 | my %subdirInfo = (
|
---|
1638 | DataPt => \$data,
|
---|
1639 | DirStart => $offset,
|
---|
1640 | DirLen => length($data) - $offset,
|
---|
1641 | );
|
---|
1642 | if ($verbose > 2) {
|
---|
1643 | $exifTool->VerboseDir("Decrypted $$tagInfo{Name}");
|
---|
1644 | my %parms = (
|
---|
1645 | Prefix => $exifTool->{INDENT},
|
---|
1646 | Out => $exifTool->Options('TextOut'),
|
---|
1647 | );
|
---|
1648 | $parms{MaxLen} = 96 unless $verbose > 3;
|
---|
1649 | Image::ExifTool::HexDump(\$data, undef, %parms);
|
---|
1650 | }
|
---|
1651 | # process the decrypted information
|
---|
1652 | $exifTool->ProcessBinaryData(\%subdirInfo, $subTablePtr);
|
---|
1653 | }
|
---|
1654 | }
|
---|
1655 | delete $exifTool->{NikonInfo};
|
---|
1656 | return $rtnVal;
|
---|
1657 | }
|
---|
1658 |
|
---|
1659 | 1; # end
|
---|
1660 |
|
---|
1661 | __END__
|
---|
1662 |
|
---|
1663 | =head1 NAME
|
---|
1664 |
|
---|
1665 | Image::ExifTool::Nikon - Nikon EXIF maker notes tags
|
---|
1666 |
|
---|
1667 | =head1 SYNOPSIS
|
---|
1668 |
|
---|
1669 | This module is loaded automatically by Image::ExifTool when required.
|
---|
1670 |
|
---|
1671 | =head1 DESCRIPTION
|
---|
1672 |
|
---|
1673 | This module contains definitions required by Image::ExifTool to interpret
|
---|
1674 | Nikon maker notes in EXIF information.
|
---|
1675 |
|
---|
1676 | =head1 AUTHOR
|
---|
1677 |
|
---|
1678 | Copyright 2003-2007, Phil Harvey (phil at owl.phy.queensu.ca)
|
---|
1679 |
|
---|
1680 | This library is free software; you can redistribute it and/or modify it
|
---|
1681 | under the same terms as Perl itself.
|
---|
1682 |
|
---|
1683 | =head1 REFERENCES
|
---|
1684 |
|
---|
1685 | =over 4
|
---|
1686 |
|
---|
1687 | =item L<http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html>
|
---|
1688 |
|
---|
1689 | =item L<http://www.cybercom.net/~dcoffin/dcraw/>
|
---|
1690 |
|
---|
1691 | =item L<http://members.aol.com/khancock/pilot/nbuddy/>
|
---|
1692 |
|
---|
1693 | =item L<http://www.rottmerhusen.com/objektives/lensid/thirdparty.html>
|
---|
1694 |
|
---|
1695 | =item L<http://homepage3.nifty.com/kamisaka/makernote/makernote_nikon.htm>
|
---|
1696 |
|
---|
1697 | =item L<http://www.wohlberg.net/public/software/photo/nstiffexif/>
|
---|
1698 |
|
---|
1699 | =back
|
---|
1700 |
|
---|
1701 | =head1 ACKNOWLEDGEMENTS
|
---|
1702 |
|
---|
1703 | Thanks to Joseph Heled, Thomas Walter, Brian Ristuccia, Danek Duvall, Tom
|
---|
1704 | Christiansen, Robert Rottmerhusen, Werner Kober, Roger Larsson and Jens
|
---|
1705 | Duttke for their help figuring out some Nikon tags, and Bruce Stevens for
|
---|
1706 | his additions to the LensID list.
|
---|
1707 |
|
---|
1708 | =head1 SEE ALSO
|
---|
1709 |
|
---|
1710 | L<Image::ExifTool::TagNames/Nikon Tags>,
|
---|
1711 | L<Image::ExifTool::TagNames/NikonCapture Tags>,
|
---|
1712 | L<Image::ExifTool(3pm)|Image::ExifTool>
|
---|
1713 |
|
---|
1714 | =cut
|
---|