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