File Coverage

blib/lib/Image/ExifTool/Olympus.pm
Criterion Covered Total %
statement 41 46 89.1
branch 10 22 45.4
condition 1 3 33.3
subroutine 8 9 88.8
pod 0 4 0.0
total 60 84 71.4


line stmt bran cond sub pod time code
1             #------------------------------------------------------------------------------
2             # File: Olympus.pm
3             #
4             # Description: Olympus/Epson EXIF maker notes tags
5             #
6             # Revisions: 12/09/2003 - P. Harvey Created
7             # 11/11/2004 - P. Harvey Added Epson support
8             #
9             # References: 1) http://park2.wakwak.com/~tsuruzoh/Computer/Digicams/exif-e.html
10             # 2) http://www.cybercom.net/~dcoffin/dcraw/
11             # 3) http://www.ozhiker.com/electronics/pjmt/jpeg_info/olympus_mn.html
12             # 4) Markku Hanninen private communication (tests with E-1)
13             # 5) Remi Guyomarch from http://forums.dpreview.com/forums/read.asp?forum=1022&message=12790396
14             # 6) Frank Ledwon private communication (tests with E/C-series cameras)
15             # 7) Michael Meissner private communication
16             # 8) Shingo Noguchi, PhotoXP (http://www.daifukuya.com/photoxp/)
17             # 9) Mark Dapoz private communication
18             # 10) Lilo Huang private communication (E-330)
19             # 11) http://olypedia.de/Olympus_Makernotes (May 30, 2013)
20             # 12) Ioannis Panagiotopoulos private communication (E-510)
21             # 13) Chris Shaw private communication (E-3)
22             # 14) Viktor Lushnikov private communication (E-400)
23             # 15) Yrjo Rauste private communication (E-30)
24             # 16) Godfrey DiGiorgi private communication (E-P1) + http://forums.dpreview.com/forums/read.asp?message=33187567
25             # 17) Martin Hibers private communication
26             # 18) Tomasz Kawecki private communication
27             # 19) Brad Grier private communication
28             # 22) Herbert Kauer private communication
29             # 23) Daniel Pollock private communication (PEN-F)
30             # 24) Sebastian private communication (E-M1 Mark III)
31             # IB) Iliah Borg private communication (LibRaw)
32             # NJ) Niels Kristian Bech Jensen private communication
33             #------------------------------------------------------------------------------
34              
35             package Image::ExifTool::Olympus;
36              
37 19     19   5054 use strict;
  19         61  
  19         783  
38 19     19   115 use vars qw($VERSION);
  19         65  
  19         1086  
39 19     19   144 use Image::ExifTool qw(:DataAccess :Utils);
  19         75  
  19         4700  
40 19     19   1460 use Image::ExifTool::Exif;
  19         107  
  19         570  
41 19     19   8261 use Image::ExifTool::APP12;
  19         70  
  19         155179  
42              
43             $VERSION = '2.81';
44              
45             sub PrintLensInfo($$$);
46              
47             my %offOn = ( 0 => 'Off', 1 => 'On' );
48              
49             # lookup for Olympus LensType values
50             # (as of ExifTool 9.15, this was the complete list of chipped lenses at www.four-thirds.org)
51             my %olympusLensTypes = (
52             Notes => q{
53             The numerical values below are given in hexadecimal. (Prior to ExifTool
54             9.15 these were in decimal.)
55             },
56             '0 00 00' => 'None',
57             # Olympus lenses (also Kenko Tokina)
58             '0 01 00' => 'Olympus Zuiko Digital ED 50mm F2.0 Macro',
59             '0 01 01' => 'Olympus Zuiko Digital 40-150mm F3.5-4.5', #8
60             '0 01 10' => 'Olympus M.Zuiko Digital ED 14-42mm F3.5-5.6', #PH (E-P1 pre-production)
61             '0 02 00' => 'Olympus Zuiko Digital ED 150mm F2.0',
62             '0 02 10' => 'Olympus M.Zuiko Digital 17mm F2.8 Pancake', #PH (E-P1 pre-production)
63             '0 03 00' => 'Olympus Zuiko Digital ED 300mm F2.8',
64             '0 03 10' => 'Olympus M.Zuiko Digital ED 14-150mm F4.0-5.6 [II]', #11 (The second version of this lens seems to have the same lens ID number as the first version #NJ)
65             '0 04 10' => 'Olympus M.Zuiko Digital ED 9-18mm F4.0-5.6', #11
66             '0 05 00' => 'Olympus Zuiko Digital 14-54mm F2.8-3.5',
67             '0 05 01' => 'Olympus Zuiko Digital Pro ED 90-250mm F2.8', #9
68             '0 05 10' => 'Olympus M.Zuiko Digital ED 14-42mm F3.5-5.6 L', #11 (E-PL1)
69             '0 06 00' => 'Olympus Zuiko Digital ED 50-200mm F2.8-3.5',
70             '0 06 01' => 'Olympus Zuiko Digital ED 8mm F3.5 Fisheye', #9
71             '0 06 10' => 'Olympus M.Zuiko Digital ED 40-150mm F4.0-5.6', #PH
72             '0 07 00' => 'Olympus Zuiko Digital 11-22mm F2.8-3.5',
73             '0 07 01' => 'Olympus Zuiko Digital 18-180mm F3.5-6.3', #6
74             '0 07 10' => 'Olympus M.Zuiko Digital ED 12mm F2.0', #PH
75             '0 08 01' => 'Olympus Zuiko Digital 70-300mm F4.0-5.6', #7 (seen as release 1 - PH)
76             '0 08 10' => 'Olympus M.Zuiko Digital ED 75-300mm F4.8-6.7', #PH
77             '0 09 10' => 'Olympus M.Zuiko Digital 14-42mm F3.5-5.6 II', #PH (E-PL2)
78             '0 10 01' => 'Kenko Tokina Reflex 300mm F6.3 MF Macro', #NJ
79             '0 10 10' => 'Olympus M.Zuiko Digital ED 12-50mm F3.5-6.3 EZ', #PH
80             '0 11 10' => 'Olympus M.Zuiko Digital 45mm F1.8', #17
81             '0 12 10' => 'Olympus M.Zuiko Digital ED 60mm F2.8 Macro', #NJ
82             '0 13 10' => 'Olympus M.Zuiko Digital 14-42mm F3.5-5.6 II R', #PH/NJ
83             '0 14 10' => 'Olympus M.Zuiko Digital ED 40-150mm F4.0-5.6 R', #19
84             # '0 14 10.1' => 'Olympus M.Zuiko Digital ED 14-150mm F4.0-5.6 II', #11 (questionable & unconfirmed -- all samples I can find are '0 3 10' - PH)
85             '0 15 00' => 'Olympus Zuiko Digital ED 7-14mm F4.0',
86             '0 15 10' => 'Olympus M.Zuiko Digital ED 75mm F1.8', #PH
87             '0 16 10' => 'Olympus M.Zuiko Digital 17mm F1.8', #NJ
88             '0 17 00' => 'Olympus Zuiko Digital Pro ED 35-100mm F2.0', #7
89             '0 18 00' => 'Olympus Zuiko Digital 14-45mm F3.5-5.6',
90             '0 18 10' => 'Olympus M.Zuiko Digital ED 75-300mm F4.8-6.7 II', #NJ
91             '0 19 10' => 'Olympus M.Zuiko Digital ED 12-40mm F2.8 Pro', #PH
92             '0 20 00' => 'Olympus Zuiko Digital 35mm F3.5 Macro', #9
93             '0 20 10' => 'Olympus M.Zuiko Digital ED 40-150mm F2.8 Pro', #NJ
94             '0 21 10' => 'Olympus M.Zuiko Digital ED 14-42mm F3.5-5.6 EZ', #NJ
95             '0 22 00' => 'Olympus Zuiko Digital 17.5-45mm F3.5-5.6', #9
96             '0 22 10' => 'Olympus M.Zuiko Digital 25mm F1.8', #NJ
97             '0 23 00' => 'Olympus Zuiko Digital ED 14-42mm F3.5-5.6', #PH
98             '0 23 10' => 'Olympus M.Zuiko Digital ED 7-14mm F2.8 Pro', #NJ
99             '0 24 00' => 'Olympus Zuiko Digital ED 40-150mm F4.0-5.6', #PH
100             '0 24 10' => 'Olympus M.Zuiko Digital ED 300mm F4.0 IS Pro', #NJ
101             '0 25 10' => 'Olympus M.Zuiko Digital ED 8mm F1.8 Fisheye Pro', #NJ
102             '0 26 10' => 'Olympus M.Zuiko Digital ED 12-100mm F4.0 IS Pro', #IB/NJ
103             '0 27 10' => 'Olympus M.Zuiko Digital ED 30mm F3.5 Macro', #IB/NJ
104             '0 28 10' => 'Olympus M.Zuiko Digital ED 25mm F1.2 Pro', #IB/NJ
105             '0 29 10' => 'Olympus M.Zuiko Digital ED 17mm F1.2 Pro', #IB
106             '0 30 00' => 'Olympus Zuiko Digital ED 50-200mm F2.8-3.5 SWD', #7
107             '0 30 10' => 'Olympus M.Zuiko Digital ED 45mm F1.2 Pro', #IB
108             '0 31 00' => 'Olympus Zuiko Digital ED 12-60mm F2.8-4.0 SWD', #7
109             '0 32 00' => 'Olympus Zuiko Digital ED 14-35mm F2.0 SWD', #PH
110             '0 32 10' => 'Olympus M.Zuiko Digital ED 12-200mm F3.5-6.3', #IB
111             '0 33 00' => 'Olympus Zuiko Digital 25mm F2.8', #PH
112             '0 33 10' => 'Olympus M.Zuiko Digital 150-400mm F4.5 TC1.25x IS Pro', #IB
113             '0 34 00' => 'Olympus Zuiko Digital ED 9-18mm F4.0-5.6', #7
114             '0 34 10' => 'Olympus M.Zuiko Digital ED 12-45mm F4.0 Pro', #IB
115             '0 35 00' => 'Olympus Zuiko Digital 14-54mm F2.8-3.5 II', #PH
116             '0 35 10' => 'Olympus M.Zuiko 100-400mm F5.0-6.3', #IB
117             '0 36 10' => 'Olympus M.Zuiko Digital ED 8-25mm F4 Pro', #IB
118             '0 37 10' => 'Olympus M.Zuiko Digital ED 40-150mm F4.0 Pro', #forum3833
119             '0 39 10' => 'Olympus M.Zuiko Digital ED 90mm F3.5 Macro IS Pro', #forum3833
120             # Sigma lenses
121             '1 01 00' => 'Sigma 18-50mm F3.5-5.6 DC', #8
122             '1 01 10' => 'Sigma 30mm F2.8 EX DN', #NJ
123             '1 02 00' => 'Sigma 55-200mm F4.0-5.6 DC',
124             '1 02 10' => 'Sigma 19mm F2.8 EX DN', #NJ
125             '1 03 00' => 'Sigma 18-125mm F3.5-5.6 DC',
126             '1 03 10' => 'Sigma 30mm F2.8 DN | A', #NJ
127             '1 04 00' => 'Sigma 18-125mm F3.5-5.6 DC', #7
128             '1 04 10' => 'Sigma 19mm F2.8 DN | A', #NJ
129             '1 05 00' => 'Sigma 30mm F1.4 EX DC HSM', #10
130             '1 05 10' => 'Sigma 60mm F2.8 DN | A', #NJ
131             '1 06 00' => 'Sigma APO 50-500mm F4.0-6.3 EX DG HSM', #6
132             '1 06 10' => 'Sigma 30mm F1.4 DC DN | C', #NJ
133             '1 07 00' => 'Sigma Macro 105mm F2.8 EX DG', #PH
134             '1 07 10' => 'Sigma 16mm F1.4 DC DN | C (017)', #IB
135             '1 08 00' => 'Sigma APO Macro 150mm F2.8 EX DG HSM', #PH
136             '1 09 00' => 'Sigma 18-50mm F2.8 EX DC Macro', #NJ
137             '1 10 00' => 'Sigma 24mm F1.8 EX DG Aspherical Macro', #PH
138             '1 11 00' => 'Sigma APO 135-400mm F4.5-5.6 DG', #11
139             '1 12 00' => 'Sigma APO 300-800mm F5.6 EX DG HSM', #11
140             '1 13 00' => 'Sigma 30mm F1.4 EX DC HSM', #11
141             '1 14 00' => 'Sigma APO 50-500mm F4.0-6.3 EX DG HSM', #11
142             '1 15 00' => 'Sigma 10-20mm F4.0-5.6 EX DC HSM', #11
143             '1 16 00' => 'Sigma APO 70-200mm F2.8 II EX DG Macro HSM', #11
144             '1 17 00' => 'Sigma 50mm F1.4 EX DG HSM', #11
145             # Panasonic/Leica lenses
146             '2 01 00' => 'Leica D Vario Elmarit 14-50mm F2.8-3.5 Asph.', #11
147             '2 01 10' => 'Lumix G Vario 14-45mm F3.5-5.6 Asph. Mega OIS', #16
148             '2 02 00' => 'Leica D Summilux 25mm F1.4 Asph.', #11
149             '2 02 10' => 'Lumix G Vario 45-200mm F4.0-5.6 Mega OIS', #16
150             '2 03 00' => 'Leica D Vario Elmar 14-50mm F3.8-5.6 Asph. Mega OIS', #11
151             '2 03 01' => 'Leica D Vario Elmar 14-50mm F3.8-5.6 Asph.', #14 (L10 kit)
152             '2 03 10' => 'Lumix G Vario HD 14-140mm F4.0-5.8 Asph. Mega OIS', #16
153             '2 04 00' => 'Leica D Vario Elmar 14-150mm F3.5-5.6', #13
154             '2 04 10' => 'Lumix G Vario 7-14mm F4.0 Asph.', #PH (E-P1 pre-production)
155             '2 05 10' => 'Lumix G 20mm F1.7 Asph.', #16
156             '2 06 10' => 'Leica DG Macro-Elmarit 45mm F2.8 Asph. Mega OIS', #PH
157             '2 07 10' => 'Lumix G Vario 14-42mm F3.5-5.6 Asph. Mega OIS', #NJ
158             '2 08 10' => 'Lumix G Fisheye 8mm F3.5', #PH
159             '2 09 10' => 'Lumix G Vario 100-300mm F4.0-5.6 Mega OIS', #11
160             '2 10 10' => 'Lumix G 14mm F2.5 Asph.', #17
161             '2 11 10' => 'Lumix G 12.5mm F12 3D', #NJ (H-FT012)
162             '2 12 10' => 'Leica DG Summilux 25mm F1.4 Asph.', #NJ
163             '2 13 10' => 'Lumix G X Vario PZ 45-175mm F4.0-5.6 Asph. Power OIS', #NJ
164             '2 14 10' => 'Lumix G X Vario PZ 14-42mm F3.5-5.6 Asph. Power OIS', #NJ
165             '2 15 10' => 'Lumix G X Vario 12-35mm F2.8 Asph. Power OIS', #PH
166             '2 16 10' => 'Lumix G Vario 45-150mm F4.0-5.6 Asph. Mega OIS', #NJ
167             '2 17 10' => 'Lumix G X Vario 35-100mm F2.8 Power OIS', #PH
168             '2 18 10' => 'Lumix G Vario 14-42mm F3.5-5.6 II Asph. Mega OIS', #NJ
169             '2 19 10' => 'Lumix G Vario 14-140mm F3.5-5.6 Asph. Power OIS', #NJ
170             '2 20 10' => 'Lumix G Vario 12-32mm F3.5-5.6 Asph. Mega OIS', #NJ
171             '2 21 10' => 'Leica DG Nocticron 42.5mm F1.2 Asph. Power OIS', #NJ
172             '2 22 10' => 'Leica DG Summilux 15mm F1.7 Asph.', #NJ
173             '2 23 10' => 'Lumix G Vario 35-100mm F4.0-5.6 Asph. Mega OIS', #NJ
174             '2 24 10' => 'Lumix G Macro 30mm F2.8 Asph. Mega OIS', #NJ
175             '2 25 10' => 'Lumix G 42.5mm F1.7 Asph. Power OIS', #NJ
176             '2 26 10' => 'Lumix G 25mm F1.7 Asph.', #NJ
177             '2 27 10' => 'Leica DG Vario-Elmar 100-400mm F4.0-6.3 Asph. Power OIS', #NJ
178             '2 28 10' => 'Lumix G Vario 12-60mm F3.5-5.6 Asph. Power OIS', #NJ
179             '2 29 10' => 'Leica DG Summilux 12mm F1.4 Asph.', #IB
180             '2 30 10' => 'Leica DG Vario-Elmarit 12-60mm F2.8-4 Asph. Power OIS', #IB
181             '2 31 10' => 'Lumix G Vario 45-200mm F4.0-5.6 II', #forum3833
182             '2 32 10' => 'Lumix G Vario 100-300mm F4.0-5.6 II', #PH
183             '2 33 10' => 'Lumix G X Vario 12-35mm F2.8 II Asph. Power OIS', #IB
184             '2 34 10' => 'Lumix G Vario 35-100mm F2.8 II', #forum3833
185             '2 35 10' => 'Leica DG Vario-Elmarit 8-18mm F2.8-4 Asph.', #IB
186             '2 36 10' => 'Leica DG Elmarit 200mm F2.8 Power OIS', #IB
187             '2 37 10' => 'Leica DG Vario-Elmarit 50-200mm F2.8-4 Asph. Power OIS', #IB
188             '2 38 10' => 'Leica DG Vario-Summilux 10-25mm F1.7 Asph.', #IB
189             '2 40 10' => 'Leica DG Vario-Summilux 25-50mm F1.7 Asph.', #IB (H-X2550)
190             '3 01 00' => 'Leica D Vario Elmarit 14-50mm F2.8-3.5 Asph.', #11
191             '3 02 00' => 'Leica D Summilux 25mm F1.4 Asph.', #11
192             # Tamron lenses
193             '5 01 10' => 'Tamron 14-150mm F3.5-5.8 Di III', #NJ (model C001)
194             # '65535 07 40' - Seen for LUMIX S 16-35/F4 on Panasonic DC-S1H (ref PH)
195             # Other makes
196             '24 01 10' => 'Venus Optics Laowa 50mm F2.8 2x Macro', #DonKomarechka
197             );
198              
199             # lookup for Olympus camera types (ref PH)
200             my %olympusCameraTypes = (
201             Notes => q{
202             These values are currently decoded only for Olympus models. Models with
203             Olympus-style maker notes from other brands such as Acer, BenQ, Hitachi, HP,
204             Premier, Konica-Minolta, Maginon, Ricoh, Rollei, SeaLife, Sony, Supra,
205             Vivitar are not listed.
206             },
207             D4028 => 'X-2,C-50Z',
208             D4029 => 'E-20,E-20N,E-20P',
209             D4034 => 'C720UZ',
210             D4040 => 'E-1',
211             D4041 => 'E-300',
212             D4083 => 'C2Z,D520Z,C220Z',
213             D4106 => 'u20D,S400D,u400D',
214             D4120 => 'X-1',
215             D4122 => 'u10D,S300D,u300D',
216             D4125 => 'AZ-1',
217             D4141 => 'C150,D390',
218             D4193 => 'C-5000Z',
219             D4194 => 'X-3,C-60Z',
220             D4199 => 'u30D,S410D,u410D',
221             D4205 => 'X450,D535Z,C370Z',
222             D4210 => 'C160,D395',
223             D4211 => 'C725UZ',
224             D4213 => 'FerrariMODEL2003',
225             D4216 => 'u15D',
226             D4217 => 'u25D',
227             D4220 => 'u-miniD,Stylus V',
228             D4221 => 'u40D,S500,uD500',
229             D4231 => 'FerrariMODEL2004',
230             D4240 => 'X500,D590Z,C470Z',
231             D4244 => 'uD800,S800',
232             D4256 => 'u720SW,S720SW',
233             D4261 => 'X600,D630,FE5500',
234             D4262 => 'uD600,S600',
235             D4301 => 'u810/S810', # (yes, "/". Olympus is not consistent in the notation)
236             D4302 => 'u710,S710',
237             D4303 => 'u700,S700',
238             D4304 => 'FE100,X710',
239             D4305 => 'FE110,X705',
240             D4310 => 'FE-130,X-720',
241             D4311 => 'FE-140,X-725',
242             D4312 => 'FE150,X730',
243             D4313 => 'FE160,X735',
244             D4314 => 'u740,S740',
245             D4315 => 'u750,S750',
246             D4316 => 'u730/S730',
247             D4317 => 'FE115,X715',
248             D4321 => 'SP550UZ',
249             D4322 => 'SP510UZ',
250             D4324 => 'FE170,X760',
251             D4326 => 'FE200',
252             D4327 => 'FE190/X750', # (also SX876)
253             D4328 => 'u760,S760',
254             D4330 => 'FE180/X745', # (also SX875)
255             D4331 => 'u1000/S1000',
256             D4332 => 'u770SW,S770SW',
257             D4333 => 'FE240/X795',
258             D4334 => 'FE210,X775',
259             D4336 => 'FE230/X790',
260             D4337 => 'FE220,X785',
261             D4338 => 'u725SW,S725SW',
262             D4339 => 'FE250/X800',
263             D4341 => 'u780,S780',
264             D4343 => 'u790SW,S790SW',
265             D4344 => 'u1020,S1020',
266             D4346 => 'FE15,X10',
267             D4348 => 'FE280,X820,C520',
268             D4349 => 'FE300,X830',
269             D4350 => 'u820,S820',
270             D4351 => 'u1200,S1200',
271             D4352 => 'FE270,X815,C510',
272             D4353 => 'u795SW,S795SW',
273             D4354 => 'u1030SW,S1030SW',
274             D4355 => 'SP560UZ',
275             D4356 => 'u1010,S1010',
276             D4357 => 'u830,S830',
277             D4359 => 'u840,S840',
278             D4360 => 'FE350WIDE,X865',
279             D4361 => 'u850SW,S850SW',
280             D4362 => 'FE340,X855,C560',
281             D4363 => 'FE320,X835,C540',
282             D4364 => 'SP570UZ',
283             D4366 => 'FE330,X845,C550',
284             D4368 => 'FE310,X840,C530',
285             D4370 => 'u1050SW,S1050SW',
286             D4371 => 'u1060,S1060',
287             D4372 => 'FE370,X880,C575',
288             D4374 => 'SP565UZ',
289             D4377 => 'u1040,S1040',
290             D4378 => 'FE360,X875,C570',
291             D4379 => 'FE20,X15,C25',
292             D4380 => 'uT6000,ST6000',
293             D4381 => 'uT8000,ST8000',
294             D4382 => 'u9000,S9000',
295             D4384 => 'SP590UZ',
296             D4385 => 'FE3010,X895',
297             D4386 => 'FE3000,X890',
298             D4387 => 'FE35,X30',
299             D4388 => 'u550WP,S550WP',
300             D4390 => 'FE5000,X905',
301             D4391 => 'u5000',
302             D4392 => 'u7000,S7000',
303             D4396 => 'FE5010,X915',
304             D4397 => 'FE25,X20',
305             D4398 => 'FE45,X40',
306             D4401 => 'XZ-1',
307             D4402 => 'uT6010,ST6010',
308             D4406 => 'u7010,S7010 / u7020,S7020',
309             D4407 => 'FE4010,X930',
310             D4408 => 'X560WP',
311             D4409 => 'FE26,X21',
312             D4410 => 'FE4000,X920,X925',
313             D4411 => 'FE46,X41,X42',
314             D4412 => 'FE5020,X935',
315             D4413 => 'uTough-3000',
316             D4414 => 'StylusTough-6020',
317             D4415 => 'StylusTough-8010',
318             D4417 => 'u5010,S5010',
319             D4418 => 'u7040,S7040',
320             D4419 => 'u9010,S9010',
321             D4423 => 'FE4040',
322             D4424 => 'FE47,X43',
323             D4426 => 'FE4030,X950',
324             D4428 => 'FE5030,X965,X960',
325             D4430 => 'u7030,S7030',
326             D4432 => 'SP600UZ',
327             D4434 => 'SP800UZ',
328             D4439 => 'FE4020,X940',
329             D4442 => 'FE5035',
330             D4448 => 'FE4050,X970',
331             D4450 => 'FE5050,X985',
332             D4454 => 'u-7050',
333             D4464 => 'T10,X27',
334             D4470 => 'FE5040,X980',
335             D4472 => 'TG-310',
336             D4474 => 'TG-610',
337             D4476 => 'TG-810',
338             D4478 => 'VG145,VG140,D715',
339             D4479 => 'VG130,D710',
340             D4480 => 'VG120,D705',
341             D4482 => 'VR310,D720',
342             D4484 => 'VR320,D725',
343             D4486 => 'VR330,D730',
344             D4488 => 'VG110,D700',
345             D4490 => 'SP-610UZ',
346             D4492 => 'SZ-10',
347             D4494 => 'SZ-20',
348             D4496 => 'SZ-30MR',
349             D4498 => 'SP-810UZ',
350             D4500 => 'SZ-11',
351             D4504 => 'TG-615',
352             D4508 => 'TG-620',
353             D4510 => 'TG-820',
354             D4512 => 'TG-1',
355             D4516 => 'SH-21',
356             D4519 => 'SZ-14',
357             D4520 => 'SZ-31MR',
358             D4521 => 'SH-25MR',
359             D4523 => 'SP-720UZ',
360             D4529 => 'VG170',
361             D4531 => 'XZ-2',
362             D4535 => 'SP-620UZ',
363             D4536 => 'TG-320',
364             D4537 => 'VR340,D750',
365             D4538 => 'VG160,X990,D745',
366             D4541 => 'SZ-12',
367             D4545 => 'VH410',
368             D4546 => 'XZ-10', #IB
369             D4547 => 'TG-2',
370             D4548 => 'TG-830',
371             D4549 => 'TG-630',
372             D4550 => 'SH-50',
373             D4553 => 'SZ-16,DZ-105',
374             D4562 => 'SP-820UZ',
375             D4566 => 'SZ-15',
376             D4572 => 'STYLUS1',
377             D4574 => 'TG-3',
378             D4575 => 'TG-850',
379             D4579 => 'SP-100EE',
380             D4580 => 'SH-60',
381             D4581 => 'SH-1',
382             D4582 => 'TG-835',
383             D4585 => 'SH-2 / SH-3',
384             D4586 => 'TG-4',
385             D4587 => 'TG-860',
386             D4591 => 'TG-870',
387             D4593 => 'TG-5', #IB
388             D4603 => 'TG-6', #IB
389             D4809 => 'C2500L',
390             D4842 => 'E-10',
391             D4856 => 'C-1',
392             D4857 => 'C-1Z,D-150Z',
393             DCHC => 'D500L',
394             DCHT => 'D600L / D620L',
395             K0055 => 'AIR-A01',
396             S0003 => 'E-330',
397             S0004 => 'E-500',
398             S0009 => 'E-400',
399             S0010 => 'E-510',
400             S0011 => 'E-3',
401             S0013 => 'E-410',
402             S0016 => 'E-420',
403             S0017 => 'E-30',
404             S0018 => 'E-520',
405             S0019 => 'E-P1',
406             S0023 => 'E-620',
407             S0026 => 'E-P2',
408             S0027 => 'E-PL1',
409             S0029 => 'E-450',
410             S0030 => 'E-600',
411             S0032 => 'E-P3',
412             S0033 => 'E-5',
413             S0034 => 'E-PL2',
414             S0036 => 'E-M5',
415             S0038 => 'E-PL3',
416             S0039 => 'E-PM1',
417             S0040 => 'E-PL1s',
418             S0042 => 'E-PL5',
419             S0043 => 'E-PM2',
420             S0044 => 'E-P5',
421             S0045 => 'E-PL6',
422             S0046 => 'E-PL7', #IB
423             S0047 => 'E-M1',
424             S0051 => 'E-M10',
425             S0052 => 'E-M5MarkII', #IB
426             S0059 => 'E-M10MarkII',
427             S0061 => 'PEN-F', #forum7005
428             S0065 => 'E-PL8',
429             S0067 => 'E-M1MarkII',
430             S0068 => 'E-M10MarkIII',
431             S0076 => 'E-PL9', #IB
432             S0080 => 'E-M1X', #IB
433             S0085 => 'E-PL10', #IB
434             S0089 => 'E-M5MarkIII',
435             S0092 => 'E-M1MarkIII', #IB
436             S0093 => 'E-P7', #IB
437             S0095 => 'OM-1', #IB
438             S0101 => 'OM-5', #IB
439             SR45 => 'D220',
440             SR55 => 'D320L',
441             SR83 => 'D340L',
442             SR85 => 'C830L,D340R',
443             SR852 => 'C860L,D360L',
444             SR872 => 'C900Z,D400Z',
445             SR874 => 'C960Z,D460Z',
446             SR951 => 'C2000Z',
447             SR952 => 'C21',
448             SR953 => 'C21T.commu',
449             SR954 => 'C2020Z',
450             SR955 => 'C990Z,D490Z',
451             SR956 => 'C211Z',
452             SR959 => 'C990ZS,D490Z',
453             SR95A => 'C2100UZ',
454             SR971 => 'C100,D370',
455             SR973 => 'C2,D230',
456             SX151 => 'E100RS',
457             SX351 => 'C3000Z / C3030Z',
458             SX354 => 'C3040Z',
459             SX355 => 'C2040Z',
460             SX357 => 'C700UZ',
461             SX358 => 'C200Z,D510Z',
462             SX374 => 'C3100Z,C3020Z',
463             SX552 => 'C4040Z',
464             SX553 => 'C40Z,D40Z',
465             SX556 => 'C730UZ',
466             SX558 => 'C5050Z',
467             SX571 => 'C120,D380',
468             SX574 => 'C300Z,D550Z',
469             SX575 => 'C4100Z,C4000Z',
470             SX751 => 'X200,D560Z,C350Z',
471             SX752 => 'X300,D565Z,C450Z',
472             SX753 => 'C750UZ',
473             SX754 => 'C740UZ',
474             SX755 => 'C755UZ',
475             SX756 => 'C5060WZ',
476             SX757 => 'C8080WZ',
477             SX758 => 'X350,D575Z,C360Z',
478             SX759 => 'X400,D580Z,C460Z',
479             SX75A => 'AZ-2ZOOM',
480             SX75B => 'D595Z,C500Z',
481             SX75C => 'X550,D545Z,C480Z',
482             SX75D => 'IR-300',
483             SX75F => 'C55Z,C5500Z',
484             SX75G => 'C170,D425',
485             SX75J => 'C180,D435',
486             SX771 => 'C760UZ',
487             SX772 => 'C770UZ',
488             SX773 => 'C745UZ',
489             SX774 => 'X250,D560Z,C350Z',
490             SX775 => 'X100,D540Z,C310Z',
491             SX776 => 'C460ZdelSol',
492             SX777 => 'C765UZ',
493             SX77A => 'D555Z,C315Z',
494             SX851 => 'C7070WZ',
495             SX852 => 'C70Z,C7000Z',
496             SX853 => 'SP500UZ',
497             SX854 => 'SP310',
498             SX855 => 'SP350',
499             SX873 => 'SP320',
500             SX875 => 'FE180/X745', # (also D4330)
501             SX876 => 'FE190/X750', # (also D4327)
502             # other brands
503             # 4MP9Q3 => 'Camera 4MP-9Q3'
504             # 4MP9T2 => 'BenQ DC C420 / Camera 4MP-9T2'
505             # 5MP9Q3 => 'Camera 5MP-9Q3',
506             # 5MP9X9 => 'Camera 5MP-9X9',
507             # '5MP-9T'=> 'Camera 5MP-9T3',
508             # '5MP-9Y'=> 'Camera 5MP-9Y2',
509             # '6MP-9U'=> 'Camera 6MP-9U9',
510             # 7MP9Q3 => 'Camera 7MP-9Q3',
511             # '8MP-9U'=> 'Camera 8MP-9U4',
512             # CE5330 => 'Acer CE-5330',
513             # 'CP-853'=> 'Acer CP-8531',
514             # CS5531 => 'Acer CS5531',
515             # DC500 => 'SeaLife DC500',
516             # DC7370 => 'Camera 7MP-9GA',
517             # DC7371 => 'Camera 7MP-9GM',
518             # DC7371 => 'Hitachi HDC-751E',
519             # DC7375 => 'Hitachi HDC-763E / Rollei RCP-7330X / Ricoh Caplio RR770 / Vivitar ViviCam 7330',
520             # 'DC E63'=> 'BenQ DC E63+',
521             # 'DC P86'=> 'BenQ DC P860',
522             # DS5340 => 'Maginon Performic S5 / Premier 5MP-9M7',
523             # DS5341 => 'BenQ E53+ / Supra TCM X50 / Maginon X50 / Premier 5MP-9P8',
524             # DS5346 => 'Premier 5MP-9Q2',
525             # E500 => 'Konica Minolta DiMAGE E500',
526             # MAGINO => 'Maginon X60',
527             # Mz60 => 'HP Photosmart Mz60',
528             # Q3DIGI => 'Camera 5MP-9Q3',
529             # SLIMLI => 'Supra Slimline X6',
530             # V8300s => 'Vivitar V8300s',
531             );
532              
533             # ArtFilter, ArtFilterEffect and MagicFilter values (ref PH)
534             my %filters = (
535             0 => 'Off',
536             1 => 'Soft Focus', # (XZ-1)
537             2 => 'Pop Art', # (SZ-10 magic filter 1,SZ-31MR,E-M5,E-PL3)
538             3 => 'Pale & Light Color',
539             4 => 'Light Tone',
540             5 => 'Pin Hole', # (SZ-10 magic filter 2,SZ-31MR,E-PL3)
541             6 => 'Grainy Film',
542             9 => 'Diorama',
543             10 => 'Cross Process',
544             12 => 'Fish Eye', # (SZ-10 magic filter 3)
545             13 => 'Drawing', # (SZ-10 magic filter 4)
546             14 => 'Gentle Sepia', # (E-5)
547             15 => 'Pale & Light Color II', #forum6269 ('Tender Light' ref 11)
548             16 => 'Pop Art II', #11 (E-PL3 "(dark)" - PH)
549             17 => 'Pin Hole II', #11 (E-PL3 "(color 2)" - PH)
550             18 => 'Pin Hole III', #11 (E-M5, E-PL3 "(color 3)" - PH)
551             19 => 'Grainy Film II', #11
552             20 => 'Dramatic Tone', # (XZ-1,SZ-31MR)
553             21 => 'Punk', # (SZ-10 magic filter 6)
554             22 => 'Soft Focus 2', # (SZ-10 magic filter 5)
555             23 => 'Sparkle', # (SZ-10 magic filter 7)
556             24 => 'Watercolor', # (SZ-10 magic filter 8)
557             25 => 'Key Line', # (E-M5)
558             26 => 'Key Line II', #forum6269
559             27 => 'Miniature', # (SZ-31MR)
560             28 => 'Reflection', # (TG-820,SZ-31MR)
561             29 => 'Fragmented', # (TG-820,SZ-31MR)
562             31 => 'Cross Process II', #forum6269
563             32 => 'Dramatic Tone II', #forum6269 (Dramatic Tone B&W for E-M5)
564             33 => 'Watercolor I', # ('Watercolor I' for EM-1 ref forum6269, 'Watercolor II' for E-PM2 ref PH)
565             34 => 'Watercolor II', #forum6269
566             35 => 'Diorama II', #forum6269
567             36 => 'Vintage', #forum6269
568             37 => 'Vintage II', #forum6269
569             38 => 'Vintage III', #forum6269
570             39 => 'Partial Color', #forum6269
571             40 => 'Partial Color II', #forum6269
572             41 => 'Partial Color III', #forum6269
573             );
574              
575             my %toneLevelType = (
576             0 => '0',
577             -31999 => 'Highlights',
578             -31998 => 'Shadows',
579             -31997 => 'Midtones',
580             );
581              
582             # tag information for WAV "Index" tags
583             my %indexInfo = (
584             Format => 'int32u',
585             RawConv => '$val == 0xffffffff ? undef : $val',
586             ValueConv => '$val / 1000',
587             PrintConv => 'ConvertDuration($val)',
588             );
589              
590             # Olympus tags
591             %Image::ExifTool::Olympus::Main = (
592             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
593             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
594             WRITABLE => 1,
595             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
596             #
597             # Tags 0x0000 through 0x0103 are the same as Konica/Minolta cameras (ref 3)
598             # (removed 0x0101-0x0103 because they weren't supported by my samples - PH)
599             #
600             0x0000 => {
601             Name => 'MakerNoteVersion',
602             Writable => 'undef',
603             },
604             0x0001 => {
605             Name => 'MinoltaCameraSettingsOld',
606             SubDirectory => {
607             TagTable => 'Image::ExifTool::Minolta::CameraSettings',
608             ByteOrder => 'BigEndian',
609             },
610             },
611             0x0003 => {
612             Name => 'MinoltaCameraSettings',
613             SubDirectory => {
614             TagTable => 'Image::ExifTool::Minolta::CameraSettings',
615             ByteOrder => 'BigEndian',
616             },
617             },
618             0x0040 => {
619             Name => 'CompressedImageSize',
620             Writable => 'int32u',
621             },
622             0x0081 => {
623             Name => 'PreviewImageData',
624             Binary => 1,
625             Writable => 0,
626             },
627             0x0088 => {
628             Name => 'PreviewImageStart',
629             Flags => 'IsOffset',
630             OffsetPair => 0x0089, # point to associated byte count
631             DataTag => 'PreviewImage',
632             Writable => 0,
633             Protected => 2,
634             },
635             0x0089 => {
636             Name => 'PreviewImageLength',
637             OffsetPair => 0x0088, # point to associated offset
638             DataTag => 'PreviewImage',
639             Writable => 0,
640             Protected => 2,
641             },
642             0x0100 => {
643             Name => 'ThumbnailImage',
644             Groups => { 2 => 'Preview' },
645             Writable => 'undef',
646             WriteCheck => '$self->CheckImage(\$val)',
647             Binary => 1,
648             },
649             0x0104 => { Name => 'BodyFirmwareVersion', Writable => 'string' }, #11
650             #
651             # end Konica/Minolta tags
652             #
653             0x0200 => {
654             Name => 'SpecialMode',
655             Notes => q{
656             3 numbers: 1. Shooting mode: 0=Normal, 2=Fast, 3=Panorama;
657             2. Sequence Number; 3. Panorama Direction: 1=Left-right,
658             2=Right-left, 3=Bottom-Top, 4=Top-Bottom
659             },
660             Writable => 'int32u',
661             Count => 3,
662             PrintConv => sub { #3
663             my $val = shift;
664             my @v = split ' ', $val;
665             return $val unless @v >= 3;
666             my @v0 = ('Normal','Unknown (1)','Fast','Panorama');
667             my @v2 = ('(none)','Left to Right','Right to Left','Bottom to Top','Top to Bottom');
668             $val = $v0[$v[0]] || "Unknown ($v[0])";
669             $val .= ", Sequence: $v[1]";
670             $val .= ', Panorama: ' . ($v2[$v[2]] || "Unknown ($v[2])");
671             return $val;
672             },
673             },
674             0x0201 => {
675             Name => 'Quality',
676             Writable => 'int16u',
677             Notes => q{
678             Quality values are decoded based on the CameraType tag. All types
679             represent SQ, HQ and SHQ as sequential integers, but in general
680             SX-type cameras start with a value of 0 for SQ while others start
681             with 1
682             },
683             # These values are different for different camera types
684             # (can't have Condition based on CameraType because it isn't known
685             # when this tag is extracted)
686             PrintConv => sub {
687             my ($val, $self) = @_;
688             my %t1 = ( # all SX camera types except SX151
689             0 => 'SQ (Low)',
690             1 => 'HQ (Normal)',
691             2 => 'SHQ (Fine)',
692             6 => 'RAW', #PH - C5050WZ
693             );
694             my %t2 = ( # all other types (except D4322, ref 22)
695             1 => 'SQ (Low)',
696             2 => 'HQ (Normal)',
697             3 => 'SHQ (Fine)',
698             4 => 'RAW',
699             5 => 'Medium-Fine', #PH
700             6 => 'Small-Fine', #PH
701             33 => 'Uncompressed', #PH - C2100Z
702             );
703             my $conv = $self->{CameraType} =~ /^(SX(?!151\b)|D4322)/ ? \%t1 : \%t2;
704             return $$conv{$val} ? $$conv{$val} : "Unknown ($val)";
705             },
706             # (no PrintConvInv because we don't know CameraType at write time)
707             },
708             0x0202 => {
709             Name => 'Macro',
710             Writable => 'int16u',
711             PrintConv => {
712             0 => 'Off',
713             1 => 'On',
714             2 => 'Super Macro', #6
715             },
716             },
717             0x0203 => { #6
718             Name => 'BWMode',
719             Description => 'Black And White Mode',
720             Writable => 'int16u',
721             PrintConv => {
722             0 => 'Off',
723             1 => 'On',
724             6 => '(none)', #22
725             },
726             },
727             0x0204 => {
728             Name => 'DigitalZoom',
729             Writable => 'rational64u',
730             PrintConv => '$val=~/\./ or $val.=".0"; $val',
731             PrintConvInv => '$val',
732             },
733             0x0205 => { #6
734             Name => 'FocalPlaneDiagonal',
735             Writable => 'rational64u',
736             PrintConv => '"$val mm"',
737             PrintConvInv => '$val=~s/\s*mm$//;$val',
738             },
739             0x0206 => { Name => 'LensDistortionParams', Writable => 'int16s', Count => 6 }, #6
740             0x0207 => { #PH (was incorrectly FirmwareVersion, ref 1/3)
741             Name => 'CameraType',
742             Condition => '$$valPt ne "NORMAL"', # FE240, SP510, u730 and u1000 write this
743             Writable => 'string',
744             DataMember => 'CameraType',
745             RawConv => '$self->{CameraType} = $val',
746             SeparateTable => 'CameraType',
747             ValueConv => '$val =~ s/\s+$//; $val', # ("SX151 " has trailing space)
748             ValueConvInv => '$val',
749             PrintConv => \%olympusCameraTypes,
750             Priority => 0,
751             # 'NORMAL' for some models: u730,SP510UZ,u1000,FE240
752             },
753             0x0208 => {
754             Name => 'TextInfo',
755             SubDirectory => {
756             TagTable => 'Image::ExifTool::Olympus::TextInfo',
757             },
758             },
759             0x0209 => {
760             Name => 'CameraID',
761             Format => 'string', # this really should have been a string
762             },
763             0x020b => { Name => 'EpsonImageWidth', Writable => 'int32u' }, #PH
764             0x020c => { Name => 'EpsonImageHeight', Writable => 'int32u' }, #PH
765             0x020d => { Name => 'EpsonSoftware', Writable => 'string' }, #PH
766             0x0280 => { #PH
767             %Image::ExifTool::previewImageTagInfo,
768             Groups => { 2 => 'Preview' },
769             Notes => 'found in ERF and JPG images from some Epson models',
770             Format => 'undef',
771             Writable => 'int8u',
772             },
773             0x0300 => { Name => 'PreCaptureFrames', Writable => 'int16u' }, #6
774             0x0301 => { Name => 'WhiteBoard', Writable => 'int16u' }, #11
775             0x0302 => { #6
776             Name => 'OneTouchWB',
777             Writable => 'int16u',
778             PrintConv => {
779             0 => 'Off',
780             1 => 'On',
781             2 => 'On (Preset)',
782             },
783             },
784             0x0303 => { Name => 'WhiteBalanceBracket', Writable => 'int16u' }, #11
785             0x0304 => { Name => 'WhiteBalanceBias', Writable => 'int16u' }, #11
786             # 0x0305 => 'PrintMatching', ? #11
787             0x0400 => { #IB
788             Name => 'SensorArea',
789             Condition => '$$self{TIFF_TYPE} eq "ERF"',
790             Writable => 'undef',
791             Format => 'int16u',
792             Count => 4,
793             Notes => 'found in Epson ERF images',
794             },
795             0x0401 => { #IB
796             Name => 'BlackLevel',
797             Condition => '$$self{TIFF_TYPE} eq "ERF"',
798             Writable => 'int32u',
799             Count => 4,
800             Notes => 'found in Epson ERF images',
801             },
802             # 0x0402 - BitCodedAutoFocus (ref 11)
803             0x0403 => { #11
804             Name => 'SceneMode',
805             Writable => 'int16u',
806             PrintConvColumns => 2,
807             PrintConv => {
808             0 => 'Normal',
809             1 => 'Standard',
810             2 => 'Auto',
811             3 => 'Intelligent Auto', #PH (guess, u7040)
812             4 => 'Portrait',
813             5 => 'Landscape+Portrait',
814             6 => 'Landscape',
815             7 => 'Night Scene',
816             8 => 'Night+Portrait',
817             9 => 'Sport',
818             10 => 'Self Portrait',
819             11 => 'Indoor',
820             12 => 'Beach & Snow',
821             13 => 'Beach',
822             14 => 'Snow',
823             15 => 'Self Portrait+Self Timer',
824             16 => 'Sunset',
825             17 => 'Cuisine',
826             18 => 'Documents',
827             19 => 'Candle',
828             20 => 'Fireworks',
829             21 => 'Available Light',
830             22 => 'Vivid',
831             23 => 'Underwater Wide1',
832             24 => 'Underwater Macro',
833             25 => 'Museum',
834             26 => 'Behind Glass',
835             27 => 'Auction',
836             28 => 'Shoot & Select1',
837             29 => 'Shoot & Select2',
838             30 => 'Underwater Wide2',
839             31 => 'Digital Image Stabilization',
840             32 => 'Face Portrait',
841             33 => 'Pet',
842             34 => 'Smile Shot',
843             35 => 'Quick Shutter',
844             43 => 'Hand-held Starlight', #PH (SH-21)
845             100 => 'Panorama', #PH (SH-21)
846             101 => 'Magic Filter', #PH
847             103 => 'HDR', #PH (XZ-2)
848             },
849             },
850             0x0404 => { Name => 'SerialNumber', Writable => 'string' }, #PH (D595Z, C7070WZ)
851             0x0405 => { Name => 'Firmware', Writable => 'string' }, #11
852             0x0e00 => { # (AFFieldCoord for models XZ-2 and XZ-10, ref 11)
853             Name => 'PrintIM',
854             Description => 'Print Image Matching',
855             Writable => 0,
856             SubDirectory => {
857             TagTable => 'Image::ExifTool::PrintIM::Main',
858             },
859             },
860             # 0x0e80 - undef[256] - offset 0x30: uint16[2] WB_RGBLevels = val[0]*561,65536,val[1]*431 (ref IB)
861             0x0f00 => {
862             Name => 'DataDump',
863             Writable => 0,
864             Binary => 1,
865             },
866             0x0f01 => { #6
867             Name => 'DataDump2',
868             Writable => 0,
869             Binary => 1,
870             },
871             0x0f04 => {
872             Name => 'ZoomedPreviewStart',
873             # NOTE: this tag is currently not updated properly when the image is rewritten!
874             OffsetPair => 0xf05,
875             DataTag => 'ZoomedPreviewImage',
876             Writable => 'int32u',
877             Protected => 2,
878             },
879             0x0f05 => {
880             Name => 'ZoomedPreviewLength',
881             OffsetPair => 0xf04,
882             DataTag => 'ZoomedPreviewImage',
883             Writable => 'int32u',
884             Protected => 2,
885             },
886             0x0f06 => {
887             Name => 'ZoomedPreviewSize',
888             Writable => 'int16u',
889             Count => 2,
890             },
891             0x1000 => { #6
892             Name => 'ShutterSpeedValue',
893             Writable => 'rational64s',
894             Priority => 0,
895             ValueConv => 'abs($val)<100 ? 2**(-$val) : 0',
896             ValueConvInv => '$val>0 ? -log($val)/log(2) : -100',
897             PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
898             PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
899             },
900             0x1001 => { #6
901             Name => 'ISOValue',
902             Writable => 'rational64s',
903             Priority => 0,
904             ValueConv => '100 * 2 ** ($val - 5)',
905             ValueConvInv => '$val>0 ? log($val/100)/log(2)+5 : 0',
906             PrintConv => 'int($val * 100 + 0.5) / 100',
907             PrintConvInv => '$val',
908             },
909             0x1002 => { #6
910             Name => 'ApertureValue',
911             Writable => 'rational64s',
912             Priority => 0,
913             ValueConv => '2 ** ($val / 2)',
914             ValueConvInv => '$val>0 ? 2*log($val)/log(2) : 0',
915             PrintConv => 'sprintf("%.1f",$val)',
916             PrintConvInv => '$val',
917             },
918             0x1003 => { #6
919             Name => 'BrightnessValue',
920             Writable => 'rational64s',
921             Priority => 0,
922             },
923             0x1004 => { #3
924             Name => 'FlashMode',
925             Writable => 'int16u',
926             PrintConv => {
927             2 => 'On', #PH
928             3 => 'Off', #PH
929             },
930             },
931             0x1005 => { #6
932             Name => 'FlashDevice',
933             Writable => 'int16u',
934             PrintConv => {
935             0 => 'None',
936             1 => 'Internal',
937             4 => 'External',
938             5 => 'Internal + External',
939             },
940             },
941             0x1006 => { #6
942             Name =>'ExposureCompensation',
943             Writable => 'rational64s',
944             },
945             0x1007 => { Name => 'SensorTemperature',Writable => 'int16s' }, #6 (E-10, E-20 and C2500L - numbers usually around 30-40)
946             0x1008 => { Name => 'LensTemperature', Writable => 'int16s' }, #6
947             0x1009 => { Name => 'LightCondition', Writable => 'int16u' }, #11
948             0x100a => { #11
949             Name => 'FocusRange',
950             Writable => 'int16u',
951             PrintConv => {
952             0 => 'Normal',
953             1 => 'Macro',
954             },
955             },
956             0x100b => { #6
957             Name => 'FocusMode',
958             Writable => 'int16u',
959             PrintConv => {
960             0 => 'Auto',
961             1 => 'Manual',
962             },
963             },
964             0x100c => { #6
965             Name => 'ManualFocusDistance',
966             Writable => 'rational64u',
967             PrintConv => '"$val mm"', #11
968             PrintConvInv => '$val=~s/\s*mm$//; $val',
969             },
970             0x100d => { Name => 'ZoomStepCount', Writable => 'int16u' }, #6
971             0x100e => { Name => 'FocusStepCount', Writable => 'int16u' }, #6
972             0x100f => { #6
973             Name => 'Sharpness',
974             Writable => 'int16u',
975             Priority => 0,
976             PrintConv => {
977             0 => 'Normal',
978             1 => 'Hard',
979             2 => 'Soft',
980             },
981             },
982             0x1010 => { Name => 'FlashChargeLevel', Writable => 'int16u' }, #6
983             0x1011 => { #3
984             Name => 'ColorMatrix',
985             Writable => 'int16u',
986             Format => 'int16s',
987             Count => 9,
988             },
989             0x1012 => { Name => 'BlackLevel', Writable => 'int16u', Count => 4 }, #3
990             0x1013 => { #11
991             Name => 'ColorTemperatureBG',
992             Writable => 'int16u',
993             Unknown => 1, # (doesn't look like a temperature)
994             },
995             0x1014 => { #11
996             Name => 'ColorTemperatureRG',
997             Writable => 'int16u',
998             Unknown => 1, # (doesn't look like a temperature)
999             },
1000             0x1015 => { #6
1001             Name => 'WBMode',
1002             Writable => 'int16u',
1003             Count => 2,
1004             PrintConvColumns => 2,
1005             PrintConv => {
1006             '1' => 'Auto',
1007             '1 0' => 'Auto',
1008             '1 2' => 'Auto (2)',
1009             '1 4' => 'Auto (4)',
1010             '2 2' => '3000 Kelvin',
1011             '2 3' => '3700 Kelvin',
1012             '2 4' => '4000 Kelvin',
1013             '2 5' => '4500 Kelvin',
1014             '2 6' => '5500 Kelvin',
1015             '2 7' => '6500 Kelvin',
1016             '2 8' => '7500 Kelvin',
1017             '3 0' => 'One-touch',
1018             },
1019             },
1020             0x1017 => { #2
1021             Name => 'RedBalance',
1022             Writable => 'int16u',
1023             Count => 2,
1024             ValueConv => '$val=~s/ .*//; $val / 256',
1025             ValueConvInv => '$val*=256;"$val 64"',
1026             },
1027             0x1018 => { #2
1028             Name => 'BlueBalance',
1029             Writable => 'int16u',
1030             Count => 2,
1031             ValueConv => '$val=~s/ .*//; $val / 256',
1032             ValueConvInv => '$val*=256;"$val 64"',
1033             },
1034             0x1019 => { Name => 'ColorMatrixNumber', Writable => 'int16u' }, #11
1035             # 0x101a is same as CameraID ("OLYMPUS DIGITAL CAMERA") for C2500L - PH
1036             0x101a => { Name => 'SerialNumber', Writable => 'string' }, #3
1037             0x101b => { #11
1038             Name => 'ExternalFlashAE1_0',
1039             Writable => 'int32u',
1040             Unknown => 1, # (what are these?)
1041             },
1042             0x101c => { Name => 'ExternalFlashAE2_0', Writable => 'int32u', Unknown => 1 }, #11
1043             0x101d => { Name => 'InternalFlashAE1_0', Writable => 'int32u', Unknown => 1 }, #11
1044             0x101e => { Name => 'InternalFlashAE2_0', Writable => 'int32u', Unknown => 1 }, #11
1045             0x101f => { Name => 'ExternalFlashAE1', Writable => 'int32u', Unknown => 1 }, #11
1046             0x1020 => { Name => 'ExternalFlashAE2', Writable => 'int32u', Unknown => 1 }, #11
1047             0x1021 => { Name => 'InternalFlashAE1', Writable => 'int32u', Unknown => 1 }, #11
1048             0x1022 => { Name => 'InternalFlashAE2', Writable => 'int32u', Unknown => 1 }, #11
1049             0x1023 => { Name => 'FlashExposureComp', Writable => 'rational64s' }, #6
1050             0x1024 => { Name => 'InternalFlashTable', Writable => 'int16u' }, #11
1051             0x1025 => { Name => 'ExternalFlashGValue', Writable => 'rational64s' }, #11
1052             0x1026 => { #6
1053             Name => 'ExternalFlashBounce',
1054             Writable => 'int16u',
1055             PrintConv => {
1056             0 => 'No',
1057             1 => 'Yes',
1058             },
1059             },
1060             0x1027 => { Name => 'ExternalFlashZoom', Writable => 'int16u' }, #6
1061             0x1028 => { Name => 'ExternalFlashMode', Writable => 'int16u' }, #6
1062             0x1029 => { #3
1063             Name => 'Contrast',
1064             Writable => 'int16u',
1065             PrintConv => { #PH (works with E1)
1066             0 => 'High',
1067             1 => 'Normal',
1068             2 => 'Low',
1069             },
1070             },
1071             0x102a => { Name => 'SharpnessFactor', Writable => 'int16u' }, #3
1072             0x102b => { Name => 'ColorControl', Writable => 'int16u', Count => 6 }, #3
1073             0x102c => { Name => 'ValidBits', Writable => 'int16u', Count => 2 }, #3
1074             0x102d => { Name => 'CoringFilter', Writable => 'int16u' }, #3
1075             0x102e => { Name => 'OlympusImageWidth', Writable => 'int32u' }, #PH
1076             0x102f => { Name => 'OlympusImageHeight', Writable => 'int32u' }, #PH
1077             0x1030 => { Name => 'SceneDetect', Writable => 'int16u' }, #11
1078             0x1031 => { #11
1079             Name => 'SceneArea',
1080             Writable => 'int32u',
1081             Count => 8,
1082             Unknown => 1, # (numbers don't make much sense?)
1083             },
1084             # 0x1032 HAFFINAL? #11
1085             0x1033 => { #11
1086             Name => 'SceneDetectData',
1087             Writable => 'int32u',
1088             Count => 720,
1089             Binary => 1,
1090             Unknown => 1, # (but what does it mean?)
1091             },
1092             0x1034 => { Name => 'CompressionRatio', Writable => 'rational64u' }, #3
1093             0x1035 => { #6
1094             Name => 'PreviewImageValid',
1095             Writable => 'int32u',
1096             DelValue => 0,
1097             PrintConv => { 0 => 'No', 1 => 'Yes' },
1098             },
1099             0x1036 => { #6
1100             Name => 'PreviewImageStart',
1101             Flags => 'IsOffset',
1102             OffsetPair => 0x1037, # point to associated byte count
1103             DataTag => 'PreviewImage',
1104             Writable => 'int32u',
1105             WriteGroup => 'MakerNotes',
1106             Protected => 2,
1107             },
1108             0x1037 => { #6
1109             # (may contain data from multiple previews - PH, FE320)
1110             Name => 'PreviewImageLength',
1111             OffsetPair => 0x1036, # point to associated offset
1112             DataTag => 'PreviewImage',
1113             Writable => 'int32u',
1114             WriteGroup => 'MakerNotes',
1115             Protected => 2,
1116             },
1117             0x1038 => { Name => 'AFResult', Writable => 'int16u' }, #11
1118             0x1039 => { #6
1119             Name => 'CCDScanMode',
1120             Writable => 'int16u',
1121             PrintConv => {
1122             0 => 'Interlaced',
1123             1 => 'Progressive',
1124             },
1125             },
1126             0x103a => { #6
1127             Name => 'NoiseReduction',
1128             Writable => 'int16u',
1129             PrintConv => \%offOn,
1130             },
1131             0x103b => { Name => 'FocusStepInfinity', Writable => 'int16u' }, #6
1132             0x103c => { Name => 'FocusStepNear', Writable => 'int16u' }, #6
1133             0x103d => { Name => 'LightValueCenter', Writable => 'rational64s' }, #11
1134             0x103e => { Name => 'LightValuePeriphery', Writable => 'rational64s' }, #11
1135             0x103f => { #11
1136             Name => 'FieldCount',
1137             Writable => 'int16u',
1138             Unknown => 1, # (but what does it mean?)
1139             },
1140             #
1141             # Olympus really screwed up the format of the following subdirectories (for the
1142             # E-1 and E-300 anyway). Not only is the subdirectory value data not included in
1143             # the size, but also the count is 2 bytes short for the subdirectory itself
1144             # (presumably the Olympus programmers forgot about the 2-byte entry count at the
1145             # start of the subdirectory). This mess is straightened out and these subdirs
1146             # are written properly when ExifTool rewrites the file. Note that this problem
1147             # has been fixed by Olympus in the new-style IFD maker notes since a standard
1148             # SubIFD offset value is used. As written by the camera, the old style
1149             # directories have format 'undef' or 'string', and the new style has format
1150             # 'ifd'. However, some older versions of exiftool may have rewritten the new
1151             # style as 'int32u', so handle both cases. - PH
1152             #
1153             0x2010 => [ #PH
1154             {
1155             Name => 'Equipment',
1156             Condition => '$format ne "ifd" and $format ne "int32u"',
1157             NestedHtmlDump => 2, # (so HtmlDump doesn't show these as double-referenced)
1158             SubDirectory => {
1159             TagTable => 'Image::ExifTool::Olympus::Equipment',
1160             ByteOrder => 'Unknown',
1161             },
1162             },
1163             {
1164             Name => 'EquipmentIFD',
1165             Groups => { 1 => 'MakerNotes' }, # SubIFD needs group 1 set
1166             Flags => 'SubIFD',
1167             FixFormat => 'ifd',
1168             SubDirectory => {
1169             TagTable => 'Image::ExifTool::Olympus::Equipment',
1170             Start => '$val',
1171             },
1172             },
1173             ],
1174             0x2020 => [ #PH
1175             {
1176             Name => 'CameraSettings',
1177             Condition => '$format ne "ifd" and $format ne "int32u"',
1178             NestedHtmlDump => 2,
1179             SubDirectory => {
1180             TagTable => 'Image::ExifTool::Olympus::CameraSettings',
1181             ByteOrder => 'Unknown',
1182             },
1183             },
1184             {
1185             Name => 'CameraSettingsIFD',
1186             Groups => { 1 => 'MakerNotes' },
1187             Flags => 'SubIFD',
1188             FixFormat => 'ifd',
1189             SubDirectory => {
1190             TagTable => 'Image::ExifTool::Olympus::CameraSettings',
1191             Start => '$val',
1192             },
1193             },
1194             ],
1195             0x2030 => [ #PH
1196             {
1197             Name => 'RawDevelopment',
1198             Condition => '$format ne "ifd" and $format ne "int32u"',
1199             NestedHtmlDump => 2,
1200             SubDirectory => {
1201             TagTable => 'Image::ExifTool::Olympus::RawDevelopment',
1202             ByteOrder => 'Unknown',
1203             },
1204             },
1205             {
1206             Name => 'RawDevelopmentIFD',
1207             Groups => { 1 => 'MakerNotes' },
1208             Flags => 'SubIFD',
1209             FixFormat => 'ifd',
1210             SubDirectory => {
1211             TagTable => 'Image::ExifTool::Olympus::RawDevelopment',
1212             Start => '$val',
1213             },
1214             },
1215             ],
1216             0x2031 => [ #11
1217             {
1218             Name => 'RawDev2',
1219             Condition => '$format ne "ifd" and $format ne "int32u"',
1220             NestedHtmlDump => 2,
1221             SubDirectory => {
1222             TagTable => 'Image::ExifTool::Olympus::RawDevelopment2',
1223             ByteOrder => 'Unknown',
1224             },
1225             },
1226             {
1227             Name => 'RawDev2IFD',
1228             Groups => { 1 => 'MakerNotes' },
1229             Flags => 'SubIFD',
1230             FixFormat => 'ifd',
1231             SubDirectory => {
1232             TagTable => 'Image::ExifTool::Olympus::RawDevelopment2',
1233             Start => '$val',
1234             },
1235             },
1236             ],
1237             0x2040 => [ #PH
1238             {
1239             Name => 'ImageProcessing',
1240             Condition => '$format ne "ifd" and $format ne "int32u"',
1241             NestedHtmlDump => 2,
1242             SubDirectory => {
1243             TagTable => 'Image::ExifTool::Olympus::ImageProcessing',
1244             ByteOrder => 'Unknown',
1245             },
1246             },
1247             {
1248             Name => 'ImageProcessingIFD',
1249             Groups => { 1 => 'MakerNotes' },
1250             Flags => 'SubIFD',
1251             FixFormat => 'ifd',
1252             SubDirectory => {
1253             TagTable => 'Image::ExifTool::Olympus::ImageProcessing',
1254             Start => '$val',
1255             },
1256             },
1257             ],
1258             0x2050 => [ #PH
1259             {
1260             Name => 'FocusInfo',
1261             Condition => '$format ne "ifd" and $format ne "int32u" and not $$self{OlympusCAMER}',
1262             NestedHtmlDump => 2,
1263             SubDirectory => {
1264             TagTable => 'Image::ExifTool::Olympus::FocusInfo',
1265             ByteOrder => 'Unknown',
1266             },
1267             },
1268             {
1269             Name => 'FocusInfoIFD',
1270             Condition => 'not $$self{OlympusCAMER}',
1271             Groups => { 1 => 'MakerNotes' },
1272             Flags => 'SubIFD',
1273             FixFormat => 'ifd',
1274             SubDirectory => {
1275             TagTable => 'Image::ExifTool::Olympus::FocusInfo',
1276             Start => '$val',
1277             },
1278             },
1279             {
1280             # ASCII-based camera parameters if makernotes starts with "CAMER\0"
1281             # (or for Sony models starting with "SONY PI\0" or "PREMI\0")
1282             Name => 'CameraParameters',
1283             Writable => 'undef',
1284             Binary => 1,
1285             },
1286             ],
1287             0x2100 => [
1288             { #11
1289             Name => 'Olympus2100',
1290             Condition => '$format ne "ifd" and $format ne "int32u"',
1291             NestedHtmlDump => 2,
1292             SubDirectory => {
1293             TagTable => 'Image::ExifTool::Olympus::FETags',
1294             ByteOrder => 'Unknown',
1295             },
1296             },
1297             { #PH
1298             Name => 'Olympus2100IFD',
1299             Groups => { 1 => 'MakerNotes' },
1300             Flags => 'SubIFD',
1301             FixFormat => 'ifd',
1302             SubDirectory => {
1303             TagTable => 'Image::ExifTool::Olympus::FETags',
1304             ByteOrder => 'Unknown',
1305             Start => '$val',
1306             },
1307             },
1308             ],
1309             0x2200 => [
1310             { #11
1311             Name => 'Olympus2200',
1312             Condition => '$format ne "ifd" and $format ne "int32u"',
1313             NestedHtmlDump => 2,
1314             SubDirectory => {
1315             TagTable => 'Image::ExifTool::Olympus::FETags',
1316             ByteOrder => 'Unknown',
1317             },
1318             },
1319             { #PH
1320             Name => 'Olympus2200IFD',
1321             Groups => { 1 => 'MakerNotes' },
1322             Flags => 'SubIFD',
1323             FixFormat => 'ifd',
1324             SubDirectory => {
1325             TagTable => 'Image::ExifTool::Olympus::FETags',
1326             ByteOrder => 'Unknown',
1327             Start => '$val',
1328             },
1329             },
1330             ],
1331             0x2300 => [
1332             { #11
1333             Name => 'Olympus2300',
1334             Condition => '$format ne "ifd" and $format ne "int32u"',
1335             NestedHtmlDump => 2,
1336             SubDirectory => {
1337             TagTable => 'Image::ExifTool::Olympus::FETags',
1338             ByteOrder => 'Unknown',
1339             },
1340             },
1341             { #PH
1342             Name => 'Olympus2300IFD',
1343             Groups => { 1 => 'MakerNotes' },
1344             Flags => 'SubIFD',
1345             FixFormat => 'ifd',
1346             SubDirectory => {
1347             TagTable => 'Image::ExifTool::Olympus::FETags',
1348             ByteOrder => 'Unknown',
1349             Start => '$val',
1350             },
1351             },
1352             ],
1353             0x2400 => [
1354             { #11
1355             Name => 'Olympus2400',
1356             Condition => '$format ne "ifd" and $format ne "int32u"',
1357             NestedHtmlDump => 2,
1358             SubDirectory => {
1359             TagTable => 'Image::ExifTool::Olympus::FETags',
1360             ByteOrder => 'Unknown',
1361             },
1362             },
1363             { #PH
1364             Name => 'Olympus2400IFD',
1365             Groups => { 1 => 'MakerNotes' },
1366             Flags => 'SubIFD',
1367             FixFormat => 'ifd',
1368             SubDirectory => {
1369             TagTable => 'Image::ExifTool::Olympus::FETags',
1370             ByteOrder => 'Unknown',
1371             Start => '$val',
1372             },
1373             },
1374             ],
1375             0x2500 => [
1376             { #11
1377             Name => 'Olympus2500',
1378             Condition => '$format ne "ifd" and $format ne "int32u"',
1379             NestedHtmlDump => 2,
1380             SubDirectory => {
1381             TagTable => 'Image::ExifTool::Olympus::FETags',
1382             ByteOrder => 'Unknown',
1383             },
1384             },
1385             { #PH
1386             Name => 'Olympus2500IFD',
1387             Groups => { 1 => 'MakerNotes' },
1388             Flags => 'SubIFD',
1389             FixFormat => 'ifd',
1390             SubDirectory => {
1391             TagTable => 'Image::ExifTool::Olympus::FETags',
1392             ByteOrder => 'Unknown',
1393             Start => '$val',
1394             },
1395             },
1396             ],
1397             0x2600 => [
1398             { #11
1399             Name => 'Olympus2600',
1400             Condition => '$format ne "ifd" and $format ne "int32u"',
1401             NestedHtmlDump => 2,
1402             SubDirectory => {
1403             TagTable => 'Image::ExifTool::Olympus::FETags',
1404             ByteOrder => 'Unknown',
1405             },
1406             },
1407             { #PH
1408             Name => 'Olympus2600IFD',
1409             Groups => { 1 => 'MakerNotes' },
1410             Flags => 'SubIFD',
1411             FixFormat => 'ifd',
1412             SubDirectory => {
1413             TagTable => 'Image::ExifTool::Olympus::FETags',
1414             ByteOrder => 'Unknown',
1415             Start => '$val',
1416             },
1417             },
1418             ],
1419             0x2700 => [
1420             { #11
1421             Name => 'Olympus2700',
1422             Condition => '$format ne "ifd" and $format ne "int32u"',
1423             NestedHtmlDump => 2,
1424             SubDirectory => {
1425             TagTable => 'Image::ExifTool::Olympus::FETags',
1426             ByteOrder => 'Unknown',
1427             },
1428             },
1429             { #PH
1430             Name => 'Olympus2700IFD',
1431             Groups => { 1 => 'MakerNotes' },
1432             Flags => 'SubIFD',
1433             FixFormat => 'ifd',
1434             SubDirectory => {
1435             TagTable => 'Image::ExifTool::Olympus::FETags',
1436             ByteOrder => 'Unknown',
1437             Start => '$val',
1438             },
1439             },
1440             ],
1441             0x2800 => [
1442             { #11
1443             Name => 'Olympus2800',
1444             Condition => '$format ne "ifd" and $format ne "int32u"',
1445             NestedHtmlDump => 2,
1446             SubDirectory => {
1447             TagTable => 'Image::ExifTool::Olympus::FETags',
1448             ByteOrder => 'Unknown',
1449             },
1450             },
1451             { #PH
1452             Name => 'Olympus2800IFD',
1453             Groups => { 1 => 'MakerNotes' },
1454             Flags => 'SubIFD',
1455             FixFormat => 'ifd',
1456             SubDirectory => {
1457             TagTable => 'Image::ExifTool::Olympus::FETags',
1458             ByteOrder => 'Unknown',
1459             Start => '$val',
1460             },
1461             },
1462             ],
1463             0x2900 => [
1464             { #11
1465             Name => 'Olympus2900',
1466             Condition => '$format ne "ifd" and $format ne "int32u"',
1467             NestedHtmlDump => 2,
1468             SubDirectory => {
1469             TagTable => 'Image::ExifTool::Olympus::FETags',
1470             ByteOrder => 'Unknown',
1471             },
1472             },
1473             { #PH
1474             Name => 'Olympus2900IFD',
1475             Groups => { 1 => 'MakerNotes' },
1476             Flags => 'SubIFD',
1477             FixFormat => 'ifd',
1478             SubDirectory => {
1479             TagTable => 'Image::ExifTool::Olympus::FETags',
1480             ByteOrder => 'Unknown',
1481             Start => '$val',
1482             },
1483             },
1484             ],
1485             0x3000 => [
1486             { #6
1487             Name => 'RawInfo',
1488             Condition => '$format ne "ifd" and $format ne "int32u"',
1489             NestedHtmlDump => 2,
1490             SubDirectory => {
1491             TagTable => 'Image::ExifTool::Olympus::RawInfo',
1492             ByteOrder => 'Unknown',
1493             },
1494             },
1495             { #PH
1496             Name => 'RawInfoIFD',
1497             Groups => { 1 => 'MakerNotes' },
1498             Flags => 'SubIFD',
1499             FixFormat => 'ifd',
1500             SubDirectory => {
1501             TagTable => 'Image::ExifTool::Olympus::RawInfo',
1502             Start => '$val',
1503             },
1504             },
1505             ],
1506             0x4000 => [ #PH
1507             {
1508             Name => 'MainInfo',
1509             Condition => '$format ne "ifd" and $format ne "int32u"',
1510             NestedHtmlDump => 2,
1511             SubDirectory => {
1512             TagTable => 'Image::ExifTool::Olympus::Main',
1513             ByteOrder => 'Unknown',
1514             },
1515             },
1516             {
1517             Name => 'MainInfoIFD',
1518             Groups => { 1 => 'MakerNotes' },
1519             Flags => 'SubIFD',
1520             FixFormat => 'ifd',
1521             SubDirectory => {
1522             TagTable => 'Image::ExifTool::Olympus::Main',
1523             Start => '$val',
1524             },
1525             },
1526             ],
1527             0x5000 => [ #PH
1528             {
1529             Name => 'UnknownInfo',
1530             Condition => '$format ne "ifd" and $format ne "int32u"',
1531             NestedHtmlDump => 2,
1532             SubDirectory => {
1533             TagTable => 'Image::ExifTool::Olympus::UnknownInfo',
1534             ByteOrder => 'Unknown',
1535             },
1536             },
1537             {
1538             Name => 'UnknownInfoIFD',
1539             Groups => { 1 => 'MakerNotes' },
1540             Flags => 'SubIFD',
1541             FixFormat => 'ifd',
1542             SubDirectory => {
1543             TagTable => 'Image::ExifTool::Olympus::UnknownInfo',
1544             Start => '$val',
1545             },
1546             },
1547             ],
1548             );
1549              
1550             # TextInfo tags
1551             %Image::ExifTool::Olympus::TextInfo = (
1552             PROCESS_PROC => \&Image::ExifTool::APP12::ProcessAPP12,
1553             NOTES => q{
1554             This information is in text format (similar to APP12 information, but with
1555             spaces instead of linefeeds). Below are tags which have been observed, but
1556             any information found here will be extracted, even if the tag is not listed.
1557             },
1558             GROUPS => { 0 => 'MakerNotes', 1 => 'Olympus', 2 => 'Image' },
1559             Resolution => { },
1560             Type => {
1561             Name => 'CameraType',
1562             Groups => { 2 => 'Camera' },
1563             DataMember => 'CameraType',
1564             RawConv => '$self->{CameraType} = $val',
1565             SeparateTable => 'CameraType',
1566             PrintConv => \%olympusCameraTypes,
1567             },
1568             );
1569              
1570             # Olympus Equipment IFD
1571             %Image::ExifTool::Olympus::Equipment = (
1572             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
1573             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
1574             WRITABLE => 1,
1575             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1576             0x000 => { #PH
1577             Name => 'EquipmentVersion',
1578             Writable => 'undef',
1579             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
1580             Count => 4,
1581             },
1582             0x100 => { #6
1583             Name => 'CameraType2',
1584             Writable => 'string',
1585             Count => 6,
1586             SeparateTable => 'CameraType',
1587             PrintConv => \%olympusCameraTypes,
1588             },
1589             0x101 => { #PH
1590             Name => 'SerialNumber',
1591             Writable => 'string',
1592             Count => 32,
1593             PrintConv => '$val=~s/\s+$//;$val',
1594             PrintConvInv => 'pack("A31",$val)', # pad with spaces to 31 chars
1595             },
1596             0x102 => { #6
1597             Name => 'InternalSerialNumber',
1598             Notes => '16 digits: 0-3=model, 4=year, 5-6=month, 8-12=unit number',
1599             Writable => 'string',
1600             Count => 32,
1601             },
1602             0x103 => { #6
1603             Name => 'FocalPlaneDiagonal',
1604             Writable => 'rational64u',
1605             PrintConv => '"$val mm"',
1606             PrintConvInv => '$val=~s/\s*mm$//;$val',
1607             },
1608             0x104 => { #6
1609             Name => 'BodyFirmwareVersion',
1610             Writable => 'int32u',
1611             PrintConv => '$val=sprintf("%x",$val);$val=~s/(.{3})$/\.$1/;$val',
1612             PrintConvInv => '$val=sprintf("%.3f",$val);$val=~s/\.//;hex($val)',
1613             },
1614             0x201 => { #6
1615             Name => 'LensType',
1616             Writable => 'int8u',
1617             Count => 6,
1618             Notes => q{
1619             6 numbers: 1. Make, 2. Unknown, 3. Model, 4. Sub-model, 5-6. Unknown. Only
1620             the Make, Model and Sub-model are used to identify the lens type
1621             },
1622             SeparateTable => 'LensType',
1623             # Have seen these values for the unknown numbers:
1624             # 2: 0
1625             # 5: 0, 2(Olympus lenses for which I have also seen 0 for this number)
1626             # 6: 0, 16(new Lumix lenses)
1627             ValueConv => 'my @a=split(" ",$val); sprintf("%x %.2x %.2x",@a[0,2,3])',
1628             # set unknown values to zero when writing
1629             ValueConvInv => 'my @a=split(" ",$val); hex($a[0])." 0 ".hex($a[1])." ".hex($a[2])." 0 0"',
1630             PrintConv => \%olympusLensTypes,
1631             },
1632             # apparently the first 3 digits of the lens s/n give the type (ref 4):
1633             # 010 = 50macro
1634             # 040 = EC-14
1635             # 050 = 14-54
1636             # 060 = 50-200
1637             # 080 = EX-25
1638             # 101 = FL-50
1639             # 272 = EC-20 #7
1640             0x202 => { #PH
1641             Name => 'LensSerialNumber',
1642             Writable => 'string',
1643             Count => 32,
1644             PrintConv => '$val=~s/\s+$//;$val',
1645             PrintConvInv => 'pack("A31",$val)', # pad with spaces to 31 chars
1646             },
1647             0x203 => { Name => 'LensModel', Writable => 'string' }, #17
1648             0x204 => { #6
1649             Name => 'LensFirmwareVersion',
1650             Writable => 'int32u',
1651             PrintConv => '$val=sprintf("%x",$val);$val=~s/(.{3})$/\.$1/;$val',
1652             PrintConvInv => '$val=sprintf("%.3f",$val);$val=~s/\.//;hex($val)',
1653             },
1654             0x205 => { #11
1655             Name => 'MaxApertureAtMinFocal',
1656             Writable => 'int16u',
1657             ValueConv => '$val ? sqrt(2)**($val/256) : 0',
1658             ValueConvInv => '$val>0 ? int(512*log($val)/log(2)+0.5) : 0',
1659             PrintConv => 'sprintf("%.1f",$val)',
1660             PrintConvInv => '$val',
1661             },
1662             0x206 => { #5
1663             Name => 'MaxApertureAtMaxFocal',
1664             Writable => 'int16u',
1665             ValueConv => '$val ? sqrt(2)**($val/256) : 0',
1666             ValueConvInv => '$val>0 ? int(512*log($val)/log(2)+0.5) : 0',
1667             PrintConv => 'sprintf("%.1f",$val)',
1668             PrintConvInv => '$val',
1669             },
1670             0x207 => { Name => 'MinFocalLength', Writable => 'int16u' }, #PH
1671             0x208 => { Name => 'MaxFocalLength', Writable => 'int16u' }, #PH
1672             0x20a => { #9
1673             Name => 'MaxAperture', # (at current focal length)
1674             Writable => 'int16u',
1675             ValueConv => '$val ? sqrt(2)**($val/256) : 0',
1676             ValueConvInv => '$val>0 ? int(512*log($val)/log(2)+0.5) : 0',
1677             PrintConv => 'sprintf("%.1f",$val)',
1678             PrintConvInv => '$val',
1679             },
1680             0x20b => { #11
1681             Name => 'LensProperties',
1682             Writable => 'int16u',
1683             PrintConv => 'sprintf("0x%x",$val)',
1684             PrintConvInv => '$val',
1685             },
1686             0x301 => { #6
1687             Name => 'Extender',
1688             Writable => 'int8u',
1689             Count => 6,
1690             Notes => q{
1691             6 numbers: 1. Make, 2. Unknown, 3. Model, 4. Sub-model, 5-6. Unknown. Only
1692             the Make and Model are used to identify the extender
1693             },
1694             ValueConv => 'my @a=split(" ",$val); sprintf("%x %.2x",@a[0,2])',
1695             ValueConvInv => 'my @a=split(" ",$val); hex($a[0])." 0 ".hex($a[1])." 0 0 0"',
1696             PrintConv => {
1697             '0 00' => 'None',
1698             '0 04' => 'Olympus Zuiko Digital EC-14 1.4x Teleconverter',
1699             '0 08' => 'Olympus EX-25 Extension Tube',
1700             '0 10' => 'Olympus Zuiko Digital EC-20 2.0x Teleconverter', #7
1701             },
1702             },
1703             0x302 => { Name => 'ExtenderSerialNumber', Writable => 'string', Count => 32 }, #4
1704             0x303 => { Name => 'ExtenderModel', Writable => 'string' }, #9
1705             0x304 => { #6
1706             Name => 'ExtenderFirmwareVersion',
1707             Writable => 'int32u',
1708             PrintConv => '$val=sprintf("%x",$val);$val=~s/(.{3})$/\.$1/;$val',
1709             PrintConvInv => '$val=sprintf("%.3f",$val);$val=~s/\.//;hex($val)',
1710             },
1711             0x403 => { #http://dev.exiv2.org/issues/870
1712             Name => 'ConversionLens',
1713             Writable => 'string',
1714             # (observed values: '','TCON','FCON','WCON')
1715             },
1716             0x1000 => { #6
1717             Name => 'FlashType',
1718             Writable => 'int16u',
1719             PrintConv => {
1720             0 => 'None',
1721             2 => 'Simple E-System',
1722             3 => 'E-System',
1723             4 => 'E-System (body powered)', #forum9740
1724             },
1725             },
1726             0x1001 => { #6
1727             Name => 'FlashModel',
1728             Writable => 'int16u',
1729             PrintConvColumns => 2,
1730             PrintConv => {
1731             0 => 'None',
1732             1 => 'FL-20', # (or subtronic digital or Inon UW flash, ref 11)
1733             2 => 'FL-50', # (or Metzblitz+SCA or Cullmann 34, ref 11)
1734             3 => 'RF-11',
1735             4 => 'TF-22',
1736             5 => 'FL-36',
1737             6 => 'FL-50R', #11 (or Metz mecablitz digital)
1738             7 => 'FL-36R', #11
1739             9 => 'FL-14', #11
1740             11 => 'FL-600R', #11
1741             13 => 'FL-LM3', #forum9740
1742             15 => 'FL-900R', #7
1743             },
1744             },
1745             0x1002 => { #6
1746             Name => 'FlashFirmwareVersion',
1747             Writable => 'int32u',
1748             PrintConv => '$val=sprintf("%x",$val);$val=~s/(.{3})$/\.$1/;$val',
1749             PrintConvInv => '$val=sprintf("%.3f",$val);$val=~s/\.//;hex($val)',
1750             },
1751             0x1003 => { Name => 'FlashSerialNumber', Writable => 'string', Count => 32 }, #4
1752             );
1753              
1754             # Olympus camera settings IFD
1755             %Image::ExifTool::Olympus::CameraSettings = (
1756             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
1757             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
1758             WRITABLE => 1,
1759             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1760             0x000 => { #PH
1761             Name => 'CameraSettingsVersion',
1762             Writable => 'undef',
1763             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
1764             Count => 4,
1765             },
1766             0x100 => { #6
1767             Name => 'PreviewImageValid',
1768             Writable => 'int32u',
1769             PrintConv => { 0 => 'No', 1 => 'Yes' },
1770             },
1771             0x101 => { #PH
1772             Name => 'PreviewImageStart',
1773             Flags => 'IsOffset',
1774             OffsetPair => 0x102,
1775             DataTag => 'PreviewImage',
1776             Writable => 'int32u',
1777             WriteGroup => 'MakerNotes',
1778             Protected => 2,
1779             },
1780             0x102 => { #PH
1781             Name => 'PreviewImageLength',
1782             OffsetPair => 0x101,
1783             DataTag => 'PreviewImage',
1784             Writable => 'int32u',
1785             WriteGroup => 'MakerNotes',
1786             Protected => 2,
1787             },
1788             0x200 => { #4
1789             Name => 'ExposureMode',
1790             Writable => 'int16u',
1791             PrintConv => {
1792             1 => 'Manual',
1793             2 => 'Program', #6
1794             3 => 'Aperture-priority AE',
1795             4 => 'Shutter speed priority AE',
1796             5 => 'Program-shift', #6
1797             }
1798             },
1799             0x201 => { #6
1800             Name => 'AELock',
1801             Writable => 'int16u',
1802             PrintConv => \%offOn,
1803             },
1804             0x202 => { #PH/4
1805             Name => 'MeteringMode',
1806             Writable => 'int16u',
1807             PrintConv => {
1808             2 => 'Center-weighted average',
1809             3 => 'Spot',
1810             5 => 'ESP',
1811             261 => 'Pattern+AF', #6
1812             515 => 'Spot+Highlight control', #6
1813             1027 => 'Spot+Shadow control', #6
1814             },
1815             },
1816             0x203 => { Name => 'ExposureShift', Writable => 'rational64s' }, #11 (some models only)
1817             0x204 => { #11 (XZ-1)
1818             Name => 'NDFilter',
1819             PrintConv => \%offOn,
1820             },
1821             0x300 => { #6
1822             Name => 'MacroMode',
1823             Writable => 'int16u',
1824             PrintConv => {
1825             0 => 'Off',
1826             1 => 'On',
1827             2 => 'Super Macro', #11
1828             },
1829             },
1830             0x301 => { #6
1831             Name => 'FocusMode',
1832             Writable => 'int16u',
1833             Count => -1,
1834             Notes => '1 or 2 values',
1835             PrintConv => [{
1836             0 => 'Single AF',
1837             1 => 'Sequential shooting AF',
1838             2 => 'Continuous AF',
1839             3 => 'Multi AF',
1840             4 => 'Face Detect', #11
1841             10 => 'MF',
1842             }, {
1843             0 => '(none)',
1844             BITMASK => { #11
1845             0 => 'S-AF',
1846             2 => 'C-AF',
1847             4 => 'MF',
1848             5 => 'Face Detect',
1849             6 => 'Imager AF',
1850             7 => 'Live View Magnification Frame',
1851             8 => 'AF sensor',
1852             9 => 'Starry Sky AF', #24
1853             },
1854             }],
1855             },
1856             0x302 => { #6
1857             Name => 'FocusProcess',
1858             Writable => 'int16u',
1859             Count => -1,
1860             Notes => '1 or 2 values',
1861             PrintConv => [{
1862             0 => 'AF Not Used',
1863             1 => 'AF Used',
1864             }],
1865             # 2nd value written only by some models (u1050SW, u9000, uT6000, uT6010,
1866             # uT8000, E-30, E-420, E-450, E-520, E-620, E-P1 and E-P2): - PH
1867             # observed values when "AF Not Used": 0, 16
1868             # observed values when "AF Used": 64, 96(face detect on), 256
1869             },
1870             0x303 => { #6
1871             Name => 'AFSearch',
1872             Writable => 'int16u',
1873             PrintConv => {
1874             0 => 'Not Ready',
1875             1 => 'Ready',
1876             },
1877             },
1878             0x304 => { #PH/4
1879             Name => 'AFAreas',
1880             Notes => 'coordinates range from 0 to 255',
1881             Writable => 'int32u',
1882             Count => 64,
1883             PrintConv => 'Image::ExifTool::Olympus::PrintAFAreas($val)',
1884             },
1885             0x0305 => { #PH
1886             Name => 'AFPointSelected',
1887             Notes => 'coordinates expressed as a percent',
1888             Writable => 'rational64s',
1889             Count => 5,
1890             ValueConv => '$val =~ s/\S* //; $val', # ignore first undefined value
1891             ValueConvInv => '"undef $val"',
1892             PrintConv => q{
1893             return 'n/a' if $val =~ /undef/;
1894             sprintf("(%d%%,%d%%) (%d%%,%d%%)", map {$_ * 100} split(" ",$val));
1895             },
1896             PrintConvInv => q{
1897             return 'undef undef undef undef' if $val eq 'n/a';
1898             my @nums = $val =~ /\d+(?:\.\d+)?/g;
1899             return undef unless @nums == 4;
1900             join ' ', map {$_ / 100} @nums;
1901             },
1902             },
1903             0x306 => { #11
1904             Name => 'AFFineTune',
1905             Writable => 'int8u',
1906             PrintConv => { 0 => 'Off', 1 => 'On' },
1907             },
1908             0x307 => { #15
1909             Name => 'AFFineTuneAdj',
1910             Writable => 'int16s',
1911             Count => 3, # not sure what the 3 values mean
1912             },
1913             0x308 => { #forum11578
1914             Name => 'FocusBracketStepSize',
1915             Writable => 'int8u',
1916             },
1917             0x309 => { #forum13341
1918             Name => 'AISubjectTrackingMode',
1919             Writable => 'int16u',
1920             ValueConv => '($val >> 8) . " " . ($val & 0xff)',
1921             ValueConvInv => 'my @a = split " ", $val; $val = $a[0]*256 + $a[1]',
1922             PrintConv => [{
1923             0 => 'Off',
1924             1 => 'Motorsports',
1925             2 => 'Airplanes',
1926             3 => 'Trains',
1927             4 => 'Birds',
1928             5 => 'Dogs & Cats',
1929             },{
1930             0 => 'Object Not Found',
1931             1 => 'Object Found',
1932             }],
1933             },
1934             0x400 => { #6
1935             Name => 'FlashMode',
1936             Writable => 'int16u',
1937             PrintConv => {
1938             0 => 'Off',
1939             BITMASK => {
1940             0 => 'On',
1941             1 => 'Fill-in',
1942             2 => 'Red-eye',
1943             3 => 'Slow-sync',
1944             4 => 'Forced On',
1945             5 => '2nd Curtain',
1946             },
1947             },
1948             },
1949             0x401 => { Name => 'FlashExposureComp', Writable => 'rational64s' }, #6
1950             # 0x402 - FlashMode? bit0=TTL, bit1=auto, bit2=SuperFP (ref 11)
1951             0x403 => { #11
1952             Name => 'FlashRemoteControl',
1953             Writable => 'int16u',
1954             PrintHex => 1,
1955             PrintConvColumns => 2,
1956             PrintConv => {
1957             0 => 'Off',
1958             0x01 => 'Channel 1, Low',
1959             0x02 => 'Channel 2, Low',
1960             0x03 => 'Channel 3, Low',
1961             0x04 => 'Channel 4, Low',
1962             0x09 => 'Channel 1, Mid',
1963             0x0a => 'Channel 2, Mid',
1964             0x0b => 'Channel 3, Mid',
1965             0x0c => 'Channel 4, Mid',
1966             0x11 => 'Channel 1, High',
1967             0x12 => 'Channel 2, High',
1968             0x13 => 'Channel 3, High',
1969             0x14 => 'Channel 4, High',
1970             },
1971             },
1972             0x404 => { #11
1973             Name => 'FlashControlMode',
1974             Writable => 'int16u',
1975             Count => -1,
1976             Notes => '3 or 4 values',
1977             PrintConv => [{
1978             0 => 'Off',
1979             3 => 'TTL',
1980             4 => 'Auto',
1981             5 => 'Manual',
1982             }],
1983             },
1984             0x405 => { #11
1985             Name => 'FlashIntensity',
1986             Writable => 'rational64s',
1987             Count => -1,
1988             Notes => '3 or 4 values',
1989             PrintConv => {
1990             OTHER => sub { shift },
1991             'undef undef undef' => 'n/a',
1992             'undef undef undef undef' => 'n/a (x4)',
1993             },
1994             },
1995             0x406 => { #11
1996             Name => 'ManualFlashStrength',
1997             Writable => 'rational64s',
1998             Count => -1,
1999             Notes => '3 or 4 values',
2000             PrintConv => {
2001             OTHER => sub { shift },
2002             'undef undef undef' => 'n/a',
2003             'undef undef undef undef' => 'n/a (x4)',
2004             },
2005             },
2006             0x500 => { #6
2007             Name => 'WhiteBalance2',
2008             Writable => 'int16u',
2009             PrintConv => {
2010             0 => 'Auto',
2011             1 => 'Auto (Keep Warm Color Off)', #IB
2012             16 => '7500K (Fine Weather with Shade)',
2013             17 => '6000K (Cloudy)',
2014             18 => '5300K (Fine Weather)',
2015             20 => '3000K (Tungsten light)',
2016             21 => '3600K (Tungsten light-like)',
2017             22 => 'Auto Setup', #IB
2018             23 => '5500K (Flash)', #IB
2019             33 => '6600K (Daylight fluorescent)',
2020             34 => '4500K (Neutral white fluorescent)',
2021             35 => '4000K (Cool white fluorescent)',
2022             36 => 'White Fluorescent', #IB
2023             48 => '3600K (Tungsten light-like)',
2024             67 => 'Underwater', #IB
2025             256 => 'One Touch WB 1', #IB
2026             257 => 'One Touch WB 2', #IB
2027             258 => 'One Touch WB 3', #IB
2028             259 => 'One Touch WB 4', #IB
2029             512 => 'Custom WB 1', #IB
2030             513 => 'Custom WB 2', #IB
2031             514 => 'Custom WB 3', #IB
2032             515 => 'Custom WB 4', #IB
2033             },
2034             },
2035             0x501 => { #PH/4
2036             Name => 'WhiteBalanceTemperature',
2037             Writable => 'int16u',
2038             PrintConv => '$val ? $val : "Auto"',
2039             PrintConvInv => '$val=~/^\d+$/ ? $val : 0',
2040             },
2041             0x502 => { #PH/4
2042             Name => 'WhiteBalanceBracket',
2043             Writable => 'int16s',
2044             },
2045             0x503 => { #PH/4/6
2046             Name => 'CustomSaturation',
2047             Writable => 'int16s',
2048             Count => 3,
2049             Notes => '3 numbers: 1. CS Value, 2. Min, 3. Max',
2050             PrintConv => q{
2051             my ($a,$b,$c)=split ' ',$val;
2052             if ($self->{Model} =~ /^E-1\b/) {
2053             $a-=$b; $c-=$b;
2054             return "CS$a (min CS0, max CS$c)";
2055             } else {
2056             return "$a (min $b, max $c)";
2057             }
2058             },
2059             },
2060             0x504 => { #PH/4
2061             Name => 'ModifiedSaturation',
2062             Writable => 'int16u',
2063             PrintConv => {
2064             0 => 'Off',
2065             1 => 'CM1 (Red Enhance)',
2066             2 => 'CM2 (Green Enhance)',
2067             3 => 'CM3 (Blue Enhance)',
2068             4 => 'CM4 (Skin Tones)',
2069             },
2070             },
2071             0x505 => { #PH/4
2072             Name => 'ContrastSetting',
2073             Writable => 'int16s',
2074             Count => 3,
2075             Notes => 'value, min, max',
2076             PrintConv => 'my @v=split " ",$val; "$v[0] (min $v[1], max $v[2])"',
2077             PrintConvInv => '$val=~tr/-0-9 //dc;$val',
2078             },
2079             0x506 => { #PH/4
2080             Name => 'SharpnessSetting',
2081             Writable => 'int16s',
2082             Count => 3,
2083             Notes => 'value, min, max',
2084             PrintConv => 'my @v=split " ",$val; "$v[0] (min $v[1], max $v[2])"',
2085             PrintConvInv => '$val=~tr/-0-9 //dc;$val',
2086             },
2087             0x507 => { #PH/4
2088             Name => 'ColorSpace',
2089             Writable => 'int16u',
2090             PrintConv => { #6
2091             0 => 'sRGB',
2092             1 => 'Adobe RGB',
2093             2 => 'Pro Photo RGB',
2094             },
2095             },
2096             0x509 => { #6
2097             Name => 'SceneMode',
2098             Writable => 'int16u',
2099             PrintConvColumns => 2,
2100             PrintConv => {
2101             0 => 'Standard',
2102             6 => 'Auto', #6
2103             7 => 'Sport',
2104             8 => 'Portrait',
2105             9 => 'Landscape+Portrait',
2106             10 => 'Landscape',
2107             11 => 'Night Scene',
2108             12 => 'Self Portrait', #11
2109             13 => 'Panorama', #6
2110             14 => '2 in 1', #11
2111             15 => 'Movie', #11
2112             16 => 'Landscape+Portrait', #6
2113             17 => 'Night+Portrait',
2114             18 => 'Indoor', #11 (Party - PH)
2115             19 => 'Fireworks',
2116             20 => 'Sunset',
2117             21 => 'Beauty Skin', #PH
2118             22 => 'Macro',
2119             23 => 'Super Macro', #11
2120             24 => 'Food', #11
2121             25 => 'Documents',
2122             26 => 'Museum',
2123             27 => 'Shoot & Select', #11
2124             28 => 'Beach & Snow',
2125             29 => 'Self Protrait+Timer', #11
2126             30 => 'Candle',
2127             31 => 'Available Light', #11
2128             32 => 'Behind Glass', #11
2129             33 => 'My Mode', #11
2130             34 => 'Pet', #11
2131             35 => 'Underwater Wide1', #6
2132             36 => 'Underwater Macro', #6
2133             37 => 'Shoot & Select1', #11
2134             38 => 'Shoot & Select2', #11
2135             39 => 'High Key',
2136             40 => 'Digital Image Stabilization', #6
2137             41 => 'Auction', #11
2138             42 => 'Beach', #11
2139             43 => 'Snow', #11
2140             44 => 'Underwater Wide2', #6
2141             45 => 'Low Key', #6
2142             46 => 'Children', #6
2143             47 => 'Vivid', #11
2144             48 => 'Nature Macro', #6
2145             49 => 'Underwater Snapshot', #11
2146             50 => 'Shooting Guide', #11
2147             54 => 'Face Portrait', #11
2148             57 => 'Bulb', #11
2149             59 => 'Smile Shot', #11
2150             60 => 'Quick Shutter', #11
2151             63 => 'Slow Shutter', #11
2152             64 => 'Bird Watching', #11
2153             65 => 'Multiple Exposure', #11
2154             66 => 'e-Portrait', #11
2155             67 => 'Soft Background Shot', #11
2156             142 => 'Hand-held Starlight', #PH (SH-21)
2157             154 => 'HDR', #PH (XZ-2)
2158             197 => 'Panning', #forum11631 (EM5iii)
2159             203 => 'Light Trails', #forum11631 (EM5iii)
2160             204 => 'Backlight HDR', #forum11631 (EM5iii)
2161             205 => 'Silent', #forum11631 (EM5iii)
2162             206 => 'Multi Focus Shot', #forum11631 (EM5iii)
2163             },
2164             },
2165             0x50a => { #PH/4/6
2166             Name => 'NoiseReduction',
2167             Writable => 'int16u',
2168             PrintConv => {
2169             0 => '(none)',
2170             BITMASK => {
2171             0 => 'Noise Reduction',
2172             1 => 'Noise Filter',
2173             2 => 'Noise Filter (ISO Boost)',
2174             3 => 'Auto', #11
2175             },
2176             },
2177             },
2178             0x50b => { #6
2179             Name => 'DistortionCorrection',
2180             Writable => 'int16u',
2181             PrintConv => \%offOn,
2182             },
2183             0x50c => { #PH/4
2184             Name => 'ShadingCompensation',
2185             Writable => 'int16u',
2186             PrintConv => \%offOn,
2187             },
2188             0x50d => { Name => 'CompressionFactor', Writable => 'rational64u' }, #PH/4
2189             0x50f => { #6
2190             Name => 'Gradation',
2191             Writable => 'int16s',
2192             Notes => '3 or 4 values',
2193             Count => -1,
2194             Relist => [ [0..2], 3 ], # join values 0-2 for PrintConv
2195             PrintConv => [{
2196             '0 0 0' => 'n/a', #PH (?)
2197             '-1 -1 1' => 'Low Key',
2198             '0 -1 1' => 'Normal',
2199             '1 -1 1' => 'High Key',
2200             },{
2201             0 => 'User-Selected',
2202             1 => 'Auto-Override',
2203             }],
2204             },
2205             0x520 => { #6
2206             Name => 'PictureMode',
2207             Writable => 'int16u',
2208             Notes => '1 or 2 values',
2209             Count => -1,
2210             PrintConv => [{
2211             1 => 'Vivid',
2212             2 => 'Natural',
2213             3 => 'Muted',
2214             4 => 'Portrait',
2215             5 => 'i-Enhance', #11
2216             6 => 'e-Portrait', #23
2217             7 => 'Color Creator', #23
2218             9 => 'Color Profile 1', #23
2219             10 => 'Color Profile 2', #23
2220             11 => 'Color Profile 3', #23
2221             12 => 'Monochrome Profile 1', #23
2222             13 => 'Monochrome Profile 2', #23
2223             14 => 'Monochrome Profile 3', #23
2224             256 => 'Monotone',
2225             512 => 'Sepia',
2226             }],
2227             },
2228             0x521 => { #6
2229             Name => 'PictureModeSaturation',
2230             Writable => 'int16s',
2231             Count => 3,
2232             Notes => 'value, min, max',
2233             PrintConv => 'my @v=split " ",$val; "$v[0] (min $v[1], max $v[2])"',
2234             PrintConvInv => '$val=~tr/-0-9 //dc;$val',
2235             },
2236             0x522 => { #6
2237             Name => 'PictureModeHue',
2238             Writable => 'int16s',
2239             Unknown => 1, # (needs verification)
2240             },
2241             0x523 => { #6
2242             Name => 'PictureModeContrast',
2243             Writable => 'int16s',
2244             Count => 3,
2245             Notes => 'value, min, max',
2246             PrintConv => 'my @v=split " ",$val; "$v[0] (min $v[1], max $v[2])"',
2247             PrintConvInv => '$val=~tr/-0-9 //dc;$val',
2248             },
2249             0x524 => { #6
2250             Name => 'PictureModeSharpness',
2251             # verified as the Sharpness setting in the Picture Mode menu for the E-410
2252             Writable => 'int16s',
2253             Count => 3,
2254             Notes => 'value, min, max',
2255             PrintConv => 'my @v=split " ",$val; "$v[0] (min $v[1], max $v[2])"',
2256             PrintConvInv => '$val=~tr/-0-9 //dc;$val',
2257             },
2258             0x525 => { #6
2259             Name => 'PictureModeBWFilter',
2260             Writable => 'int16s',
2261             PrintConvColumns => 2,
2262             PrintConv => {
2263             0 => 'n/a',
2264             1 => 'Neutral',
2265             2 => 'Yellow',
2266             3 => 'Orange',
2267             4 => 'Red',
2268             5 => 'Green',
2269             },
2270             },
2271             0x526 => { #6
2272             Name => 'PictureModeTone',
2273             Writable => 'int16s',
2274             PrintConvColumns => 2,
2275             PrintConv => {
2276             0 => 'n/a',
2277             1 => 'Neutral',
2278             2 => 'Sepia',
2279             3 => 'Blue',
2280             4 => 'Purple',
2281             5 => 'Green',
2282             },
2283             },
2284             0x527 => { #12
2285             Name => 'NoiseFilter',
2286             Writable => 'int16s',
2287             Count => 3,
2288             PrintConv => {
2289             '0 0 0' => 'n/a', #PH (?)
2290             '-2 -2 1' => 'Off',
2291             '-1 -2 1' => 'Low',
2292             '0 -2 1' => 'Standard',
2293             '1 -2 1' => 'High',
2294             },
2295             },
2296             0x529 => { #PH
2297             Name => 'ArtFilter',
2298             Writable => 'int16u',
2299             Count => 4,
2300             PrintConvColumns => 2,
2301             PrintConv => [ \%filters ],
2302             },
2303             0x52c => { #PH
2304             Name => 'MagicFilter',
2305             Writable => 'int16u',
2306             Count => 4, # (2nd number is 0, 1280 or 1792, 3rd/4th are 0)
2307             # (1792 observed for E-5 Gentle Sepia and XZ-1 Dramatic Tone)
2308             PrintConvColumns => 2,
2309             PrintConv => [ \%filters ],
2310             },
2311             0x52d => { #11
2312             Name => 'PictureModeEffect',
2313             Writable => 'int16s',
2314             Count => 3,
2315             PrintConv => {
2316             '0 0 0' => 'n/a', #PH (?)
2317             '-1 -1 1' => 'Low',
2318             '0 -1 1' => 'Standard',
2319             '1 -1 1' => 'High',
2320             },
2321             },
2322             0x52e => { #11/PH
2323             Name => 'ToneLevel',
2324             PrintConv => [
2325             \%toneLevelType,
2326             undef, # (highlights value)
2327             undef, # (highlights min)
2328             undef, # (highlights max)
2329             \%toneLevelType,
2330             undef, # (shadows value)
2331             undef, # (shadows min)
2332             undef, # (shadows max)
2333             \%toneLevelType,
2334             undef, # (midtones value)
2335             undef, # (midtones min)
2336             undef, # (midtones max)
2337             \%toneLevelType,
2338             undef,
2339             undef,
2340             undef,
2341             \%toneLevelType,
2342             undef,
2343             undef,
2344             undef,
2345             \%toneLevelType,
2346             undef,
2347             undef,
2348             undef,
2349             \%toneLevelType,
2350             undef,
2351             undef,
2352             undef,
2353             ]
2354             },
2355             0x52f => { #PH
2356             Name => 'ArtFilterEffect',
2357             Writable => 'int16u',
2358             Count => 20,
2359             PrintHex => 1,
2360             PrintConvColumns => 2,
2361             PrintConv => [
2362             \%filters,
2363             undef,
2364             undef,
2365             '"Partial Color $val"', #23
2366             { # there are 5 available art filter effects for the E-PL3...
2367             0x0000 => 'No Effect',
2368             0x8010 => 'Star Light',
2369             0x8020 => 'Pin Hole',
2370             0x8030 => 'Frame',
2371             0x8040 => 'Soft Focus',
2372             0x8050 => 'White Edge',
2373             0x8060 => 'B&W', # (NC - E-PL2 with "Grainy Film" filter)
2374             0x8080 => 'Blur Top and Bottom', #23
2375             0x8081 => 'Blur Left and Right', #23
2376             # (E-PL2 also has "Pict. Tone" effect)
2377             },
2378             undef,
2379             { #23
2380             0 => 'No Color Filter',
2381             1 => 'Yellow Color Filter',
2382             2 => 'Orange Color Filter',
2383             3 => 'Red Color Filter',
2384             4 => 'Green Color Filter',
2385             },
2386             ],
2387             },
2388             0x532 => { #23
2389             Name => 'ColorCreatorEffect',
2390             Writable => 'int16s',
2391             Count => 6,
2392             PrintConv => [
2393             '"Color $val"',
2394             undef, # (Color min)
2395             undef, # (Color max)
2396             '"Strength $val"',
2397             undef, # (Strength min)
2398             undef, # (Strength max)
2399             ],
2400             },
2401             0x537 => { #23
2402             Name => 'MonochromeProfileSettings',
2403             Writable => 'int16s',
2404             Count => 6,
2405             PrintConv => [
2406             {
2407             0 => 'No Filter',
2408             1 => 'Yellow Filter',
2409             2 => 'Orange Filter',
2410             3 => 'Red Filter',
2411             4 => 'Magenta Filter',
2412             5 => 'Blue Filter',
2413             6 => 'Cyan Filter',
2414             7 => 'Green Filter',
2415             8 => 'Yellow-green Filter',
2416             },
2417             undef, # (Filter number min)
2418             undef, # (Filter number max)
2419             '"Strength $val"',
2420             undef, # (Strength min)
2421             undef, # (Strength max)
2422             ],
2423             },
2424             0x538 => { #23
2425             Name => 'FilmGrainEffect',
2426             Writable => 'int16s',
2427             PrintConv => {
2428             0 => 'Off',
2429             1 => 'Low',
2430             2 => 'Medium',
2431             3 => 'High',
2432             },
2433             },
2434             0x539 => { #23
2435             Name => 'ColorProfileSettings',
2436             Writable => 'int16s',
2437             Count => 14,
2438             PrintConv => [
2439             '"Min $val"',
2440             '"Max $val"',
2441             '"Yellow $val"',
2442             '"Orange $val"',
2443             '"Orange-red $val"',
2444             '"Red $val"',
2445             '"Magenta $val"',
2446             '"Violet $val"',
2447             '"Blue $val"',
2448             '"Blue-cyan $val"',
2449             '"Cyan $val"',
2450             '"Green-cyan $val"',
2451             '"Green $val"',
2452             '"Yellow-green $val"',
2453             ],
2454             },
2455             0x53a => { #23
2456             Name => 'MonochromeVignetting',
2457             Writable => 'int16s',
2458             Notes => '-5 to +5: positive is white vignetting, negative is black vignetting',
2459             },
2460             0x53b => { #23
2461             Name => 'MonochromeColor',
2462             Writable => 'int16s',
2463             PrintConv => {
2464             0 => '(none)',
2465             1 => 'Normal',
2466             2 => 'Sepia',
2467             3 => 'Blue',
2468             4 => 'Purple',
2469             5 => 'Green',
2470             },
2471             },
2472             0x600 => { #PH/4/22
2473             Name => 'DriveMode',
2474             Writable => 'int16u',
2475             Count => -1,
2476             Notes => '2, 3 or 5 numbers: 1. Mode, 2. Shot number, 3. Mode bits, 5. Shutter mode',
2477             PrintConv => q{
2478             my ($a,$b,$c,$d,$e) = split ' ',$val;
2479             if ($e) {
2480             $e = '; ' . ({ 2 => 'Anti-shock 0', 4 => 'Electronic shutter' }->{$e} || "Unknown ($e)");
2481             } else {
2482             $e = '';
2483             }
2484             return "Single Shot$e" unless $a;
2485             if ($a == 5 and defined $c) {
2486             $a = DecodeBits($c, { #6
2487             0 => 'AE',
2488             1 => 'WB',
2489             2 => 'FL',
2490             3 => 'MF',
2491             4 => 'ISO', #forum8906
2492             5 => 'AE Auto', #forum8906
2493             6 => 'Focus', #PH
2494             }) . ' Bracketing';
2495             $a =~ s/, /+/g;
2496             } else {
2497             my %a = (
2498             1 => 'Continuous Shooting',
2499             2 => 'Exposure Bracketing',
2500             3 => 'White Balance Bracketing',
2501             4 => 'Exposure+WB Bracketing', #6
2502             );
2503             $a = $a{$a} || "Unknown ($a)";
2504             }
2505             return "$a, Shot $b$e";
2506             },
2507             },
2508             0x601 => { #6
2509             Name => 'PanoramaMode',
2510             Writable => 'int16u',
2511             Notes => '2 numbers: 1. Mode, 2. Shot number',
2512             PrintConv => q{
2513             my ($a,$b) = split ' ',$val;
2514             return 'Off' unless $a;
2515             my %a = (
2516             1 => 'Left to Right',
2517             2 => 'Right to Left',
2518             3 => 'Bottom to Top',
2519             4 => 'Top to Bottom',
2520             );
2521             return(($a{$a} || "Unknown ($a)") . ', Shot ' . $b);
2522             },
2523             },
2524             0x603 => { #PH/4
2525             Name => 'ImageQuality2',
2526             Writable => 'int16u',
2527             PrintConv => {
2528             1 => 'SQ',
2529             2 => 'HQ',
2530             3 => 'SHQ',
2531             4 => 'RAW',
2532             5 => 'SQ (5)', # (E-500)
2533             },
2534             },
2535             0x604 => { #PH
2536             Name => 'ImageStabilization',
2537             Writable => 'int32u',
2538             DataMember => 'ImageStabilization',
2539             RawConv => '$$self{ImageStabilization} = $val',
2540             PrintConv => {
2541             0 => 'Off',
2542             1 => 'On, Mode 1',
2543             2 => 'On, Mode 2',
2544             3 => 'On, Mode 3',
2545             4 => 'On, Mode 4', # (NC, E-P5)
2546             },
2547             },
2548             0x804 => { #PH (E-M1 with firmware update)
2549             Name => 'StackedImage',
2550             Writable => 'int32u',
2551             Count => 2,
2552             PrintConv => {
2553             '0 0' => 'No',
2554             '1 *' => 'Live Composite (* images)', #24
2555             '4 *' => 'Live Time/Bulb (* images)', #24
2556             '3 2' => 'ND2 (1EV)', #IB
2557             '3 4' => 'ND4 (2EV)', #IB
2558             '3 8' => 'ND8 (3EV)', #IB
2559             '3 16' => 'ND16 (4EV)', #IB
2560             '3 32' => 'ND32 (5EV)', #IB
2561             '3 64' => 'ND64 (6EV)', #forum13341
2562             '5 4' => 'HDR1', #forum8906
2563             '6 4' => 'HDR2', #forum8906
2564             '8 8' => 'Tripod high resolution', #IB
2565             '9 *' => 'Focus-stacked (* images)', #IB (* = 2-15)
2566             '11 12' => 'Hand-held high resolution (11 12)', #forum13341 (OM-1)
2567             '11 16' => 'Hand-held high resolution (11 16)', #IB (perhaps '11 15' would be possible, ref 24)
2568             OTHER => sub {
2569             my ($val, $inv, $conv) = @_;
2570             if ($inv) {
2571             $val = lc $val;
2572             return undef unless $val =~ s/(\d+) images/\* images/;
2573             my $num = $1;
2574             foreach (keys %$conv) {
2575             next unless $val eq lc $$conv{$_};
2576             ($val = $_) =~ s/\*/$num/ or return undef;
2577             return $val;
2578             }
2579             } else {
2580             return "Unknown ($_[0])" unless $val =~ s/ (\d+)/ \*/ and $$conv{$val};
2581             my $num = $1;
2582             ($val = $$conv{$val}) =~ s/\*/$num/;
2583             return $val;
2584             }
2585             },
2586             },
2587             },
2588             0x900 => { #11
2589             Name => 'ManometerPressure',
2590             Writable => 'int16u',
2591             ValueConv => '$val / 10',
2592             ValueConvInv => '$val * 10',
2593             PrintConv => '"$val kPa"',
2594             PrintConvInv => '$val=~s/ ?kPa//i; $val',
2595             },
2596             0x901 => { #PH (u770SW)
2597             # 2 numbers: 1st looks like meters above sea level, 2nd is usually 3x the 1st (feet?)
2598             Name => 'ManometerReading',
2599             Writable => 'int32s',
2600             Count => 2,
2601             ValueConv => 'my @a=split(" ",$val); $_ /= 10 foreach @a; "@a"',
2602             ValueConvInv => 'my @a=split(" ",$val); $_ *= 10 foreach @a; "@a"',
2603             PrintConv => '$val=~s/(\S+) (\S+)/$1 m, $2 ft/; $val',
2604             PrintConvInv => '$val=~s/ ?(m|ft)//gi; $val',
2605             },
2606             0x902 => { #11
2607             Name => 'ExtendedWBDetect',
2608             Writable => 'int16u',
2609             PrintConv => \%offOn,
2610             },
2611             0x903 => { #11
2612             Name => 'RollAngle',
2613             Notes => 'converted to degrees of clockwise camera rotation',
2614             Writable => 'int16s',
2615             Count => 2, # (second value is 0 if level gauge is off)
2616             # negate to express as clockwise rotation
2617             ValueConv => '$val=~s/ 1$// ? -$val/10 : "n/a"',
2618             ValueConvInv => 'IsFloat($val) ? sprintf("%.0f 1",-$val*10) : "0 0"',
2619             },
2620             0x904 => { #11
2621             Name => 'PitchAngle',
2622             Notes => 'converted to degrees of upward camera tilt',
2623             Writable => 'int16s',
2624             Count => 2, # (second value is 0 if level gauge is off)
2625             ValueConv => '$val =~ s/ 1$// ? $val / 10 : "n/a"',
2626             ValueConvInv => 'IsFloat($val) ? sprintf("%.0f 1",$val*10) : "0 0"',
2627             },
2628             0x908 => { #PH (NC, E-M1)
2629             Name => 'DateTimeUTC',
2630             Writable => 'string',
2631             Groups => { 2 => 'Time' },
2632             Shift => 'Time',
2633             PrintConv => '$self->ConvertDateTime($val)',
2634             PrintConvInv => '$self->InverseDateTime($val,undef,1)',
2635             },
2636             );
2637              
2638             # Olympus RAW processing IFD (ref 6)
2639             %Image::ExifTool::Olympus::RawDevelopment = (
2640             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
2641             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
2642             WRITABLE => 1,
2643             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
2644             0x000 => { #PH
2645             Name => 'RawDevVersion',
2646             Writable => 'undef',
2647             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
2648             Count => 4,
2649             },
2650             0x100 => { Name => 'RawDevExposureBiasValue', Writable => 'rational64s' },
2651             0x101 => { Name => 'RawDevWhiteBalanceValue', Writable => 'int16u' },
2652             0x102 => { Name => 'RawDevWBFineAdjustment', Writable => 'int16s' },
2653             0x103 => { Name => 'RawDevGrayPoint', Writable => 'int16u', Count => 3 },
2654             0x104 => { Name => 'RawDevSaturationEmphasis', Writable => 'int16s', Count => 3 },
2655             0x105 => { Name => 'RawDevMemoryColorEmphasis', Writable => 'int16u' },
2656             0x106 => { Name => 'RawDevContrastValue', Writable => 'int16s', Count => 3 },
2657             0x107 => { Name => 'RawDevSharpnessValue', Writable => 'int16s', Count => 3 },
2658             0x108 => {
2659             Name => 'RawDevColorSpace',
2660             Writable => 'int16u',
2661             PrintConv => { #11
2662             0 => 'sRGB',
2663             1 => 'Adobe RGB',
2664             2 => 'Pro Photo RGB',
2665             },
2666             },
2667             0x109 => {
2668             Name => 'RawDevEngine',
2669             Writable => 'int16u',
2670             PrintConv => { #11
2671             0 => 'High Speed',
2672             1 => 'High Function',
2673             2 => 'Advanced High Speed',
2674             3 => 'Advanced High Function',
2675             },
2676             },
2677             0x10a => {
2678             Name => 'RawDevNoiseReduction',
2679             Writable => 'int16u',
2680             PrintConv => { #11
2681             0 => '(none)',
2682             BITMASK => {
2683             0 => 'Noise Reduction',
2684             1 => 'Noise Filter',
2685             2 => 'Noise Filter (ISO Boost)',
2686             },
2687             },
2688             },
2689             0x10b => {
2690             Name => 'RawDevEditStatus',
2691             Writable => 'int16u',
2692             PrintConv => { #11
2693             0 => 'Original',
2694             1 => 'Edited (Landscape)',
2695             6 => 'Edited (Portrait)',
2696             8 => 'Edited (Portrait)',
2697             },
2698             },
2699             0x10c => {
2700             Name => 'RawDevSettings',
2701             Writable => 'int16u',
2702             PrintConv => { #11
2703             0 => '(none)',
2704             BITMASK => {
2705             0 => 'WB Color Temp',
2706             1 => 'WB Gray Point',
2707             2 => 'Saturation',
2708             3 => 'Contrast',
2709             4 => 'Sharpness',
2710             5 => 'Color Space',
2711             6 => 'High Function',
2712             7 => 'Noise Reduction',
2713             },
2714             },
2715             },
2716             );
2717              
2718             # Olympus RAW processing B IFD (ref 11)
2719             %Image::ExifTool::Olympus::RawDevelopment2 = (
2720             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
2721             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
2722             WRITABLE => 1,
2723             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
2724             0x000 => {
2725             Name => 'RawDevVersion',
2726             Writable => 'undef',
2727             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
2728             Count => 4,
2729             },
2730             0x100 => { Name => 'RawDevExposureBiasValue', Writable => 'rational64s' },
2731             0x101 => {
2732             Name => 'RawDevWhiteBalance',
2733             Writable => 'int16u',
2734             PrintConv => {
2735             1 => 'Color Temperature',
2736             2 => 'Gray Point',
2737             },
2738             },
2739             0x102 => { Name => 'RawDevWhiteBalanceValue', Writable => 'int16u' },
2740             0x103 => { Name => 'RawDevWBFineAdjustment', Writable => 'int16s' },
2741             0x104 => { Name => 'RawDevGrayPoint', Writable => 'int16u', Count => 3 },
2742             0x105 => { Name => 'RawDevContrastValue', Writable => 'int16s', Count => 3 },
2743             0x106 => { Name => 'RawDevSharpnessValue', Writable => 'int16s', Count => 3 },
2744             0x107 => { Name => 'RawDevSaturationEmphasis', Writable => 'int16s', Count => 3 },
2745             0x108 => { Name => 'RawDevMemoryColorEmphasis', Writable => 'int16u' },
2746             0x109 => {
2747             Name => 'RawDevColorSpace',
2748             Writable => 'int16u',
2749             PrintConv => {
2750             0 => 'sRGB',
2751             1 => 'Adobe RGB',
2752             2 => 'Pro Photo RGB',
2753             },
2754             },
2755             0x10a => {
2756             Name => 'RawDevNoiseReduction',
2757             Writable => 'int16u',
2758             PrintConv => {
2759             0 => '(none)',
2760             BITMASK => {
2761             0 => 'Noise Reduction',
2762             1 => 'Noise Filter',
2763             2 => 'Noise Filter (ISO Boost)',
2764             },
2765             },
2766             },
2767             0x10b => {
2768             Name => 'RawDevEngine',
2769             Writable => 'int16u',
2770             PrintConv => {
2771             0 => 'High Speed',
2772             1 => 'High Function',
2773             },
2774             },
2775             0x10c => {
2776             Name => 'RawDevPictureMode',
2777             Writable => 'int16u',
2778             PrintConv => {
2779             1 => 'Vivid',
2780             2 => 'Natural',
2781             3 => 'Muted',
2782             256 => 'Monotone',
2783             512 => 'Sepia',
2784             },
2785             },
2786             0x10d => { Name => 'RawDevPMSaturation', Writable => 'int16s', Count => 3 },
2787             0x10e => { Name => 'RawDevPMContrast', Writable => 'int16s', Count => 3 },
2788             0x10f => { Name => 'RawDevPMSharpness', Writable => 'int16s', Count => 3 },
2789             0x110 => {
2790             Name => 'RawDevPM_BWFilter',
2791             Writable => 'int16u',
2792             PrintConv => {
2793             1 => 'Neutral',
2794             2 => 'Yellow',
2795             3 => 'Orange',
2796             4 => 'Red',
2797             5 => 'Green',
2798             },
2799             },
2800             0x111 => {
2801             Name => 'RawDevPMPictureTone',
2802             Writable => 'int16u',
2803             PrintConv => {
2804             1 => 'Neutral',
2805             2 => 'Sepia',
2806             3 => 'Blue',
2807             4 => 'Purple',
2808             5 => 'Green',
2809             },
2810             },
2811             0x112 => { Name => 'RawDevGradation', Writable => 'int16s', Count => 3 },
2812             0x113 => { Name => 'RawDevSaturation3', Writable => 'int16s', Count => 3 }, #(NC Count)
2813             0x119 => { Name => 'RawDevAutoGradation', Writable => 'int16u', PrintConv => \%offOn },
2814             0x120 => { Name => 'RawDevPMNoiseFilter', Writable => 'int16u' }, #(NC format)
2815             0x121 => { #PH (E-P5)
2816             Name => 'RawDevArtFilter',
2817             Writable => 'int16u',
2818             Count => 4,
2819             PrintConvColumns => 2,
2820             PrintConv => [ \%filters ],
2821             },
2822             );
2823              
2824             # Olympus Image processing IFD
2825             %Image::ExifTool::Olympus::ImageProcessing = (
2826             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
2827             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
2828             WRITABLE => 1,
2829             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
2830             0x000 => { #PH
2831             Name => 'ImageProcessingVersion',
2832             Writable => 'undef',
2833             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
2834             Count => 4,
2835             },
2836             0x100 => { Name => 'WB_RBLevels', Writable => 'int16u', Count => 2 }, #6
2837             # 0x101 - in-camera AutoWB unless it is all 0's or all 256's (ref IB)
2838             0x102 => { Name => 'WB_RBLevels3000K', Writable => 'int16u', Count => 2 }, #11
2839             0x103 => { Name => 'WB_RBLevels3300K', Writable => 'int16u', Count => 2 }, #11
2840             0x104 => { Name => 'WB_RBLevels3600K', Writable => 'int16u', Count => 2 }, #11
2841             0x105 => { Name => 'WB_RBLevels3900K', Writable => 'int16u', Count => 2 }, #11
2842             0x106 => { Name => 'WB_RBLevels4000K', Writable => 'int16u', Count => 2 }, #11
2843             0x107 => { Name => 'WB_RBLevels4300K', Writable => 'int16u', Count => 2 }, #11
2844             0x108 => { Name => 'WB_RBLevels4500K', Writable => 'int16u', Count => 2 }, #11
2845             0x109 => { Name => 'WB_RBLevels4800K', Writable => 'int16u', Count => 2 }, #11
2846             0x10a => { Name => 'WB_RBLevels5300K', Writable => 'int16u', Count => 2 }, #11
2847             0x10b => { Name => 'WB_RBLevels6000K', Writable => 'int16u', Count => 2 }, #11
2848             0x10c => { Name => 'WB_RBLevels6600K', Writable => 'int16u', Count => 2 }, #11
2849             0x10d => { Name => 'WB_RBLevels7500K', Writable => 'int16u', Count => 2 }, #11
2850             0x10e => { Name => 'WB_RBLevelsCWB1', Writable => 'int16u', Count => 2 }, #11
2851             0x10f => { Name => 'WB_RBLevelsCWB2', Writable => 'int16u', Count => 2 }, #11
2852             0x110 => { Name => 'WB_RBLevelsCWB3', Writable => 'int16u', Count => 2 }, #11
2853             0x111 => { Name => 'WB_RBLevelsCWB4', Writable => 'int16u', Count => 2 }, #11
2854             0x113 => { Name => 'WB_GLevel3000K', Writable => 'int16u' }, #11
2855             0x114 => { Name => 'WB_GLevel3300K', Writable => 'int16u' }, #11
2856             0x115 => { Name => 'WB_GLevel3600K', Writable => 'int16u' }, #11
2857             0x116 => { Name => 'WB_GLevel3900K', Writable => 'int16u' }, #11
2858             0x117 => { Name => 'WB_GLevel4000K', Writable => 'int16u' }, #11
2859             0x118 => { Name => 'WB_GLevel4300K', Writable => 'int16u' }, #11
2860             0x119 => { Name => 'WB_GLevel4500K', Writable => 'int16u' }, #11
2861             0x11a => { Name => 'WB_GLevel4800K', Writable => 'int16u' }, #11
2862             0x11b => { Name => 'WB_GLevel5300K', Writable => 'int16u' }, #11
2863             0x11c => { Name => 'WB_GLevel6000K', Writable => 'int16u' }, #11
2864             0x11d => { Name => 'WB_GLevel6600K', Writable => 'int16u' }, #11
2865             0x11e => { Name => 'WB_GLevel7500K', Writable => 'int16u' }, #11
2866             0x11f => { Name => 'WB_GLevel', Writable => 'int16u' }, #11
2867             # 0x121 = WB preset for flash (about 6000K) (ref IB)
2868             # 0x125 = WB preset for underwater (ref IB)
2869             0x200 => { #6
2870             Name => 'ColorMatrix',
2871             Writable => 'int16u',
2872             Format => 'int16s',
2873             Count => 9,
2874             },
2875             # color matrices (ref 11):
2876             # 0x0201-0x020d are sRGB color matrices
2877             # 0x020e-0x021a are Adobe RGB color matrices
2878             # 0x021b-0x0227 are ProPhoto RGB color matrices
2879             # 0x0228 and 0x0229 are ColorMatrix for E-330
2880             # 0x0250-0x0252 are sRGB color matrices
2881             # 0x0253-0x0255 are Adobe RGB color matrices
2882             # 0x0256-0x0258 are ProPhoto RGB color matrices
2883             0x300 => { Name => 'Enhancer', Writable => 'int16u' }, #11
2884             0x301 => { Name => 'EnhancerValues', Writable => 'int16u', Count => 7 }, #11
2885             0x310 => { Name => 'CoringFilter', Writable => 'int16u' }, #11
2886             0x311 => { Name => 'CoringValues', Writable => 'int16u', Count => 7 }, #11
2887             0x600 => { Name => 'BlackLevel2', Writable => 'int16u', Count => 4 }, #11
2888             0x610 => { Name => 'GainBase', Writable => 'int16u' }, #11
2889             0x611 => { Name => 'ValidBits', Writable => 'int16u', Count => 2 }, #4/6
2890             0x612 => { Name => 'CropLeft', Writable => 'int16u', Count => 2 }, #11
2891             0x613 => { Name => 'CropTop', Writable => 'int16u', Count => 2 }, #11
2892             0x614 => { Name => 'CropWidth', Writable => 'int32u' }, #PH/11
2893             0x615 => { Name => 'CropHeight', Writable => 'int32u' }, #PH/11
2894             0x635 => { #PH (data starts with "CMIO\x01\0")
2895             Name => 'UnknownBlock1',
2896             Writable => 'undef',
2897             Notes => 'large unknown data block in ORF images but not JPG images',
2898             # 'Drop' because too large for APP1 in JPEG images
2899             Flags => [ 'Unknown', 'Binary', 'Drop' ],
2900             },
2901             0x636 => { #PH (data starts with "CMIO\x01\0")
2902             Name => 'UnknownBlock2',
2903             Writable => 'undef',
2904             Notes => 'large unknown data block in ORF images but not JPG images',
2905             # 'Drop' because too large for APP1 in JPEG images
2906             Flags => [ 'Unknown', 'Binary', 'Drop' ],
2907             },
2908             # 0x800 LensDistortionParams, float[9] (ref 11)
2909             # 0x801 LensShadingParams, int16u[16] (ref 11)
2910             0x0805 => { #IB
2911             Name => 'SensorCalibration',
2912             Notes => '2 numbers: 1. Recommended maximum, 2. Calibration midpoint',
2913             Writable => 'int16s',
2914             Count => 2,
2915             },
2916             # 0x1010-0x1012 are the processing options used in camera or in
2917             # Olympus software, which 0x050a-0x050c are in-camera only (ref 6)
2918             0x1010 => { #PH/4
2919             Name => 'NoiseReduction2',
2920             Writable => 'int16u',
2921             PrintConv => {
2922             0 => '(none)',
2923             BITMASK => {
2924             0 => 'Noise Reduction',
2925             1 => 'Noise Filter',
2926             2 => 'Noise Filter (ISO Boost)',
2927             },
2928             },
2929             },
2930             0x1011 => { #6
2931             Name => 'DistortionCorrection2',
2932             Writable => 'int16u',
2933             PrintConv => \%offOn,
2934             },
2935             0x1012 => { #PH/4
2936             Name => 'ShadingCompensation2',
2937             Writable => 'int16u',
2938             PrintConv => \%offOn,
2939             },
2940             0x101c => { #11
2941             Name => 'MultipleExposureMode',
2942             Writable => 'int16u',
2943             Count => 2,
2944             PrintConv => [{
2945             0 => 'Off',
2946             1 => 'Live Composite', #github issue#61
2947             2 => 'On (2 frames)',
2948             3 => 'On (3 frames)',
2949             }],
2950             },
2951             0x1103 => { #PH
2952             Name => 'UnknownBlock3',
2953             Writable => 'undef',
2954             Notes => 'large unknown data block in ORF images but not JPG images',
2955             # 'Drop' because too large for APP1 in JPEG images
2956             Flags => [ 'Unknown', 'Binary', 'Drop' ],
2957             },
2958             0x1104 => { #PH (overlaps data for 0x1103 in E-M5 ORF images)
2959             Name => 'UnknownBlock4',
2960             Writable => 'undef',
2961             Notes => 'large unknown data block in ORF images but not JPG images',
2962             # 'Drop' because too large for APP1 in JPEG images
2963             Flags => [ 'Unknown', 'Binary', 'Drop' ],
2964             },
2965             0x1112 => { #11
2966             Name => 'AspectRatio',
2967             Writable => 'int8u',
2968             Count => 2,
2969             PrintConv => {
2970             # '0 0' - have seen this with a 16:9 XZ-1 image - PH
2971             '1 1' => '4:3',
2972             '1 4' => '1:1', #PH (E-P5 Storyboard effect, does this indicate 4:3 converted to 6:6?)
2973             '2 1' => '3:2 (RAW)', #forum6285
2974             '2 2' => '3:2',
2975             '3 1' => '16:9 (RAW)', #forum6285
2976             '3 3' => '16:9',
2977             '4 1' => '1:1 (RAW)', #forum6285
2978             '4 4' => '6:6',
2979             '5 5' => '5:4',
2980             '6 6' => '7:6',
2981             '7 7' => '6:5',
2982             '8 8' => '7:5',
2983             '9 1' => '3:4 (RAW)', #forum6285
2984             '9 9' => '3:4',
2985             },
2986             },
2987             0x1113 => { Name => 'AspectFrame', Writable => 'int16u', Count => 4 }, #11
2988             0x1200 => { #11/PH
2989             Name => 'FacesDetected',
2990             Writable => 'int32u',
2991             Count => -1,
2992             Notes => '2 or 3 values',
2993             },
2994             0x1201 => { #11/PH
2995             Name => 'FaceDetectArea',
2996             Writable => 'int16s',
2997             Count => -1, # (varies with model)
2998             Binary => 1, # (too long)
2999             Notes => q{
3000             for models with 2 values in FacesDetected this gives X/Y coordinates in the
3001             FaceDetectFrame for all 4 corners of the face rectangle. For models with 3
3002             values in FacesDetected this gives X/Y coordinates, size and rotation angle
3003             of the face detect square
3004             },
3005             },
3006             0x1202 => { Name => 'MaxFaces', Writable => 'int32u', Count => 3 }, #PH
3007             0x1203 => { #PH
3008             Name => 'FaceDetectFrameSize',
3009             Writable => 'int16u',
3010             Count => 6,
3011             Notes => 'width/height of the full face detect frame',
3012             },
3013             0x1207 => { #PH
3014             Name => 'FaceDetectFrameCrop',
3015             Writable => 'int16s',
3016             Count => 12,
3017             Notes => 'X/Y offset and width/height of the cropped face detect frame',
3018             },
3019             0x1306 => { #PH (NC, E-M1)
3020             Name => 'CameraTemperature',
3021             Writable => 'int16u',
3022             Format => 'int16s', #(NC)
3023             ValueConv => '$val ? $val : undef', # zero for some models (how to differentiate from 0 C?)
3024             Notes => 'this seems to be in degrees C only for some models',
3025             },
3026             0x1900 => { #23
3027             Name => 'KeystoneCompensation',
3028             Writable => 'int8u',
3029             Count => 2,
3030             PrintConv => {
3031             '0 0' => 'Off',
3032             '0 1' => 'On',
3033             },
3034             },
3035             0x1901 => { #23
3036             Name => 'KeystoneDirection',
3037             Writable => 'int8u',
3038             Count => 2,
3039             PrintConv => {
3040             0 => 'Vertical',
3041             1 => 'Horizontal',
3042             },
3043             },
3044             # 0x1905 - focal length (PH, E-M1)
3045             0x1906 => { #23
3046             Name => 'KeystoneValue',
3047             Writable => 'int16s',
3048             Count => 3,
3049             # (use in conjunction with KeystoneDirection, -ve is Top or Right, +ve is Bottom or Left)
3050             Notes => '3 numbers: 1. Keystone Value, 2. Min, 3. Max',
3051             },
3052             );
3053              
3054             # Olympus Focus Info IFD
3055             %Image::ExifTool::Olympus::FocusInfo = (
3056             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
3057             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
3058             WRITABLE => 1,
3059             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3060             0x000 => { #PH
3061             Name => 'FocusInfoVersion',
3062             Writable => 'undef',
3063             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
3064             Count => 4,
3065             },
3066             0x209 => { #PH/4
3067             Name => 'AutoFocus',
3068             Writable => 'int16u',
3069             PrintConv => \%offOn,
3070             Unknown => 1, #6
3071             },
3072             0x210 => { Name => 'SceneDetect', Writable => 'int16u' }, #11
3073             0x211 => { #11
3074             Name => 'SceneArea',
3075             Writable => 'int32u',
3076             Count => 8,
3077             Unknown => 1, # (numbers don't make much sense?)
3078             },
3079             0x212 => { #11
3080             Name => 'SceneDetectData',
3081             Writable => 'int32u',
3082             Count => 720,
3083             Binary => 1,
3084             Unknown => 1, # (but what does it mean?)
3085             },
3086             # 0x214 - int16u: normally 0, but 1 for E-M1 focus-bracketing, and have seen 1 and 256 at other times
3087             0x300 => { Name => 'ZoomStepCount', Writable => 'int16u' }, #6
3088             0x301 => { Name => 'FocusStepCount', Writable => 'int16u' }, #11
3089             0x303 => { Name => 'FocusStepInfinity', Writable => 'int16u' }, #11
3090             0x304 => { Name => 'FocusStepNear', Writable => 'int16u' }, #11
3091             0x305 => { #4
3092             Name => 'FocusDistance',
3093             Writable => 'rational64u',
3094             # this rational value looks like it is in mm when the denominator is
3095             # 1 (E-1), and cm when denominator is 10 (E-300), so if we ignore the
3096             # denominator we are consistently in mm - PH
3097             Format => 'int32u',
3098             Count => 2,
3099             ValueConv => q{
3100             my ($a,$b) = split ' ',$val;
3101             return 0 if $a == 0xffffffff;
3102             return $a / 1000;
3103             },
3104             ValueConvInv => q{
3105             return '4294967295 1' unless $val;
3106             $val = int($val * 1000 + 0.5);
3107             return "$val 1";
3108             },
3109             PrintConv => '$val ? "$val m" : "inf"',
3110             PrintConvInv => '$val eq "inf" ? 0 : $val=~s/\s*m$//, $val',
3111             },
3112             0x308 => [ # NEED A BETTER WAY TO DETERMINE WHICH MODELS USE WHICH ENCODING!
3113             {
3114             Name => 'AFPoint',
3115             Condition => '$$self{Model} =~ /E-(3|5|30)\b/',
3116             Writable => 'int16u',
3117             PrintHex => 1,
3118             # decoded by ref 6
3119             Notes => q{
3120             for the E-3, E-5 and E-30 the value is separated into 2 parts: low 5 bits
3121             give AF point, upper bits give AF target selection mode
3122             },
3123             ValueConv => '($val & 0x1f) . " " . ($val & 0xffe0)',
3124             ValueConvInv => 'my @v=split(" ",$val); @v == 2 ? $v[0] + $v[1] : $val',
3125             PrintConvColumns => 2,
3126             PrintConv => [
3127             {
3128             0x00 => '(none)',
3129             0x01 => 'Top-left (horizontal)',
3130             0x02 => 'Top-center (horizontal)',
3131             0x03 => 'Top-right (horizontal)',
3132             0x04 => 'Left (horizontal)',
3133             0x05 => 'Mid-left (horizontal)',
3134             0x06 => 'Center (horizontal)',
3135             0x07 => 'Mid-right (horizontal)',
3136             0x08 => 'Right (horizontal)',
3137             0x09 => 'Bottom-left (horizontal)',
3138             0x0a => 'Bottom-center (horizontal)',
3139             0x0b => 'Bottom-right (horizontal)',
3140             0x0c => 'Top-left (vertical)',
3141             0x0d => 'Top-center (vertical)',
3142             0x0e => 'Top-right (vertical)',
3143             0x0f => 'Left (vertical)',
3144             0x10 => 'Mid-left (vertical)',
3145             0x11 => 'Center (vertical)',
3146             0x12 => 'Mid-right (vertical)',
3147             0x13 => 'Right (vertical)',
3148             0x14 => 'Bottom-left (vertical)',
3149             0x15 => 'Bottom-center (vertical)',
3150             0x16 => 'Bottom-right (vertical)',
3151             0x1f => 'n/a', #PH (NC, E-3)
3152             },
3153             {
3154             0x00 => 'Single Target',
3155             0x40 => 'All Target',
3156             0x80 => 'Dynamic Single Target',
3157             0xe0 => 'n/a', #PH (NC, E-3)
3158             }
3159             ],
3160             },{ #PH (models with 7-point AF)
3161             Name => 'AFPoint',
3162             Condition => '$$self{Model} =~ /E-(520|600|620)\b/',
3163             Notes => 'models with 7-point AF',
3164             Writable => 'int16u',
3165             PrintHex => 1,
3166             ValueConv => '($val & 0x1f) . " " . ($val & 0xffe0)',
3167             ValueConvInv => 'my @v=split(" ",$val); @v == 2 ? $v[0] + $v[1] : $val',
3168             PrintConv => [ # herb values added:
3169             # based on code of W.P. in https://exiftool.org/forum/index.php?topic=14144.0
3170             {
3171             # 0x00 => '(none)',
3172             # 0x01 => 'Center',
3173             # need to fill this in...
3174             0x00 => '(none)',
3175             0x02 => 'Top-center (horizontal)',
3176             0x04 => 'Right (horizontal)',
3177             0x05 => 'Mid-right (horizontal)',
3178             0x06 => 'Center (horizontal)',
3179             0x07 => 'Mid-left (horizontal)',
3180             0x08 => 'Left (horizontal)',
3181             0x0a => 'Bottom-center (horizontal)',
3182             0x0c => 'Top-center (vertical)',
3183             0x0f => 'Right (vertical)',
3184             0x15 => 'Bottom-center (vertical)',
3185             0x10 => 'Mid-right (vertical)',
3186             0x11 => 'Center (vertical)',
3187             0x12 => 'Mid-left (vertical)',
3188             0x13 => 'Left (vertical)',
3189             },
3190             {
3191             0x00 => 'Single Target',
3192             0x40 => 'All Target', # (guess)
3193             },
3194             ]
3195             },{ #herb all camera model except E-Mxxx and OM-x
3196             Name => 'AFPoint',
3197             Condition => '$$self{Model} !~ /^(E-M|OM-)/ ',
3198             Writable => 'int16u',
3199             Notes => 'models other than E-Mxxx and OM-x',
3200             RawConv => '($val or $$self{Model} ne "E-P1") ? $val : undef',
3201             PrintConv => {
3202             # (E-P1 always writes 0, maybe other models do too - PH)
3203             0 => 'Left (or n/a)',
3204             1 => 'Center (horizontal)', #6 (E-510)
3205             2 => 'Right',
3206             3 => 'Center (vertical)', #6 (E-510)
3207             255 => 'None',
3208             },
3209             },{ #herb all newer models E-Mxxx and OM-x; we do not know details
3210             Name => 'AFPoint',
3211             Writable => 'int16u',
3212             Notes => 'other models',
3213             }
3214             ],
3215             # 0x31a Continuous AF parameters?
3216             0x31b => [ #herb, based on investigations of abgestumpft: https://exiftool.org/forum/index.php?topic=14527.0
3217             # for newer models E-Mxxx and OM-x
3218             {
3219             Name => 'AFPointDetails',
3220             Condition => '$$self{Model} =~ m/^E-M|^OM-/ ',
3221             Writable => 'int16u',
3222             Notes => 'models E-Mxxx and OM-x',
3223             PrintHex => 1,
3224             ValueConv => '(($val >> 13) & 0x7) . " " . (($val >> 12) & 0x1) . " " . (($val >> 11) & 0x1) . " " .
3225             # subject detect face and eye half press
3226             (($val >> 8) & 0x3) . " " . (($val >> 7) & 0x1) . " " . (($val >> 5) & 0x1) . " " .
3227             # eye AF face detect x-AF with MF
3228             (($val >> 4) & 0x1) . " " . (($val >> 3) & 0x1) . " " . ($val & 0x7)',
3229             # release object found MF...
3230             PrintConvColumns => 4,
3231             PrintConv => [
3232             {
3233             # should be identical to AISubjectTrackingMode
3234             0 => 'No Subject Detection',
3235             1 => 'Motorsports',
3236             2 => 'Airplanes',
3237             3 => 'Trains',
3238             4 => 'Birds',
3239             5 => 'Dogs & Cats',
3240             },{
3241             0 => 'Face Priority',
3242             1 => 'Target Priority',
3243             },{
3244             0 => 'Normal AF',
3245             1 => 'AF on Half Press',
3246             },{
3247             0 => 'No Eye-AF',
3248             1 => 'Right Eye Priority',
3249             2 => 'Left Eye Priority',
3250             3 => 'Both Eyes Priority',
3251             },{
3252             0 => 'No Face Detection',
3253             1 => 'Face Detection',
3254             },{
3255             0 => 'No MF',
3256             1 => 'With MF',
3257             },{
3258             0 => 'AF Priority',
3259             1 => 'Release Priority',
3260             },{
3261             0 => 'No Object found',
3262             1 => 'Object found',
3263             },{
3264             0 => 'MF',
3265             1 => 'S-AF',
3266             2 => 'C-AF',
3267             6 => 'C-AF + TR',
3268             },
3269             ],
3270             },{ # for older models
3271             Name => 'AFPointDetails',
3272             Writable => 'int16u',
3273             Notes => 'other models',
3274             }
3275             ],
3276             0x328 => { #PH
3277             Name => 'AFInfo',
3278             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::AFInfo' },
3279             },
3280             # 0x1200-0x1209 Flash information:
3281             0x1201 => { #6
3282             Name => 'ExternalFlash',
3283             Writable => 'int16u',
3284             Count => 2,
3285             PrintConv => {
3286             '0 0' => 'Off',
3287             '1 0' => 'On',
3288             },
3289             },
3290             0x1203 => { #11
3291             Name => 'ExternalFlashGuideNumber',
3292             Writable => 'rational64s',
3293             Unknown => 1, # (needs verification)
3294             },
3295             0x1204 => { #11(reversed)/7
3296             Name => 'ExternalFlashBounce',
3297             Writable => 'int16u',
3298             PrintConv => {
3299             0 => 'Bounce or Off',
3300             1 => 'Direct',
3301             },
3302             },
3303             0x1205 => { Name => 'ExternalFlashZoom', Writable => 'rational64u' }, #11 (ref converts to mm using table)
3304             0x1208 => { #6
3305             Name => 'InternalFlash',
3306             Writable => 'int16u',
3307             Count => -1,
3308             PrintConv => {
3309             '0' => 'Off',
3310             '1' => 'On',
3311             '0 0' => 'Off',
3312             '1 0' => 'On',
3313             },
3314             },
3315             0x1209 => { #6
3316             Name => 'ManualFlash',
3317             Writable => 'int16u',
3318             Count => 2,
3319             Notes => '2 numbers: 1. 0=Off, 1=On, 2. Flash strength',
3320             PrintConv => q{
3321             my ($a,$b) = split ' ',$val;
3322             return 'Off' unless $a;
3323             $b = ($b == 1) ? 'Full' : "1/$b";
3324             return "On ($b strength)";
3325             },
3326             },
3327             0x120a => { #PH
3328             Name => 'MacroLED',
3329             Writable => 'int16u',
3330             PrintConv => \%offOn,
3331             },
3332             0x1500 => [{ #6
3333             Name => 'SensorTemperature',
3334             # (Stylus 1 stores values like "34 0 0")
3335             Condition => '$$self{Model} =~ /E-(1|M5)\b/ || $count != 1',
3336             Writable => 'int16s',
3337             PrintConv => '$val=~s/ 0 0$//; "$val C"',
3338             PrintConvInv => '$val=~s/ ?C$//; $val',
3339             },{
3340             Name => 'SensorTemperature',
3341             Writable => 'int16s',
3342             RawConv => '($val and $val ne "-32768") ? $val : undef', # ignore 0 and -32768
3343             # ValueConv => '-2*(($val/135)**2)+55', #11
3344             ValueConv => '84 - 3 * $val / 26', #https://exiftool.org/forum/index.php/topic,5423.0.html
3345             ValueConvInv => 'int((84 - $val) * 26 / 3 + 0.5)',
3346             PrintConv => 'sprintf("%.1f C",$val)',
3347             PrintConvInv => '$val=~s/ ?C$//; $val',
3348             # data from test shots by Eric Sibert:
3349             # E-510 E-620
3350             # Raw Ambient Raw Ambient
3351             # --- ------- --- -------
3352             # 534 22.7 518 22.7
3353             # 550 20.6 531 19.3
3354             # 552 20.8 533 17.9
3355             # 558 19.3 582 17.2
3356             # 564 19.1 621 12.3
3357             # 567 17.8 634 9.7
3358             # 576 18.6 650 8.0
3359             # 582 17.2 660 7.7
3360             # 599 13.8 703 3.3
3361             # 631 10.7 880 -20.6
3362             # 642 12.4 880 -20.6
3363             # 652 9.6 892 -24.4
3364             # 692 5.2 892 -22.7
3365             # 714 3.3
3366             # 895 -19.8
3367             # 895 -19.2
3368             # 900 -21.7
3369             }],
3370             0x1600 => { # ref http://fourthirdsphoto.com/vbb/showpost.php?p=107607&postcount=15
3371             Name => 'ImageStabilization',
3372             # (the other value is more reliable, so ignore this totally if the other exists)
3373             Condition => 'not defined $$self{ImageStabilization}',
3374             Writable => 'undef',
3375             # if the first 4 bytes are non-zero, then bit 0x01 of byte 44
3376             # gives the stabilization mode
3377             PrintConv => q{
3378             $val =~ /^\0{4}/ ? 'Off' : 'On, ' .
3379             (unpack('x44C',$val) & 0x01 ? 'Mode 1' : 'Mode 2')
3380             },
3381             },
3382             # 0x102a same as Subdir4-0x300
3383             );
3384              
3385             # AF information (ref PH)
3386             %Image::ExifTool::Olympus::AFInfo = (
3387             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3388             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3389             FIRST_ENTRY => 0,
3390             # 0x2a - int8u: ImagerAFMode? 0=Manual, 1=Auto
3391             # 0x30 - int16u: AFAreaXPosition?
3392             # 0x32 - int16u: AFAreaWidth? (202)
3393             # 0x34 - int16u: AFAreaYPosition?
3394             # 0x36 - int16u: AFAreaHeight? (50)
3395             # (AF area positions above give the top-left coordinates of the AF area in the
3396             # AF frame. Increasing Y is downwards, and the AF frame size is about 1280x256)
3397             );
3398              
3399             # Olympus raw information tags (ref 6)
3400             %Image::ExifTool::Olympus::RawInfo = (
3401             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
3402             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
3403             NOTES => 'These tags are found only in ORF images of some models (eg. C8080WZ).',
3404             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3405             0x000 => {
3406             Name => 'RawInfoVersion',
3407             Writable => 'undef',
3408             RawConv => '$val=~s/\0+$//; $val', # (may be null terminated)
3409             Count => 4,
3410             },
3411             0x100 => { Name => 'WB_RBLevelsUsed', Writable => 'int16u', Count => 2 },
3412             0x110 => { Name => 'WB_RBLevelsAuto', Writable => 'int16u', Count => 2 },
3413             0x120 => { Name => 'WB_RBLevelsShade', Writable => 'int16u', Count => 2 },
3414             0x121 => { Name => 'WB_RBLevelsCloudy', Writable => 'int16u', Count => 2 },
3415             0x122 => { Name => 'WB_RBLevelsFineWeather', Writable => 'int16u', Count => 2 },
3416             0x123 => { Name => 'WB_RBLevelsTungsten', Writable => 'int16u', Count => 2 },
3417             0x124 => { Name => 'WB_RBLevelsEveningSunlight',Writable => 'int16u', Count => 2 },
3418             0x130 => { Name => 'WB_RBLevelsDaylightFluor', Writable => 'int16u', Count => 2 },
3419             0x131 => { Name => 'WB_RBLevelsDayWhiteFluor', Writable => 'int16u', Count => 2 },
3420             0x132 => { Name => 'WB_RBLevelsCoolWhiteFluor', Writable => 'int16u', Count => 2 },
3421             0x133 => { Name => 'WB_RBLevelsWhiteFluorescent',Writable => 'int16u', Count => 2 },
3422             0x200 => {
3423             Name => 'ColorMatrix2',
3424             Format => 'int16s',
3425             Writable => 'int16u',
3426             Count => 9,
3427             },
3428             # 0x240 => 'ColorMatrixDefault', ?
3429             # 0x250 => 'ColorMatrixSaturation', ?
3430             # 0x251 => 'ColorMatrixHue', ?
3431             # 0x252 => 'ColorMatrixContrast', ?
3432             # 0x300 => sharpness-related
3433             # 0x301 => list of sharpness-related values
3434             0x310 => { Name => 'CoringFilter', Writable => 'int16u' },
3435             0x311 => { Name => 'CoringValues', Writable => 'int16u', Count => 11 },
3436             0x600 => { Name => 'BlackLevel2', Writable => 'int16u', Count => 4 },
3437             0x601 => {
3438             Name => 'YCbCrCoefficients',
3439             Notes => 'stored as int16u[6], but extracted as rational32u[3]',
3440             Format => 'rational32u',
3441             },
3442             0x611 => { Name => 'ValidPixelDepth', Writable => 'int16u', Count => 2 },
3443             0x612 => { Name => 'CropLeft', Writable => 'int16u' }, #11
3444             0x613 => { Name => 'CropTop', Writable => 'int16u' }, #11
3445             0x614 => { Name => 'CropWidth', Writable => 'int32u' },
3446             0x615 => { Name => 'CropHeight', Writable => 'int32u' },
3447             0x1000 => {
3448             Name => 'LightSource',
3449             Writable => 'int16u',
3450             PrintConv => {
3451             0 => 'Unknown',
3452             16 => 'Shade',
3453             17 => 'Cloudy',
3454             18 => 'Fine Weather',
3455             20 => 'Tungsten (Incandescent)',
3456             22 => 'Evening Sunlight',
3457             33 => 'Daylight Fluorescent',
3458             34 => 'Day White Fluorescent',
3459             35 => 'Cool White Fluorescent',
3460             36 => 'White Fluorescent',
3461             256 => 'One Touch White Balance',
3462             512 => 'Custom 1-4',
3463             },
3464             },
3465             # the following 5 tags all have 3 values: val, min, max
3466             0x1001 => { Name => 'WhiteBalanceComp', Writable => 'int16s', Count => 3 },
3467             0x1010 => { Name => 'SaturationSetting', Writable => 'int16s', Count => 3 },
3468             0x1011 => { Name => 'HueSetting', Writable => 'int16s', Count => 3 },
3469             0x1012 => { Name => 'ContrastSetting', Writable => 'int16s', Count => 3 },
3470             0x1013 => { Name => 'SharpnessSetting', Writable => 'int16s', Count => 3 },
3471             # settings written by Camedia Master 4.x
3472             0x2000 => { Name => 'CMExposureCompensation', Writable => 'rational64s' },
3473             0x2001 => { Name => 'CMWhiteBalance', Writable => 'int16u' },
3474             0x2002 => { Name => 'CMWhiteBalanceComp', Writable => 'int16s' },
3475             0x2010 => { Name => 'CMWhiteBalanceGrayPoint', Writable => 'int16u', Count => 3 },
3476             0x2020 => { Name => 'CMSaturation', Writable => 'int16s', Count => 3 },
3477             0x2021 => { Name => 'CMHue', Writable => 'int16s', Count => 3 },
3478             0x2022 => { Name => 'CMContrast', Writable => 'int16s', Count => 3 },
3479             0x2023 => { Name => 'CMSharpness', Writable => 'int16s', Count => 3 },
3480             );
3481              
3482             # Olympus unknown information tags
3483             %Image::ExifTool::Olympus::UnknownInfo = (
3484             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
3485             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
3486             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3487             );
3488              
3489             # Tags found only in some FE models
3490             %Image::ExifTool::Olympus::FETags = (
3491             WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
3492             CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
3493             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3494             NOTES => q{
3495             Some FE models write a large number of tags here, but most of this
3496             information remains unknown.
3497             },
3498             0x0100 => {
3499             Name => 'BodyFirmwareVersion',
3500             Writable => 'string',
3501             },
3502             );
3503              
3504             # tags in Olympus QuickTime videos (ref PH)
3505             # (similar information in Kodak,Minolta,Nikon,Olympus,Pentax and Sanyo videos)
3506             %Image::ExifTool::Olympus::MOV1 = (
3507             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3508             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3509             FIRST_ENTRY => 0,
3510             NOTES => q{
3511             This information is found in MOV videos from Olympus models such as the
3512             D540Z, D595Z, FE100, FE110, FE115, FE170 and FE200.
3513             },
3514             0x00 => {
3515             Name => 'Make',
3516             Format => 'string[24]',
3517             },
3518             0x18 => {
3519             Name => 'Model',
3520             Description => 'Camera Model Name',
3521             Format => 'string[8]',
3522             SeparateTable => 'CameraType',
3523             PrintConv => \%olympusCameraTypes,
3524             },
3525             # (01 00 at offset 0x20)
3526             0x26 => {
3527             Name => 'ExposureUnknown',
3528             Unknown => 1,
3529             Format => 'int32u',
3530             # this conversion doesn't work for all models (eg. gives "1/100000")
3531             ValueConv => '$val ? 10 / $val : 0',
3532             PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
3533             },
3534             0x2a => {
3535             Name => 'FNumber',
3536             Format => 'rational64u',
3537             PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
3538             },
3539             0x32 => { #(NC)
3540             Name => 'ExposureCompensation',
3541             Format => 'rational64s',
3542             PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
3543             },
3544             # 0x44 => WhiteBalance ?
3545             0x48 => {
3546             Name => 'FocalLength',
3547             Format => 'rational64u',
3548             PrintConv => 'sprintf("%.1f mm",$val)',
3549             },
3550             # 0xb1 => 'ISO', #(I don't think this works - PH)
3551             );
3552              
3553             # tags in Olympus QuickTime videos (ref PH)
3554             # (similar information in Kodak,Minolta,Nikon,Olympus,Pentax and Sanyo videos)
3555             %Image::ExifTool::Olympus::MOV2 = (
3556             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3557             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3558             FIRST_ENTRY => 0,
3559             NOTES => q{
3560             This information is found in MOV videos from Olympus models such as the
3561             FE120, FE140 and FE190.
3562             },
3563             0x00 => {
3564             Name => 'Make',
3565             Format => 'string[24]',
3566             },
3567             0x18 => {
3568             Name => 'Model',
3569             Description => 'Camera Model Name',
3570             Format => 'string[24]',
3571             Notes => 'the actual model name, no decoding necessary',
3572             },
3573             # (01 00 at offset 0x30)
3574             0x36 => {
3575             Name => 'ExposureTime',
3576             Format => 'int32u',
3577             ValueConv => '$val ? 10 / $val : 0',
3578             PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
3579             },
3580             0x3a => {
3581             Name => 'FNumber',
3582             Format => 'rational64u',
3583             PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
3584             },
3585             0x42 => { #(NC)
3586             Name => 'ExposureCompensation',
3587             Format => 'rational64s',
3588             PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
3589             },
3590             0x58 => {
3591             Name => 'FocalLength',
3592             Format => 'rational64u',
3593             PrintConv => 'sprintf("%.1f mm",$val)',
3594             },
3595             0xc1 => {
3596             Name => 'ISO',
3597             Format => 'int16u',
3598             },
3599             );
3600              
3601             # tags in Olympus MP4 videos (ref PH)
3602             %Image::ExifTool::Olympus::MP4 = (
3603             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3604             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3605             FIRST_ENTRY => 0,
3606             NOTES => q{
3607             This information is found in MP4 videos from Olympus models such as the
3608             u7040 and u9010.
3609             },
3610             0x00 => {
3611             Name => 'Make',
3612             Format => 'string[24]',
3613             },
3614             0x18 => {
3615             Name => 'Model',
3616             Description => 'Camera Model Name',
3617             Format => 'string[24]',
3618             Notes => 'oddly different than CameraType values in JPEG images by the same camera',
3619             PrintConv => {
3620             SG472 => 'u7040,S7040',
3621             SG473 => 'u9010,S9010',
3622             SG475 => 'SP800UZ',
3623             SG551 => 'SZ-30MR',
3624             SG553 => 'SP-610UZ',
3625             SG554 => 'SZ-10',
3626             SG555 => 'SZ-20',
3627             SG573 => 'SZ-14',
3628             SG575 => 'SP-620UZ',
3629             },
3630             },
3631             0x28 => {
3632             Name => 'FNumber',
3633             Format => 'rational64u',
3634             PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
3635             },
3636             0x30 => { #(NC)
3637             Name => 'ExposureCompensation',
3638             Format => 'rational64s',
3639             PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
3640             },
3641             # 0x38 - int32u: 3
3642             # 0x3c - int32u: 1
3643             # 0x40 - int16u: 5
3644             # 0x42 - int16u: 0,4,9
3645             # 0x64 - int32u: 0,6000,12000
3646             # 0x48 - int32u: 100 (ISO?)
3647             0x68 => {
3648             Name => 'MovableInfo',
3649             Condition => '$$valPt =~ /^DIGI/',
3650             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::MovableInfo' },
3651             },
3652             0x72 => {
3653             Name => 'MovableInfo',
3654             Condition => '$$valPt =~ /^DIGI/',
3655             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::MovableInfo' },
3656             },
3657             );
3658              
3659             # yet a different QuickTime TAGS format (PH, E-M5)
3660             %Image::ExifTool::Olympus::MOV3 = (
3661             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3662             NOTES => 'QuickTime information found in the TAGS atom of MOV videos from the E-M5.',
3663             OLYM => {
3664             Name => 'OlympusAtom',
3665             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::OLYM2' },
3666             },
3667             );
3668              
3669             # yet a different QuickTime OLYM atom format (PH, E-M5)
3670             %Image::ExifTool::Olympus::OLYM2 = (
3671             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3672             prms => {
3673             Name => 'MakerNotes',
3674             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::prms' },
3675             },
3676             thmb =>{
3677             Name => 'ThumbInfo',
3678             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::thmb2' },
3679             },
3680             scrn =>{
3681             Name => 'PreviewInfo',
3682             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::scrn2' },
3683             },
3684             );
3685              
3686             # the "prms" atom in E-M5 MOV videos (PH, E-M5)
3687             %Image::ExifTool::Olympus::prms = (
3688             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3689             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3690             FIRST_ENTRY => 0,
3691             NOTES => q{
3692             Information extracted from the "prms" atom in MOV videos from Olympus models
3693             such as the OM E-M5.
3694             },
3695             0x12 => {
3696             Name => 'Make',
3697             Format => 'string[24]',
3698             },
3699             0x2c => {
3700             Name => 'Model',
3701             Description => 'Camera Model Name',
3702             Format => 'string[24]',
3703             SeparateTable => 'CameraType',
3704             PrintConv => \%olympusCameraTypes,
3705             },
3706             0x83 => {
3707             Name => 'DateTime1',
3708             Format => 'string[24]',
3709             Groups => { 2 => 'Time' },
3710             },
3711             0x9d => {
3712             Name => 'DateTime2',
3713             Format => 'string[24]',
3714             Groups => { 2 => 'Time' },
3715             },
3716             0x17f => {
3717             Name => 'LensModel',
3718             Format => 'string[32]'
3719             },
3720             );
3721              
3722             # yet a different "thmb" atom format (PH, E-M5)
3723             %Image::ExifTool::Olympus::thmb2 = (
3724             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3725             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3726             0 => {
3727             Name => 'ThumbnailWidth',
3728             Format => 'int16u',
3729             },
3730             2 => {
3731             Name => 'ThumbnailHeight',
3732             Format => 'int16u',
3733             },
3734             4 => {
3735             Name => 'ThumbnailLength',
3736             Format => 'int32u',
3737             },
3738             8 => {
3739             Name => 'ThumbnailImage',
3740             Groups => { 2 => 'Preview' },
3741             Format => 'undef[$val{4}]',
3742             Notes => '160x120 JPEG thumbnail image',
3743             RawConv => '$self->ValidateImage(\$val,$tag)',
3744             },
3745             );
3746              
3747             # yet a different "scrn" atom format (PH, E-M5)
3748             %Image::ExifTool::Olympus::scrn2 = (
3749             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3750             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3751             # 0 => int16u: 1 - number of preview images?
3752             2 => {
3753             Name => 'OlympusPreview',
3754             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::scrn' },
3755             },
3756             );
3757              
3758             # movable information found in MP4 videos
3759             %Image::ExifTool::Olympus::MovableInfo = (
3760             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3761             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3762             FIRST_ENTRY => 0,
3763             0x04 => { #(NC)
3764             Name => 'ISO',
3765             Format => 'int32u',
3766             },
3767             0x2c => {
3768             Name => 'EncoderVersion',
3769             Format => 'string[16]',
3770             },
3771             0x3c => {
3772             Name => 'DecoderVersion',
3773             Format => 'string[16]',
3774             },
3775             0x83 => {
3776             Name => 'Thumbnail',
3777             SubDirectory => {
3778             TagTable => 'Image::ExifTool::Olympus::Thumbnail',
3779             Base => '$start', # (use a separate table because of this)
3780             },
3781             },
3782             );
3783              
3784             # thumbnail image information found in MP4 videos (similar in Olympus,Samsung,Sanyo) (ref PH)
3785             %Image::ExifTool::Olympus::Thumbnail = (
3786             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3787             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3788             FIRST_ENTRY => 0,
3789             FORMAT => 'int32u',
3790             1 => 'ThumbnailWidth',
3791             2 => 'ThumbnailHeight',
3792             3 => 'ThumbnailLength',
3793             4 => { Name => 'ThumbnailOffset', IsOffset => 1 },
3794             );
3795              
3796             # thumbnail information found in 'thmb' atom of MP4 videos from the TG-810 (ref PH)
3797             %Image::ExifTool::Olympus::thmb = (
3798             NOTES => 'Information extracted from the "thmb" atom of Olympus MP4 videos.',
3799             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3800             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3801             0 => {
3802             Name => 'ThumbnailLength',
3803             Format => 'int32u',
3804             },
3805             4 => {
3806             Name => 'ThumbnailImage',
3807             Groups => { 2 => 'Preview' },
3808             Format => 'undef[$val{0}]',
3809             Notes => '160x120 JPEG thumbnail image',
3810             RawConv => '$self->ValidateImage(\$val,$tag)',
3811             },
3812             );
3813              
3814             # thumbnail information found in 'scrn' atom of MP4 videos from the TG-810 (ref PH)
3815             %Image::ExifTool::Olympus::scrn = (
3816             NOTES => 'Information extracted from the "scrn" atom of Olympus MP4 videos.',
3817             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3818             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3819             0 => {
3820             Name => 'PreviewImageLength',
3821             Format => 'int32u',
3822             },
3823             4 => {
3824             Name => 'PreviewImage',
3825             Groups => { 2 => 'Preview' },
3826             Format => 'undef[$val{0}]',
3827             Notes => '640x480 JPEG preview image',
3828             RawConv => '$self->ValidateImage(\$val,$tag)',
3829             },
3830             );
3831              
3832             # information in OLYM atom of MP4 videos from the TG-810 (ref PH)
3833             %Image::ExifTool::Olympus::OLYM = (
3834             NOTES => 'Tags found in the OLYM atom of MP4 videos from the TG-810.',
3835             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3836             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3837             0x0e => {
3838             Name => 'Make',
3839             Format => 'string[26]',
3840             },
3841             0x28 => {
3842             Name => 'Model',
3843             Description => 'Camera Model Name',
3844             Format => 'string[24]',
3845             SeparateTable => 'CameraType',
3846             PrintConv => \%olympusCameraTypes,
3847             },
3848             0x5a => {
3849             Name => 'FNumber',
3850             Format => 'rational64u',
3851             PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
3852             },
3853             0x7f => {
3854             Name => 'DateTimeOriginal', #(NC)
3855             Description => 'Date/Time Original',
3856             Format => 'string[24]',
3857             Groups => { 2 => 'Time' },
3858             PrintConv => '$self->ConvertDateTime($val)',
3859             },
3860             0x99 => {
3861             Name => 'DateTime2',
3862             Format => 'string[24]',
3863             Groups => { 2 => 'Time' },
3864             },
3865             0x109 => {
3866             Name => 'ThumbnailWidth',
3867             Format => 'int16u',
3868             },
3869             0x10b => {
3870             Name => 'ThumbnailHeight',
3871             Format => 'int16u',
3872             },
3873             );
3874              
3875             # tags in Olympus AVI videos (ref PH)
3876             # (very similar to Pentax::Junk2 tags)
3877             %Image::ExifTool::Olympus::AVI = (
3878             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3879             GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
3880             FIRST_ENTRY => 0,
3881             NOTES => 'This information is found in Olympus AVI videos.',
3882             0x12 => {
3883             Name => 'Make',
3884             Format => 'string[24]',
3885             },
3886             0x2c => {
3887             Name => 'Model',
3888             Description => 'Camera Model Name',
3889             Format => 'string[24]',
3890             SeparateTable => 'CameraType',
3891             PrintConv => \%olympusCameraTypes,
3892             },
3893             0x5e => {
3894             Name => 'FNumber',
3895             Format => 'rational64u',
3896             PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
3897             },
3898             0x83 => {
3899             Name => 'DateTime1',
3900             Format => 'string[24]',
3901             Groups => { 2 => 'Time' },
3902             },
3903             0x9d => {
3904             Name => 'DateTime2',
3905             Format => 'string[24]',
3906             Groups => { 2 => 'Time' },
3907             },
3908             0x129 => {
3909             Name => 'ThumbInfo',
3910             SubDirectory => { TagTable => 'Image::ExifTool::Olympus::thmb2' },
3911             },
3912             );
3913              
3914             # tags in WAV files from Olympus PCM linear recorders (ref 18)
3915             %Image::ExifTool::Olympus::WAV = (
3916             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3917             GROUPS => { 0 => 'MakerNotes', 2 => 'Audio' },
3918             FIRST_ENTRY => 0,
3919             NOTES => q{
3920             This information is found in WAV files from Olympus PCM linear recorders
3921             like the LS-5, LS-10, LS-11.
3922             },
3923             0x0c => {
3924             Name => 'Model',
3925             Description => 'Camera Model Name',
3926             Format => 'string[16]',
3927             },
3928             0x1c => {
3929             Name => 'FileNumber',
3930             Format => 'int32u',
3931             PrintConv => 'sprintf("%.4d", $val)',
3932             },
3933             0x26 => {
3934             Name => 'DateTimeOriginal',
3935             Description => 'Date/Time Original',
3936             Groups => { 2 => 'Time' },
3937             Format => 'undef[12]',
3938             Notes => 'time at start of recording',
3939             ValueConv => q{
3940             return undef unless $val =~ /^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/;
3941             my $y = $1 < 70 ? "20$1" : "19$1";
3942             return "$y:$2:$3 $4:$5:$6";
3943             },
3944             PrintConv => '$self->ConvertDateTime($val)',
3945             },
3946             0x32 => {
3947             Name => 'DateTimeEnd',
3948             Groups => { 2 => 'Time' },
3949             Format => 'undef[12]',
3950             Notes => 'time at end of recording',
3951             ValueConv => q{
3952             return undef unless $val =~ /^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/;
3953             my $y = $1 < 70 ? "20$1" : "19$1";
3954             return "$y:$2:$3 $4:$5:$6";
3955             },
3956             PrintConv => '$self->ConvertDateTime($val)',
3957             },
3958             0x3e => {
3959             Name => 'RecordingTime',
3960             Format => 'undef[6]',
3961             ValueConv => '$val =~ s/^(\d{2})(\d{2})/$1:$2:/; $val',
3962             },
3963             0x200 => {
3964             Name => 'Duration',
3965             Format => 'int32u',
3966             ValueConv => '$val / 1000',
3967             PrintConv => 'ConvertDuration($val)',
3968             },
3969             0x20a => { Name => 'Index01', %indexInfo },
3970             0x214 => { Name => 'Index02', %indexInfo },
3971             0x21e => { Name => 'Index03', %indexInfo },
3972             0x228 => { Name => 'Index04', %indexInfo },
3973             0x232 => { Name => 'Index05', %indexInfo },
3974             0x23c => { Name => 'Index06', %indexInfo },
3975             0x246 => { Name => 'Index07', %indexInfo },
3976             0x250 => { Name => 'Index08', %indexInfo },
3977             0x25a => { Name => 'Index09', %indexInfo },
3978             0x264 => { Name => 'Index10', %indexInfo },
3979             0x26e => { Name => 'Index11', %indexInfo },
3980             0x278 => { Name => 'Index12', %indexInfo },
3981             0x282 => { Name => 'Index13', %indexInfo },
3982             0x28c => { Name => 'Index14', %indexInfo },
3983             0x296 => { Name => 'Index15', %indexInfo },
3984             0x2a0 => { Name => 'Index16', %indexInfo },
3985             );
3986              
3987             # DSS information written by Olympus voice recorders (ref PH)
3988             %Image::ExifTool::Olympus::DSS = (
3989             PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
3990             GROUPS => { 0 => 'MakerNotes', 2 => 'Audio' },
3991             FIRST_ENTRY => 0,
3992             NOTES => q{
3993             Information extracted from DSS/DS2 files and the ID3 XOLY frame of MP3 files
3994             written by some Olympus voice recorders.
3995             },
3996             # 0 - file format:
3997             # "\x02dss"(DSS file and XOLY frame in MP3 file)
3998             # "\x03ds2"(DS2 file)
3999             # "\x03mp3"(ID3 XOLY frame in MP3 file)
4000             12 => { Name => 'Model', Format => 'string[16]' }, # (name truncated by some models)
4001             38 => {
4002             Name => 'StartTime',
4003             Format => 'string[12]',
4004             Groups => { 2 => 'Time' },
4005             ValueConv => '$val =~ s/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/20$1:$2:$3 $4:$5:$6/; $val',
4006             PrintConv => '$self->ConvertDateTime($val)',
4007             },
4008             50 => {
4009             Name => 'EndTime',
4010             Format => 'string[12]',
4011             Groups => { 2 => 'Time' },
4012             ValueConv => '$val =~ s/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/20$1:$2:$3 $4:$5:$6/; $val',
4013             PrintConv => '$self->ConvertDateTime($val)',
4014             },
4015             62 => {
4016             Name => 'Duration',
4017             Format => 'string[6]',
4018             ValueConv => '$val =~ /(\d{2})(\d{2})(\d{2})/ ? ($1 * 60 + $2) * 60 + $3 : undef',
4019             PrintConv => 'ConvertDuration($val)',
4020             },
4021             798 => { # (ref http://search.cpan.org/~rgibson/Audio-DSS-0.02/)
4022             Name => 'Comment',
4023             Format => 'string[100]',
4024             },
4025             );
4026              
4027             # Olympus composite tags
4028             %Image::ExifTool::Olympus::Composite = (
4029             GROUPS => { 2 => 'Camera' },
4030             ExtenderStatus => {
4031             Notes => q{
4032             Olympus cameras have the quirk that they may retain the extender settings
4033             after the extender is removed until the camera is powered off. This tag is
4034             an attempt to represent the actual status of the extender.
4035             },
4036             Require => {
4037             0 => 'Olympus:Extender',
4038             1 => 'Olympus:LensType',
4039             2 => 'MaxApertureValue',
4040             },
4041             ValueConv => 'Image::ExifTool::Olympus::ExtenderStatus($val[0],$prt[1],$val[2])',
4042             PrintConv => {
4043             0 => 'Not attached',
4044             1 => 'Attached',
4045             2 => 'Removed',
4046             },
4047             },
4048             ZoomedPreviewImage => {
4049             Groups => { 2 => 'Preview' },
4050             Require => {
4051             0 => 'ZoomedPreviewStart',
4052             1 => 'ZoomedPreviewLength',
4053             },
4054             RawConv => q{
4055             @grps = $self->GetGroup($$val{0}); # set groups from input tag
4056             Image::ExifTool::Exif::ExtractImage($self,$val[0],$val[1],"ZoomedPreviewImage");
4057             },
4058             },
4059             # this is actually for PanasonicRaw tags, but it uses the lens lookup here
4060             LensType => {
4061             Require => {
4062             0 => 'LensTypeMake',
4063             1 => 'LensTypeModel',
4064             },
4065             Notes => 'based on tags found in some Panasonic RW2 images',
4066             SeparateTable => 'Olympus LensType',
4067             ValueConv => '"$val[0] $val[1]"',
4068             PrintConv => \%olympusLensTypes,
4069             },
4070             );
4071              
4072             # add our composite tags
4073             Image::ExifTool::AddCompositeTags('Image::ExifTool::Olympus');
4074              
4075              
4076             #------------------------------------------------------------------------------
4077             # Determine if the extender (EX-25/EC-14) was really attached (ref 9)
4078             # Inputs: 0) Extender, 1) LensType string, 2) MaxApertureAtMaxFocal
4079             # Returns: 0=not attached, 1=attached, 2=could have been removed
4080             # Notes: Olympus has a bug in the in-camera firmware which results in the
4081             # extender information being cached and written into the EXIF data even after
4082             # the extender has been removed. You must power cycle the camera to prevent it
4083             # from writing the cached extender information into the EXIF data.
4084             sub ExtenderStatus($$$)
4085             {
4086 2     2 0 10 my ($extender, $lensType, $maxAperture) = @_;
4087 2         10 my @info = split ' ', $extender;
4088             # validate that extender identifier is reasonable
4089 2 50 33     44 return 0 unless @info >= 2 and hex($info[1]);
4090             # if it's not an EC-14 (id '0 04') then assume it was really attached
4091             # (other extenders don't seem to affect the reported max aperture)
4092 0 0       0 return 1 if "$info[0] $info[1]" ne '0 04';
4093             # get the maximum aperture for this lens (in $1)
4094 0 0       0 $lensType =~ / F(\d+(\.\d+)?)/ or return 1;
4095             # If the maximum aperture at the maximum focal length is greater than the
4096             # known max/max aperture of the lens, then the extender must be attached
4097 0 0       0 return(($maxAperture - $1 > 0.2) ? 1 : 2);
4098             }
4099              
4100             #------------------------------------------------------------------------------
4101             # Print AF points
4102             # Inputs: 0) AF point data (string of integers)
4103             # Notes: I'm just guessing that the 2nd and 4th bytes are the Y coordinates,
4104             # and that more AF points will show up in the future (derived from E-1 images,
4105             # and the E-1 uses just one of 3 possible AF points, all centered in Y) - PH
4106             sub PrintAFAreas($)
4107             {
4108 4     4 0 14 my $val = shift;
4109 4         85 my @points = split ' ', $val;
4110 4         31 my %afPointNames = (
4111             0x36794285 => 'Left',
4112             0x79798585 => 'Center',
4113             0xBD79C985 => 'Right',
4114             );
4115 4         10 $val = '';
4116 4         9 my $pt;
4117 4         15 foreach $pt (@points) {
4118 256 100       421 next unless $pt;
4119 2 50       8 $val and $val .= ', ';
4120 2 50       11 $afPointNames{$pt} and $val .= $afPointNames{$pt} . ' ';
4121 2         16 my @coords = unpack('C4',pack('N',$pt));
4122 2         16 $val .= "($coords[0],$coords[1])-($coords[2],$coords[3])";
4123             }
4124 4 100       23 $val or $val = 'none';
4125 4         50 return $val;
4126             }
4127              
4128             #------------------------------------------------------------------------------
4129             # Extract information from a DSS/DS2 voice recorder audio file or ID3 XOLY frame
4130             # Inputs: 0) ExifTool object reference, 1) dirInfo reference
4131             # Returns: 1 on success
4132             sub ProcessDSS($$;$)
4133             {
4134 1     1 0 4 my ($et, $dirInfo) = @_;
4135              
4136             # allow this to be called with either RAF or DataPt
4137 1         4 my $raf = $$dirInfo{RAF};
4138 1 50       4 if ($raf) {
4139 1         2 my $buff;
4140 1 50       6 $raf->Read($buff, 898) > 68 or return 0;
4141 1 50       9 $buff =~ /^(\x02dss|\x03ds2)/ or return 0;
4142 1         4 $dirInfo = { DataPt => \$buff };
4143 1         10 $et->SetFileType(uc substr $buff, 1, 3);
4144             }
4145 1         7 my $tagTablePtr = GetTagTable('Image::ExifTool::Olympus::DSS');
4146 1         7 return $et->ProcessBinaryData($dirInfo, $tagTablePtr);
4147             }
4148              
4149             #------------------------------------------------------------------------------
4150             # Process ORF file
4151             # Inputs: 0) ExifTool object reference, 1) directory information reference
4152             # Returns: 1 if this looked like a valid ORF file, 0 otherwise
4153             sub ProcessORF($$)
4154             {
4155 0     0 0   my ($et, $dirInfo) = @_;
4156 0           return $et->ProcessTIFF($dirInfo);
4157             }
4158              
4159             1; # end
4160              
4161             __END__