source: gsdl/trunk/perllib/cpan/Image/ExifTool/Pentax.pm@ 16842

Last change on this file since 16842 was 16842, checked in by davidb, 16 years ago

ExifTool added to cpan area to support metadata extraction from files such as JPEG. Primarily targetted as Image files (hence the Image folder name decided upon by the ExifTool author) it also can handle video such as flash and audio such as Wav

File size: 58.4 KB
Line 
1#------------------------------------------------------------------------------
2# File: Pentax.pm
3#
4# Description: Pentax/Asahi EXIF maker notes tags
5#
6# Revisions: 11/25/2003 - P. Harvey Created
7# 02/10/2004 - P. Harvey Completely re-done
8# 02/16/2004 - W. Smith Updated (see ref 3)
9# 11/10/2004 - P. Harvey Added support for Asahi cameras
10# 01/10/2005 - P. Harvey Added NikonLens with values from ref 4
11# 03/30/2005 - P. Harvey Added new tags from ref 5
12# 10/04/2005 - P. Harvey Added MOV tags
13#
14# References: 1) Image::MakerNotes::Pentax
15# 2) http://johnst.org/sw/exiftags/ (Asahi cameras)
16# 3) Wayne Smith private communication (Optio 550)
17# 4) http://kobe1995.jp/~kaz/astro/istD.html
18# 5) John Francis (http://www.panix.com/~johnf/raw/index.html) (ist-D/ist-DS)
19# 6) http://www.cybercom.net/~dcoffin/dcraw/
20# 7) Douglas O'Brien private communication (*istD, K10D)
21# 8) Denis Bourez private communication
22# 9) Kazumichi Kawabata private communication
23# 10) David Buret private communication (*istD)
24# 11) http://forums.dpreview.com/forums/read.asp?forum=1036&message=17465929
25# 12) Derby Chang private communication
26# 13) http://homepage3.nifty.com/kamisaka/makernote/makernote_pentax.htm
27# 14) Ger Vermeulen private communication (Optio S6)
28# 15) Barney Garrett private communication (Samsung GX-1S)
29# 16) Axel Kellner private communication (K10D)
30# 17) Cvetan Ivanov private communication (K100D)
31# 18) http://www.gvsoft.homedns.org/exif/makernote-pentax-type3.html
32# 19) Jens Duttke private communication
33#
34# Notes: See POD documentation at the bottom of this file
35#------------------------------------------------------------------------------
36
37package Image::ExifTool::Pentax;
38
39use strict;
40use vars qw($VERSION);
41use Image::ExifTool::Exif;
42use Image::ExifTool::HP;
43
44$VERSION = '1.61';
45
46sub CryptShutterCount($$);
47
48# pentax lens type codes (ref 4)
49my %pentaxLensType = (
50 '0 0' => 'M-42 or No Lens', #17
51 '1 0' => 'K,M Lens',
52 '2 0' => 'A Series Lens', #7 (from smc PENTAX-A 400mm F5.6)
53 '3 0' => 'SIGMA',
54 '3 17' => 'smc PENTAX-FA SOFT 85mm F2.8',
55 '3 18' => 'smc PENTAX-F 1.7X AF ADAPTER',
56 '3 19' => 'smc PENTAX-F 24-50mm F4',
57 '3 20' => 'smc PENTAX-F 35-80mm F4-5.6',
58 '3 21' => 'smc PENTAX-F 80-200mm F4.7-5.6',
59 '3 22' => 'smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5',
60 '3 23' => 'smc PENTAX-F 100-300mm F4.5-5.6',
61 '3 24' => 'smc PENTAX-F 35-135mm F3.5-4.5',
62 '3 25' => 'smc PENTAX-F 35-105mm F4-5.6 or SIGMA or Tokina',
63 # or '3 25' => SIGMA AF 28-300 F3.5-5.6 DL IF', #11
64 # or '3 25' => 'Tokina 80-200mm F2.8 ATX-Pro', #12
65 # or '3 25' => 'SIGMA 55-200mm F4-5.6 DC', #19
66 '3 26' => 'smc PENTAX-F* 250-600mm F5.6 ED[IF]',
67 '3 27' => 'smc PENTAX-F 28-80mm F3.5-4.5',
68 '3 28' => 'smc PENTAX-F 35-70mm F3.5-4.5',
69 # or '3 28' => 'Tokina 19-35mm F3.5-4.5 AF', #12
70 '3 29' => 'PENTAX-F 28-80mm F3.5-4.5 or SIGMA AF 18-125mm F3.5-5.6 DC', #11 (sigma)
71 '3 30' => 'PENTAX-F 70-200mm F4-5.6',
72 '3 31' => 'smc PENTAX-F 70-210mm F4-5.6',
73 # or '3 31' => 'Tokina AF 730 75-300mm F4.5-5.6',
74 '3 32' => 'smc PENTAX-F 50mm F1.4',
75 '3 33' => 'smc PENTAX-F 50mm F1.7',
76 '3 34' => 'smc PENTAX-F 135mm F2.8 [IF]',
77 '3 35' => 'smc PENTAX-F 28mm F2.8',
78 '3 36' => 'SIGMA 20mm F1.8 EX DG ASPHERICAL RF',
79 '3 38' => 'smc PENTAX-F* 300mm F4.5 ED[IF]',
80 '3 39' => 'smc PENTAX-F* 600mm F4 ED[IF]',
81 '3 40' => 'smc PENTAX-F MACRO 100mm F2.8',
82 '3 41' => 'smc PENTAX-F MACRO 50mm F2.8 or Sigma 50mm F2,8 MACRO', #4,16
83 #'3 44' => 'SIGMA 17-70mm F2.8-4.5 DC MACRO', (Bart Hickman)
84 #'3 44' => 'SIGMA 18-50mm F3.5-5.6 DC, 12-24mm F4.5 EX DG or Tamron 35-90mm F4 AF', #4,12,12
85 #'3 44' => 'SIGMA AF 10-20mm F4-5.6 EX DC', #19
86 '3 44' => 'Tamron 35-90mm F4 AF or various SIGMA models', #4,12,Bart,19
87 '3 46' => 'SIGMA APO 70-200mm F2.8 EX',
88 '3 50' => 'smc PENTAX-FA 28-70mm F4 AL',
89 '3 51' => 'SIGMA 28mm F1.8 EX DG ASPHERICAL MACRO',
90 '3 52' => 'smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]',
91 # or '3 52' => 'Tamron AF LD 28-200mm F3.8-5.6 (IF) Aspherical (171D), #19
92 '3 53' => 'smc PENTAX-FA 28-80mm F3.5-5.6 AL',
93 '3 247' => 'smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]',
94 '3 248' => 'smc PENTAX-DA 12-24mm F4 ED AL[IF]',
95 '3 250' => 'smc PENTAX-DA 50-200mm F4-5.6 ED',
96 '3 251' => 'smc PENTAX-DA 40mm F2.8 Limited',
97 '3 252' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL',
98 '3 253' => 'smc PENTAX-DA 14mm F2.8 ED[IF]',
99 '3 254' => 'smc PENTAX-DA 16-45mm F4 ED AL',
100 '3 255' => 'SIGMA',
101 # '3 255' => 'SIGMA 18-200mm F3.5-6.3 DC', #8
102 # '3 255' => 'SIGMA DL-II 35-80mm F4-5.6', #12
103 # '3 255' => 'SIGMA DL Zoom 75-300mm F4-5.6', #12
104 # '3 255' => 'SIGMA DF EX Aspherical 28-70mm F2.8', #12
105 # '3 255' => 'SIGMA AF Tele 400mm F5.6 Multi-coated', #19
106 '4 1' => 'smc PENTAX-FA SOFT 28mm F2.8',
107 '4 2' => 'smc PENTAX-FA 80-320mm F4.5-5.6',
108 '4 3' => 'smc PENTAX-FA 43mm F1.9 Limited',
109 '4 6' => 'smc PENTAX-FA 35-80mm F4-5.6',
110 '4 12' => 'smc PENTAX-FA 50mm F1.4', #17
111 '4 15' => 'smc PENTAX-FA 28-105mm F4-5.6 [IF]',
112 '4 16' => 'TAMRON AF 80-210mm F4-5.6 (178D)', #13
113 '4 19' => 'TAMRON SP AF 90mm F2.8 (172E)',
114 '4 20' => 'smc PENTAX-FA 28-80mm F3.5-5.6',
115 '4 22' => 'TOKINA 28-80mm F3.5-5.6', #13
116 '4 23' => 'smc PENTAX-FA 20-35mm F4 AL',
117 '4 24' => 'smc PENTAX-FA 77mm F1.8 Limited',
118 '4 25' => 'TAMRON SP AF 14mm F2.8', #13
119 '4 26' => 'smc PENTAX-FA MACRO 100mm F3.5',
120 '4 27' => 'TAMRON AF28-300mm F/3.5-6.3 LD Aspherical[IF] MACRO (285D)',
121 '4 28' => 'smc PENTAX-FA 35mm F2 AL',
122 '4 29' => 'TAMRON AF 28-200mm F/3.8-5.6 LD Super II MACRO (371D)', #19
123 '4 34' => 'smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]',
124 '4 35' => 'smc PENTAX-FA 100-300mm F4.7-5.8',
125 '4 36' => 'TAMRON AF70-300mm F/4-5.6 LD MACRO', # both 572D and A17 (Di) - ref 19
126 '4 37' => 'TAMRON SP AF 24-135mm F3.5-5.6 AD AL (190D)', #13
127 '4 38' => 'smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]',
128 '4 39' => 'smc PENTAX-FA 31mm F1.8AL Limited',
129 '4 41' => 'TAMRON AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] MACRO (A03)',
130 '4 43' => 'smc PENTAX-FA 28-90mm F3.5-5.6',
131 '4 44' => 'smc PENTAX-FA J 75-300mm F4.5-5.8 AL',
132 '4 45' => 'TAMRON 28-300mm F3.5-6.3 Ultra zoom XR',
133 '4 46' => 'smc PENTAX-FA J 28-80mm F3.5-5.6 AL',
134 '4 47' => 'smc PENTAX-FA J 18-35mm F4-5.6 AL',
135 '4 49' => 'TAMRON SP AF 28-75mm F2.8 XR Di (A09)',
136 '4 51' => 'smc PENTAX-D FA 50mm F2.8 MACRO',
137 '4 52' => 'smc PENTAX-D FA 100mm F2.8 MACRO',
138 '4 244' => 'smc PENTAX-DA 21mm F3.2 AL Limited', #9
139 '4 245' => 'Schneider D-XENON 50-200mm', #15
140 '4 246' => 'Schneider D-XENON 18-55mm', #15
141 '4 247' => 'smc PENTAX-DA 10-17mm F3.5-4.5 ED [IF] Fisheye zoom', #10
142 '4 248' => 'smc PENTAX-DA 12-24mm F4 ED AL [IF]', #10
143 '4 249' => 'TAMRON XR DiII 18-200mm F3.5-6.3 (A14)',
144 '4 250' => 'smc PENTAX-DA 50-200mm F4-5.6 ED', #8
145 '4 251' => 'smc PENTAX-DA 40mm F2.8 Limited', #9
146 '4 252' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL', #8
147 '4 253' => 'smc PENTAX-DA 14mm F2.8 ED[IF]',
148 '4 254' => 'smc PENTAX-DA 16-45mm F4 ED AL',
149 '5 1' => 'smc PENTAX-FA* 24mm F2 AL[IF]',
150 '5 2' => 'smc PENTAX-FA 28mm F2.8 AL',
151 '5 3' => 'smc PENTAX-FA 50mm F1.7',
152 '5 4' => 'smc PENTAX-FA 50mm F1.4',
153 '5 5' => 'smc PENTAX-FA* 600mm F4 ED[IF]',
154 '5 6' => 'smc PENTAX-FA* 300mm F4.5 ED[IF]',
155 '5 7' => 'smc PENTAX-FA 135mm F2.8 [IF]',
156 '5 8' => 'smc PENTAX-FA MACRO 50mm F2.8',
157 '5 9' => 'smc PENTAX-FA MACRO 100mm F2.8',
158 '5 10' => 'smc PENTAX-FA* 85mm F1.4 [IF]',
159 '5 11' => 'smc PENTAX-FA* 200mm F2.8 ED[IF]',
160 '5 12' => 'smc PENTAX-FA 28-80mm F3.5-4.7',
161 '5 13' => 'smc PENTAX-FA 70-200mm F4-5.6',
162 '5 14' => 'smc PENTAX-FA* 250-600mm F5.6 ED[IF]',
163 '5 15' => 'smc PENTAX-FA 28-105mm F4-5.6',
164 '5 16' => 'smc PENTAX-FA 100-300mm F4.5-5.6',
165 '6 1' => 'smc PENTAX-FA* 85mm F1.4[IF]',
166 '6 2' => 'smc PENTAX-FA* 200mm F2.8 ED[IF]',
167 '6 3' => 'smc PENTAX-FA* 300mm F2.8 ED[IF]',
168 '6 4' => 'smc PENTAX-FA* 28-70mm F2.8 AL',
169 '6 5' => 'smc PENTAX-FA* 80-200mm F2.8 ED[IF]',
170 '6 6' => 'smc PENTAX-FA* 28-70mm F2.8 AL',
171 '6 7' => 'smc PENTAX-FA* 80-200mm F2.8 ED[IF]',
172 '6 8' => 'smc PENTAX-FA 28-70mm F4AL',
173 '6 9' => 'smc PENTAX-FA 20mm F2.8',
174 '6 10' => 'smc PENTAX-FA* 400mm F5.6 ED[IF]',
175 '6 13' => 'smc PENTAX-FA* 400mm F5.6 ED[IF]',
176 '6 14' => 'smc PENTAX-FA* MACRO 200mm F4 ED[IF]',
177 '7 0' => 'smc PENTAX-DA 21mm F3.2 AL Limited', #13
178 '7 238' => 'TAMRON AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] MACRO', #19
179 '7 243' => 'smc PENTAX-DA 70mm F2.4 Limited', #PH (K10D)
180 '7 244' => 'smc PENTAX-DA 21mm F3.2 AL Limited', #16
181 '8 241' => 'smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM', #19
182 '8 242' => 'smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM', #19
183);
184
185# Pentax model ID codes (PH)
186my %pentaxModelID = (
187 0x0000d => 'Optio 330/430',
188 0x12926 => 'Optio 230',
189 0x12958 => 'Optio 330GS',
190 0x12962 => 'Optio 450/550',
191 0x1296c => 'Optio S',
192 0x12994 => '*ist D',
193 0x129b2 => 'Optio 33L',
194 0x129bc => 'Optio 33LF',
195 0x129c6 => 'Optio 33WR/43WR/555',
196 0x129d5 => 'Optio S4',
197 0x12a02 => 'Optio MX',
198 0x12a0c => 'Optio S40',
199 0x12a16 => 'Optio S4i',
200 0x12a34 => 'Optio 30',
201 0x12a52 => 'Optio S30',
202 0x12a66 => 'Optio 750Z',
203 0x12a70 => 'Optio SV',
204 0x12a75 => 'Optio SVi',
205 0x12a7a => 'Optio X',
206 0x12a8e => 'Optio S5i',
207 0x12a98 => 'Optio S50',
208 0x12aa2 => '*ist DS',
209 0x12ab6 => 'Optio MX4',
210 0x12ac0 => 'Optio S5n',
211 0x12aca => 'Optio WP',
212 0x12afc => 'Optio S55',
213 0x12b10 => 'Optio S5z',
214 0x12b1a => '*ist DL',
215 0x12b24 => 'Optio S60',
216 0x12b2e => 'Optio S45',
217 0x12b38 => 'Optio S6',
218 0x12b4c => 'Optio WPi', #13
219 0x12b56 => 'BenQ DC X600',
220 0x12b60 => '*ist DS2',
221 0x12b62 => 'Samsung GX-1S',
222 0x12b6a => 'Optio A10',
223 0x12b7e => '*ist DL2',
224 0x12b80 => 'Samsung GX-1L',
225 0x12b9c => 'K100D',
226 0x12b9d => 'K110D',
227 0x12ba2 => 'K100D Super', #19
228 0x12bb0 => 'Optio T10/T20',
229 0x12be2 => 'Optio W10',
230 0x12bf6 => 'Optio M10',
231 0x12c1e => 'K10D',
232 0x12c20 => 'Samsung GX10',
233 0x12c28 => 'Optio S7',
234 0x12c2d => 'Optio L20',
235 0x12c32 => 'Optio M20',
236 0x12c3c => 'Optio W20',
237 0x12c46 => 'Optio A20',
238 0x12c8c => 'Optio M30',
239 0x12c78 => 'Optio E30',
240 0x12c82 => 'Optio T30',
241 0x12c96 => 'Optio W30',
242 0x12ca0 => 'Optio A30',
243 0x12cb4 => 'Optio E40',
244 0x12cbe => 'Optio M40',
245 0x12cc8 => 'Optio Z10',
246 0x12cdc => 'Optio S10',
247 0x12ce6 => 'Optio A40',
248 0x12cf0 => 'Optio V10',
249);
250
251# Pentax city codes - (PH, Optio WP)
252my %pentaxCities = (
253 0 => 'Pago Pago',
254 1 => 'Honolulu',
255 2 => 'Anchorage',
256 3 => 'Vancouver',
257 4 => 'San Fransisco',
258 5 => 'Los Angeles',
259 6 => 'Calgary',
260 7 => 'Denver',
261 8 => 'Mexico City',
262 9 => 'Chicago',
263 10 => 'Miami',
264 11 => 'Toronto',
265 12 => 'New York',
266 13 => 'Santiago',
267 14 => 'Caracus',
268 15 => 'Halifax',
269 16 => 'Buenos Aires',
270 17 => 'Sao Paulo',
271 18 => 'Rio de Janeiro',
272 19 => 'Madrid',
273 20 => 'London',
274 21 => 'Paris',
275 22 => 'Milan',
276 23 => 'Rome',
277 24 => 'Berlin',
278 25 => 'Johannesburg',
279 26 => 'Istanbul',
280 27 => 'Cairo',
281 28 => 'Jerusalem',
282 29 => 'Moscow',
283 30 => 'Jeddah',
284 31 => 'Tehran',
285 32 => 'Dubai',
286 33 => 'Karachi',
287 34 => 'Kabul',
288 35 => 'Male',
289 36 => 'Delhi',
290 37 => 'Colombo',
291 38 => 'Kathmandu',
292 39 => 'Dacca',
293 40 => 'Yangon',
294 41 => 'Bangkok',
295 42 => 'Kuala Lumpur',
296 43 => 'Vientiane',
297 44 => 'Singapore',
298 45 => 'Phnom Penh',
299 46 => 'Ho Chi Minh',
300 47 => 'Jakarta',
301 48 => 'Hong Kong',
302 49 => 'Perth',
303 50 => 'Beijing',
304 51 => 'Shanghai',
305 52 => 'Manila',
306 53 => 'Taipei',
307 54 => 'Seoul',
308 55 => 'Adelaide',
309 56 => 'Tokyo',
310 57 => 'Guam',
311 58 => 'Sydney',
312 59 => 'Noumea',
313 60 => 'Wellington',
314 61 => 'Auckland',
315 62 => 'Lima',
316 63 => 'Dakar',
317 64 => 'Algiers',
318 65 => 'Helsinki',
319 66 => 'Athens',
320 67 => 'Nairobi',
321 68 => 'Amsterdam',
322 69 => 'Stockholm',
323 70 => 'Lisbon', #14
324);
325
326%Image::ExifTool::Pentax::Main = (
327 WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
328 CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
329 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
330 WRITABLE => 1,
331 0x0000 => { #5
332 Name => 'PentaxVersion',
333 Writable => 'int8u',
334 Count => 4,
335 PrintConv => '$val=~tr/ /./; $val',
336 PrintConvInv => '$val=~tr/./ /; $val',
337 },
338 0x0001 => { #PH
339 Name => 'PentaxModelType',
340 Writable => 'int16u',
341 # (values of 0-5 seem to group models into 6 categories, ref 13)
342 },
343 0x0002 => { #PH
344 Name => 'PreviewImageSize',
345 Groups => { 2 => 'Image' },
346 Writable => 'int16u',
347 Count => 2,
348 PrintConv => '$val =~ tr/ /x/; $val',
349 },
350 0x0003 => { #PH
351 Name => 'PreviewImageLength',
352 OffsetPair => 0x0004, # point to associated offset
353 DataTag => 'PreviewImage',
354 Groups => { 2 => 'Image' },
355 Writable => 'int32u',
356 Protected => 2,
357 },
358 0x0004 => { #PH
359 Name => 'PreviewImageStart',
360 IsOffset => 2, # code to use original base
361 Protected => 2,
362 OffsetPair => 0x0003, # point to associated byte count
363 DataTag => 'PreviewImage',
364 Groups => { 2 => 'Image' },
365 Writable => 'int32u',
366 },
367 0x0005 => { #13
368 Name => 'PentaxModelID',
369 Writable => 'int32u',
370 PrintHex => 1,
371 SeparateTable => 1,
372 PrintConv => \%pentaxModelID,
373 },
374 0x0006 => { #5
375 # Note: Year is int16u in MM byte ordering regardless of EXIF byte order
376 Name => 'Date',
377 Groups => { 2 => 'Time' },
378 Writable => 'undef',
379 Count => 4,
380 Shift => 'Time',
381 DataMember => 'PentaxDate',
382 RawConv => '$$self{PentaxDate} = $val', # save to decrypt ShutterCount
383 ValueConv => 'length($val)==4 ? sprintf("%.4d:%.2d:%.2d",unpack("nC2",$val)) : "Unknown ($val)"',
384 ValueConvInv => 'my @v=split /:/, $val;pack("nC2",$v[0],$v[1],$v[2])',
385 },
386 0x0007 => { #5
387 Name => 'Time',
388 Groups => { 2 => 'Time' },
389 Writable => 'undef',
390 Count => 3,
391 Shift => 'Time',
392 DataMember => 'PentaxTime',
393 RawConv => '$$self{PentaxTime} = $val', # save to decrypt ShutterCount
394 ValueConv => 'length($val)>=3 ? sprintf("%.2d:%.2d:%.2d",unpack("C3",$val)) : "Unknown ($val)"',
395 ValueConvInv => 'pack("C3",split(/:/,$val))',
396 },
397 0x0008 => { #2
398 Name => 'Quality',
399 Writable => 'int16u',
400 PrintConv => {
401 0 => 'Good',
402 1 => 'Better',
403 2 => 'Best',
404 3 => 'TIFF', #5
405 4 => 'RAW', #5
406 },
407 },
408 0x0009 => { #3
409 Name => 'PentaxImageSize',
410 Groups => { 2 => 'Image' },
411 Writable => 'int16u',
412 PrintConv => {
413 0 => '640x480',
414 1 => 'Full', #PH - this can mean 2048x1536 or 2240x1680 or ... ?
415 2 => '1024x768',
416 3 => '1280x960', #PH (Optio WP)
417 4 => '1600x1200',
418 5 => '2048x1536',
419 8 => '2560x1920 or 2304x1728', #PH (Optio WP) or #14
420 9 => '3072x2304', #PH (Optio M30)
421 10 => '3264x2448', #13
422 19 => '320x240', #PH (Optio WP)
423 20 => '2288x1712', #13
424 21 => '2592x1944',
425 22 => '2304x1728 or 2592x1944', #2 or #14
426 23 => '3056x2296', #13
427 25 => '2816x2212 or 2816x2112', #13 or #14
428 27 => '3648x2736', #PH (Optio A20)
429 '0 0' => '2304x1728', #13
430 '4 0' => '1600x1200', #PH (Optio MX4)
431 '5 0' => '2048x1536', #13
432 '8 0' => '2560x1920', #13
433 '32 2' => '960x640', #7
434 '33 2' => '1152x768', #7
435 '34 2' => '1536x1024', #7
436 '35 1' => '2400x1600', #7
437 '36 0' => '3008x2008 or 3040x2024', #PH
438 '37 0' => '3008x2000', #13
439 },
440 },
441 # 0x000a - (See note below)
442 0x000b => { #3
443 Name => 'PictureMode',
444 Writable => 'int16u',
445 PrintConv => {
446 0 => 'Program', #PH
447 2 => 'Program AE', #13
448 3 => 'Manual', #13
449 5 => 'Portrait',
450 6 => 'Landscape',
451 8 => 'Sport', #PH
452 9 => 'Night Scene',
453 11 => 'Soft', #PH
454 12 => 'Surf & Snow',
455 13 => 'Sunset or Candlelight', #14 (Candlelight)
456 14 => 'Autumn',
457 15 => 'Macro',
458 17 => 'Fireworks',
459 18 => 'Text',
460 19 => 'Panorama', #PH
461 30 => 'Self Portrait', #PH
462 31 => 'Illustrations', #13
463 33 => 'Digital Filter', #13
464 37 => 'Museum', #PH
465 38 => 'Food', #PH
466 40 => 'Green Mode', #PH
467 49 => 'Light Pet', #PH
468 50 => 'Dark Pet', #PH
469 51 => 'Medium Pet', #PH
470 53 => 'Underwater', #PH
471 54 => 'Candlelight', #PH
472 55 => 'Natural Skin Tone', #PH
473 56 => 'Synchro Sound Record', #PH
474 58 => 'Frame Composite', #14
475 '0 0' => 'Auto', #13
476 '0 2' => 'Program AE', #13
477 '5 2' => 'Portrait', #13
478 '6 2' => 'Landscape', #13
479 '9 1' => 'Night Scene', #13
480 '13 1' => 'Candlelight', #13
481 '15 1' => 'Macro', #13
482 '255 0' => 'Digital Filter?', #13
483 },
484 },
485 0x000c => { #PH
486 Name => 'FlashMode',
487 Writable => 'int16u',
488 PrintHex => 1,
489 ValueConv => '$val=~s/ .*//; $val', # ignore 2nd value
490 PrintConv => {
491 0x000 => 'Auto, Did not fire',
492 0x001 => 'Off',
493 0x003 => 'Auto, Did not fire, Red-eye reduction',
494 0x100 => 'Auto, Fired',
495 0x102 => 'On',
496 0x103 => 'Auto, Fired, Red-eye reduction',
497 0x104 => 'On, Red-eye reduction',
498 0x105 => 'On, Wireless',
499 0x108 => 'On, Soft',
500 0x109 => 'On, Slow-sync',
501 0x10a => 'On, Slow-sync, Red-eye reduction',
502 0x10b => 'On, Trailing-curtain Sync',
503 },
504 },
505 0x000d => [ #2
506 {
507 Condition => '$self->{CameraMake} =~ /^PENTAX/',
508 Name => 'FocusMode',
509 Notes => 'Pentax models',
510 Writable => 'int16u',
511 PrintConv => { #PH
512 0 => 'Normal',
513 1 => 'Macro',
514 2 => 'Infinity',
515 3 => 'Manual',
516 5 => 'Pan Focus',
517 16 => 'AF-S', #17
518 17 => 'AF-C', #17
519 },
520 },
521 {
522 Name => 'FocusMode',
523 Writable => 'int16u',
524 Notes => 'Asahi models',
525 PrintConv => { #2
526 0 => 'Normal',
527 1 => 'Macro (1)',
528 2 => 'Macro (2)',
529 3 => 'Infinity',
530 },
531 },
532 ],
533 0x000e => { #7
534 Name => 'AFPointSelected',
535 Writable => 'int16u',
536 PrintConv => {
537 0xffff => 'Auto',
538 0xfffe => 'Fixed Center',
539 1 => 'Upper-left',
540 2 => 'Top',
541 3 => 'Upper-right',
542 4 => 'Left',
543 5 => 'Mid-left',
544 6 => 'Center',
545 7 => 'Mid-right',
546 8 => 'Right',
547 9 => 'Lower-left',
548 10 => 'Bottom',
549 11 => 'Lower-right',
550 },
551 },
552 0x000f => { #PH
553 Name => 'AFPointsInFocus',
554 Writable => 'int16u',
555 PrintHex => 1,
556 PrintConv => {
557 0xffff => 'None',
558 0 => 'Fixed Center or Multiple', #PH/14
559 1 => 'Top-left',
560 2 => 'Top-center',
561 3 => 'Top-right',
562 4 => 'Left',
563 5 => 'Center',
564 6 => 'Right',
565 7 => 'Bottom-left',
566 8 => 'Bottom-center',
567 9 => 'Bottom-right',
568 },
569 },
570 0x0010 => { #PH
571 Name => 'FocusPosition',
572 Writable => 'int16u',
573 Notes => 'related to focus distance but affected by focal length',
574 },
575 0x0012 => { #PH
576 Name => 'ExposureTime',
577 Writable => 'int32u',
578 Priority => 0,
579 ValueConv => '$val * 1e-5',
580 ValueConvInv => '$val * 1e5',
581 # value may be 0xffffffff in Bulb mode (ref 19)
582 PrintConv => '$val > 42949 ? "Unknown (Bulb)" : Image::ExifTool::Exif::PrintExposureTime($val)',
583 PrintConvInv => '$val=~/(unknown|bulb)/i ? $val : eval $val',
584 },
585 0x0013 => { #PH
586 Name => 'FNumber',
587 Writable => 'int16u',
588 Priority => 0,
589 ValueConv => '$val / 10',
590 ValueConvInv => '$val * 10',
591 PrintConv => 'sprintf("%.1f",$val)',
592 PrintConvInv => '$val',
593 },
594 # ISO Tag - Entries confirmed by W. Smith 12 FEB 04
595 0x0014 => {
596 Name => 'ISO',
597 Writable => 'int16u',
598 Priority => 0,
599 PrintConv => {
600 3 => 50, #(NC=Not Confirmed)
601 4 => 64,
602 5 => 80, #(NC)
603 6 => 100,
604 7 => 125, #PH
605 8 => 160, #PH
606 9 => 200,
607 10 => 250, #(NC)
608 11 => 320, #PH
609 12 => 400,
610 13 => 500, #(NC)
611 14 => 640, #(NC)
612 15 => 800,
613 16 => 1000, #(NC)
614 17 => 1250, #(NC)
615 18 => 1600, #PH
616 21 => 3200, #(NC)
617 50 => 50, #PH
618 100 => 100, #PH
619 200 => 200, #PH
620 400 => 400, #PH
621 800 => 800, #PH
622 1600 => 1600, #PH
623 3200 => 3200, #PH
624 # have seen 268 for ISO 1600 on K10D - PH
625 },
626 },
627 # 0x0015 - Related to measured EV? ranges from -2 to 6 if interpreted as signed int (PH)
628 0x0016 => { #PH
629 Name => 'ExposureCompensation',
630 Writable => 'int16u',
631 ValueConv => '($val - 50) / 10',
632 ValueConvInv => 'int($val * 10 + 50.5)',
633 PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
634 PrintConvInv => 'eval $val',
635 },
636 0x0017 => { #3
637 Name => 'MeteringMode',
638 Writable => 'int16u',
639 PrintConv => {
640 0 => 'Multi Segment',
641 1 => 'Center Weighted',
642 2 => 'Spot',
643 },
644 },
645 0x0018 => { #PH
646 Name => 'AutoBracketing',
647 Writable => 'int16u',
648 Count => -1,
649 Notes => q{
650 one or two numbers: exposure bracket step in EV, then extended bracket if
651 available. Extended bracket values are printed as 'WB-BA', 'WB-GM',
652 'Saturation', 'Sharpness' or 'Contrast' followed by '+1', '+2' or '+3' for
653 step size
654 },
655 ValueConv => sub {
656 my @v = split(' ', shift);
657 if ($v[0] < 10) {
658 $v[0] /= 3; # 1=.3ev, 2=.7, 3=1...
659 } else {
660 $v[0] -= 9.5; # 10=.5ev, 11=1.5...
661 }
662 return "@v";
663 },
664 ValueConvInv => sub {
665 my @v = split(' ', shift);
666 if (abs($v[0]-int($v[0])-.5) > 0.05) {
667 $v[0] = int($v[0] * 3 + 0.5);
668 } else {
669 $v[0] = int($v[0] + 10);
670 }
671 return "@v";
672 },
673 PrintConv => sub {
674 my @v = split(' ', shift);
675 $v[0] = sprintf('%.1f', $v[0]) if $v[0];
676 if ($v[1]) {
677 my %s = (1=>'WB-BA',2=>'WB-GM',3=>'Saturation',4=>'Sharpness',5=>'Contrast');
678 my $t = $v[1] >> 8;
679 $v[1] = sprintf('%s+%d', $s{$t} || "Unknown($t)", $v[1] & 0xff);
680 } elsif (defined $v[1]) {
681 $v[1] = 'No Extended Bracket',
682 }
683 return join(' EV, ', @v);
684 },
685 PrintConvInv => sub {
686 my @v = split(/, ?/, shift);
687 $v[0] =~ s/ ?EV//i;
688 if ($v[1]) {
689 my %s = ('WB-BA'=>1,'WB-GM'=>2,Saturation=>3,Sharpness=>4,Contrast=>5);
690 if ($v[1] =~ /^No\b/i) {
691 $v[1] = 0;
692 } elsif ($v[1] =~ /Unknown\((\d+)\)\+(\d+)/i) {
693 $v[1] = ($1 << 8) + $2;
694 } elsif ($v[1] =~ /([\w-]+)\+(\d+)/ and $s{$1}) {
695 $v[1] = ($s{$1} << 8) + $2;
696 } else {
697 warn "Bad extended bracket\n";
698 }
699 }
700 return "@v";
701 },
702 },
703 0x0019 => { #3
704 Name => 'WhiteBalance',
705 Writable => 'int16u',
706 PrintConv => {
707 0 => 'Auto',
708 1 => 'Daylight',
709 2 => 'Shade',
710 3 => 'Fluorescent', #2
711 4 => 'Tungsten',
712 5 => 'Manual',
713 6 => 'DaylightFluorescent', #13
714 7 => 'DaywhiteFluorescent', #13
715 8 => 'WhiteFluorescent', #13
716 9 => 'Flash', #13
717 10 => 'Cloudy', #13
718 65534 => 'Unknown', #13
719 65535 => 'User Selected', #13
720 },
721 },
722 0x001a => { #5
723 Name => 'WhiteBalanceMode',
724 Writable => 'int16u',
725 PrintConv => {
726 1 => 'Auto (Daylight)',
727 2 => 'Auto (Shade)',
728 3 => 'Auto (Flash)',
729 4 => 'Auto (Tungsten)',
730 7 => 'Auto (DaywhiteFluorescent)', #17 (K100D guess)
731 8 => 'Auto (WhiteFluorescent)', #17 (K100D guess)
732 10 => 'Auto (Cloudy)', #17 (K100D guess)
733 0xffff => 'User-Selected',
734 0xfffe => 'Preset (Fireworks?)', #PH
735 # 0xfffd observed in K100D (ref 17)
736 },
737 },
738 0x001b => { #6
739 Name => 'BlueBalance',
740 Writable => 'int16u',
741 ValueConv => '$val / 256',
742 ValueConvInv => 'int($val * 256 + 0.5)',
743 },
744 0x001c => { #6
745 Name => 'RedBalance',
746 Writable => 'int16u',
747 ValueConv => '$val / 256',
748 ValueConvInv => 'int($val * 256 + 0.5)',
749 },
750 0x001d => [
751 # Would be nice if there was a general way to determine units for FocalLength...
752 {
753 # Optio 30, 33WR, 43WR, 450, 550, 555, 750Z, X
754 Name => 'FocalLength',
755 Condition => '$self->{CameraModel} =~ /^PENTAX Optio (30|33WR|43WR|450|550|555|750Z|X)\b/',
756 Writable => 'int32u',
757 Priority => 0,
758 ValueConv => '$val / 10',
759 ValueConvInv => '$val * 10',
760 PrintConv => 'sprintf("%.1fmm",$val)',
761 PrintConvInv => '$val=~s/mm//;$val',
762 },
763 {
764 # K100D, Optio 230, 330GS, 33L, 33LF, A10, M10, MX, MX4, S, S30,
765 # S4, S4i, S5i, S5n, S5z, S6, S45, S50, S55, S60, SV, Svi, W10, WP,
766 # *ist D, DL, DL2, DS, DS2
767 # (Note: the Optio S6 seems to report the minimum focal length - PH)
768 Name => 'FocalLength',
769 Writable => 'int32u',
770 Priority => 0,
771 ValueConv => '$val / 100',
772 ValueConvInv => '$val * 100',
773 PrintConv => 'sprintf("%.1fmm",$val)',
774 PrintConvInv => '$val=~s/mm//;$val',
775 },
776 ],
777 0x001e => { #3
778 Name => 'DigitalZoom',
779 Writable => 'int16u',
780 ValueConv => '$val / 100', #14
781 ValueConvInv => '$val * 100', #14
782 },
783 0x001f => {
784 Name => 'Saturation',
785 Writable => 'int16u',
786 PrintConv => {
787 0 => 'Low', #PH
788 1 => 'Normal', #PH
789 2 => 'High', #PH
790 3 => 'Med Low', #2
791 4 => 'Med High', #2
792 5 => 'Very Low', #(NC)
793 6 => 'Very High', #(NC)
794 # the *istD has pairs of values - PH
795 '0 0' => 'Low',
796 '1 0' => 'Normal',
797 '2 0' => 'High',
798 },
799 },
800 0x0020 => {
801 Name => 'Contrast',
802 Writable => 'int16u',
803 PrintConv => {
804 0 => 'Low', #PH
805 1 => 'Normal', #PH
806 2 => 'High', #PH
807 3 => 'Med Low', #2
808 4 => 'Med High', #2
809 5 => 'Very Low', #PH
810 6 => 'Very High', #(NC)
811 # the *istD has pairs of values - PH
812 '0 0' => 'Low',
813 '1 0' => 'Normal',
814 '2 0' => 'High',
815 },
816 },
817 0x0021 => {
818 Name => 'Sharpness',
819 Writable => 'int16u',
820 PrintConv => {
821 0 => 'Soft', #PH
822 1 => 'Normal', #PH
823 2 => 'Hard', #PH
824 3 => 'Med Soft', #2
825 4 => 'Med Hard', #2
826 5 => 'Very Soft', #(NC)
827 6 => 'Very Hard', #(NC)
828 # the *istD has pairs of values - PH
829 '0 0' => 'Soft',
830 '1 0' => 'Normal',
831 '2 0' => 'Hard',
832 },
833 },
834 0x0022 => { #PH
835 Name => 'WorldTimeLocation',
836 Groups => { 2 => 'Time' },
837 Writable => 'int16u',
838 PrintConv => {
839 0 => 'Hometown',
840 1 => 'Destination',
841 },
842 },
843 0x0023 => { #PH
844 Name => 'HometownCity',
845 Groups => { 2 => 'Time' },
846 Writable => 'int16u',
847 SeparateTable => 'City',
848 PrintConv => \%pentaxCities,
849 },
850 0x0024 => { #PH
851 Name => 'DestinationCity',
852 Groups => { 2 => 'Time' },
853 Writable => 'int16u',
854 SeparateTable => 'City',
855 PrintConv => \%pentaxCities,
856 },
857 0x0025 => { #PH
858 Name => 'HometownDST',
859 Groups => { 2 => 'Time' },
860 Writable => 'int16u',
861 PrintConv => { 0 => 'No', 1 => 'Yes' },
862 },
863 0x0026 => { #PH
864 Name => 'DestinationDST',
865 Groups => { 2 => 'Time' },
866 Writable => 'int16u',
867 PrintConv => { 0 => 'No', 1 => 'Yes' },
868 },
869 # 0x0027 - could be a 5-byte string software version number for the Optio 550,
870 # but the offsets are wacky so it is hard to tell (PH)
871 0x0029 => { #5
872 Name => 'FrameNumber',
873 Writable => 'int32u',
874 },
875 # 0x002b - definitely exposure related somehow (PH)
876 0x0032 => { #13
877 Name => 'ImageProcessing',
878 Writable => 'undef',
879 Format => 'int8u',
880 Count => 4,
881 PrintConv => {
882 '0 0' => 'Unprocessed', #PH
883 '0 0 0 0' => 'Unprocessed',
884 '0 0 0 4' => 'Digital Filter',
885 '2 0 0 0' => 'Cropped', #PH
886 '4 0 0 0' => 'Color Filter',
887 '16 0 0 0' => 'Frame Synthesis?',
888 },
889 },
890 # and "\0\0\0\x04" for Digital filter (ref 13)
891 # and "\x04\0\0\0" for Color filter (ref 13) (PH - digital or color filter, K10D)
892 0x0033 => { #PH (K110D/K100D)
893 Name => 'PictureMode',
894 Writable => 'int8u',
895 Count => 3,
896 PrintConv => {
897 # Program dial modes
898 '0 0 0' => 'Program', # K110D
899 '0 4 0' => 'Standard', #13
900 '0 5 0' => 'Portrait', # K110D
901 '0 6 0' => 'Landscape', # K110D
902 '0 7 0' => 'Macro', # K110D
903 '0 8 0' => 'Sport', # K110D
904 '0 9 0' => 'Night Scene Portrait', # K110D
905 '0 10 0' => 'No Flash', # K110D
906 # SCN modes (menu-selected)
907 '0 11 0' => 'Night Scene', # K100D
908 '0 12 0' => 'Surf & Snow', # K100D
909 '0 13 0' => 'Text', # K100D
910 '0 14 0' => 'Sunset', # K100D
911 '0 15 0' => 'Kids', # K100D
912 '0 16 0' => 'Pet', # K100D
913 '0 17 0' => 'Candlelight', # K100D
914 '0 18 0' => 'Museum', # K100D
915 # AUTO PICT modes (auto-selected)
916 '1 4 0' => 'Auto PICT (Standard)', #13
917 '1 5 0' => 'Auto PICT (Portrait)', #7 (K100D)
918 '1 6 0' => 'Auto PICT (Landscape)', # K110D
919 '1 7 0' => 'Auto PICT (Macro)', #13
920 '1 8 0' => 'Auto PICT (Sport)', #13
921 # Manual dial modes
922 '2 0 0' => 'Program AE', #13
923 '3 0 0' => 'Green Mode', #16
924 '4 0 0' => 'Shutter Speed Priority', # K110D
925 '5 0 0' => 'Aperture Priority', # K110D
926 '8 0 0' => 'Manual', # K110D
927 '9 0 0' => 'Bulb', # K110D
928 # *istD modes (ref 7)
929 '2 0 1' => 'Program AE', # 'User Program AE' according to ref 16
930 '2 1 1' => 'Hi-speed Program',
931 '2 2 1' => 'DOF Program',
932 '2 3 1' => 'MTF Program',
933 '3 0 1' => 'Green Mode',
934 '4 0 1' => 'Shutter Speed Priority',
935 '5 0 1' => 'Aperture Priority',
936 '6 0 1' => 'Program Tv Shift',
937 '7 0 1' => 'Program Av Shift',
938 '8 0 1' => 'Manual',
939 '9 0 1' => 'Bulb',
940 '10 0 1' => 'Aperture Priority (Off-Auto-Aperture)',
941 '11 0 1' => 'Manual (Off-Auto-Aperture)',
942 '12 0 1' => 'Bulb (Off-Auto-Aperture)',
943 # K10D modes (ref 16)
944 '13 0 0' => 'Shutter & Aperture Priority AE',
945 '13 0 1' => 'Shutter & Aperture Priority AE (1)', #PH guess
946 '15 0 0' => 'Sensitivity Priority AE',
947 '15 0 1' => 'Sensitivity Priority AE (1)',
948 '16 0 0' => 'Flash X-Sync Speed AE',
949 '16 0 1' => 'Flash X-Sync Speed AE (1)', #PH guess
950 # other modes
951 '0 0 1' => 'Program', #17 (K100D)
952 },
953 },
954 0x0034 => { #7/PH
955 Name => 'DriveMode',
956 Writable => 'int8u',
957 Count => 4,
958 PrintConv => {
959 '0 0 0 0' => 'Single-frame',
960 '1 0 0 0' => 'Continuous',
961 '0 1 0 0' => 'Self-timer (12 sec)',
962 '0 2 0 0' => 'Self-timer (2 sec)',
963 '0 0 1 0' => 'Remote Control?', # needs validation
964 '0 0 0 1' => 'Multiple Exposure',
965 },
966 },
967 0x0037 => { #13
968 Name => 'ColorSpace',
969 Writable => 'int16u',
970 PrintConv => {
971 0 => 'sRGB',
972 1 => 'Adobe RGB',
973 },
974 },
975 0x0038 => { #5 (PEF only)
976 Name => 'ImageAreaOffset',
977 Writable => 'int16u',
978 Count => 2,
979 },
980 0x0039 => { #PH
981 Name => 'RawImageSize',
982 Writable => 'int16u',
983 Count => 2,
984 PrintConv => '$_=$val;s/ /x/;$_',
985 },
986 0x003c => { #7/PH
987 Name => 'AFPointsInFocus',
988 # not writable because I'm not decoding these 4 bytes fully:
989 # Nibble pattern: XSSSYUUU
990 # X = unknown (AF focused flag?, 0 or 1)
991 # SSS = selected AF point bitmask (0x000 or 0x7ff if unused)
992 # Y = unknown (observed 0,6,7,b,e, always 0 if SSS is 0x000 or 0x7ff)
993 # UUU = af points used
994 Format => 'int32u',
995 Notes => '*istD only',
996 ValueConv => '$val & 0x7ff', # ignore other bits for now
997 PrintConv => { BITMASK => {
998 0 => 'Upper-left',
999 1 => 'Top',
1000 2 => 'Upper-right',
1001 3 => 'Left',
1002 4 => 'Mid-left',
1003 5 => 'Center',
1004 6 => 'Mid-right',
1005 7 => 'Right',
1006 8 => 'Lower-left',
1007 9 => 'Bottom',
1008 10 => 'Lower-right',
1009 } },
1010 },
1011 # 0x003d = 8192 (PH, K10D)
1012 0x003f => { #PH
1013 Name => 'LensType',
1014 Writable => 'int8u',
1015 Count => 2,
1016 SeparateTable => 1,
1017 ValueConv => '$val=~s/^(\d+ \d+) 0$/$1/; $val',
1018 ValueConvInv => '$val',
1019 PrintConv => \%pentaxLensType,
1020 },
1021 # 0x0041 - increments for each cropped pic (PH)
1022 # (DigitalFilter according to ref 5)
1023 0x0047 => { #PH
1024 Name => 'CameraTemperature',
1025 Writable => 'int8s',
1026 PrintConv => '"$val C"',
1027 PrintConvInv => '$val=~s/ ?c$//i; $val',
1028 },
1029 0x0049 => { #13
1030 Name => 'NoiseReduction',
1031 Writable => 'int16u',
1032 PrintConv => { 0 => 'Off', 1 => 'On' },
1033 },
1034 0x004d => { #PH
1035 Name => 'FlashExposureComp',
1036 Writable => 'int32s',
1037 ValueConv => '$val / 256',
1038 ValueConvInv => 'int($val * 256 + ($val > 0 ? 0.5 : -0.5))',
1039 PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
1040 PrintConvInv => '$val',
1041 },
1042 0x004f => { #PH
1043 Name => 'ImageTone',
1044 Writable => 'int16u',
1045 PrintConv => {
1046 0 => 'Natural',
1047 1 => 'Bright',
1048 },
1049 },
1050 0x005c => { #PH
1051 Name => 'ShakeReductionInfo',
1052 Format => 'undef',
1053 SubDirectory => {
1054 TagTable => 'Image::ExifTool::Pentax::SRInfo',
1055 },
1056 },
1057 0x005d => { #19/PH
1058 # (used by all Pentax DSLR's except *istD and *istDS - PH)
1059 # The lowest decrypted values observed are 246 for the first image from a
1060 # brand new K10D, and 209 for one of the first 20 images from a new K10D,
1061 # so either there are ~200 test images shot in the factory, or there is an
1062 # offset of ~200 which is applied to this value before encryption
1063 Name => 'ShutterCount',
1064 Writable => 'undef',
1065 Count => 4,
1066 Notes => 'raw value is a big-endian 4-byte integer, encrypted using Date and Time',
1067 RawConv => 'length($val) == 4 ? unpack("N",$val) : undef',
1068 RawConvInv => q{
1069 my $val = Image::ExifTool::Pentax::CryptShutterCount($val,$self);
1070 return pack('N', $val);
1071 },
1072 ValueConv => \&CryptShutterCount,
1073 ValueConvInv => '$val',
1074 },
1075 0x0200 => { #5
1076 Name => 'BlackPoint',
1077 Writable => 'int16u',
1078 Count => 4,
1079 },
1080 0x0201 => { #5
1081 Name => 'WhitePoint',
1082 Writable => 'int16u',
1083 Count => 4,
1084 },
1085 # 0x0205 - Also stores PictureMode (PH)
1086 0x0206 => { #PH
1087 Name => 'AEInfo',
1088 SubDirectory => {
1089 TagTable => 'Image::ExifTool::Pentax::AEInfo',
1090 },
1091 },
1092 0x0207 => { #PH
1093 Name => 'LensInfo',
1094 SubDirectory => {
1095 TagTable => 'Image::ExifTool::Pentax::LensInfo',
1096 },
1097 },
1098 0x0208 => { #PH
1099 Name => 'FlashInfo',
1100 SubDirectory => {
1101 TagTable => 'Image::ExifTool::Pentax::FlashInfo',
1102 },
1103 },
1104 0x0209 => {
1105 Name => 'AEMeteringSegments',
1106 Format => 'int8u',
1107 Count => 16,
1108 Notes => q{
1109 measurements from each of the 16 AE metering segments, converted to LV
1110 },
1111 # metering segment locations (ref 19):
1112 # +-------------------------+
1113 # | 14 |
1114 # | +---+---+---+---+ |
1115 # | | 5 | 3/1\ 2| 4 | |
1116 # | +-+-+-+-+ - +-+-+-+-+ |
1117 # +--+ 9 | 7 ||0|| 6 | 8 +--+
1118 # | +-+-+-+-+ - +-+-+-+-+ |
1119 # | |13 |11\ /10|12 | |
1120 # | +---+---+---+---+ |
1121 # | 15 |
1122 # +-------------------------+
1123 # convert to approximate LV equivalent (PH):
1124 ValueConv => q{
1125 my @a;
1126 foreach (split ' ', $val) { push @a, $_ / 8 - 6; }
1127 return join(' ', @a);
1128 },
1129 ValueConvInv => q{
1130 my @a;
1131 foreach (split ' ', $val) { push @a, int(($_ + 6) * 8 + 0.5); }
1132 return join(' ', @a);
1133 },
1134 PrintConv => q{
1135 my @a;
1136 foreach (split ' ', $val) { push @a, sprintf('%.1f', $_); }
1137 return join(' ', @a);
1138 },
1139 PrintConvInv => '$val',
1140 },
1141 0x020a => {
1142 Name => 'FlashADump',
1143 Flags => ['Unknown','Binary'],
1144 },
1145 0x020b => {
1146 Name => 'FlashBDump',
1147 Flags => ['Unknown','Binary'],
1148 },
1149 0x020d => { #PH
1150 Name => 'WB_RGGBLevelsDaylight',
1151 Writable => 'int16u',
1152 Count => 4,
1153 },
1154 0x020e => { #PH
1155 Name => 'WB_RGGBLevelsShade',
1156 Writable => 'int16u',
1157 Count => 4,
1158 },
1159 0x020f => { #PH
1160 Name => 'WB_RGGBLevelsCloudy',
1161 Writable => 'int16u',
1162 Count => 4,
1163 },
1164 0x0210 => { #PH
1165 Name => 'WB_RGGBLevelsTungsten',
1166 Writable => 'int16u',
1167 Count => 4,
1168 },
1169 0x0211 => { #PH
1170 Name => 'WB_RGGBLevelsFluorescentD',
1171 Writable => 'int16u',
1172 Count => 4,
1173 },
1174 0x0212 => { #PH
1175 Name => 'WB_RGGBLevelsFluorescentN',
1176 Writable => 'int16u',
1177 Count => 4,
1178 },
1179 0x0213 => { #PH
1180 Name => 'WB_RGGBLevelsFluorescentW',
1181 Writable => 'int16u',
1182 Count => 4,
1183 },
1184 0x0214 => { #PH
1185 Name => 'WB_RGGBLevelsFlash',
1186 Writable => 'int16u',
1187 Count => 4,
1188 },
1189 0x0215 => { #PH
1190 Name => 'CameraInfo',
1191 SubDirectory => {
1192 TagTable => 'Image::ExifTool::Pentax::CameraInfo',
1193 },
1194 },
1195 0x0216 => { #PH
1196 Name => 'BatteryInfo',
1197 SubDirectory => {
1198 TagTable => 'Image::ExifTool::Pentax::BatteryInfo',
1199 },
1200 },
1201 0x021f => { #19
1202 Name => 'AFInfo',
1203 SubDirectory => {
1204 TagTable => 'Image::ExifTool::Pentax::AFInfo',
1205 },
1206 },
1207 0x03fe => { #PH
1208 Name => 'DataDump',
1209 Writable => 0,
1210 PrintConv => '\$val',
1211 },
1212 0x0402 => { #5
1213 Name => 'ToneCurve',
1214 PrintConv => '\$val',
1215 },
1216 0x0403 => { #5
1217 Name => 'ToneCurves',
1218 PrintConv => '\$val',
1219 },
1220 0x0e00 => {
1221 Name => 'PrintIM',
1222 Description => 'Print Image Matching',
1223 Writable => 0,
1224 SubDirectory => {
1225 TagTable => 'Image::ExifTool::PrintIM::Main',
1226 },
1227 },
1228);
1229
1230# shake reduction information (ref PH)
1231%Image::ExifTool::Pentax::SRInfo = (
1232 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1233 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1234 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1235 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1236 WRITABLE => 1,
1237 FIRST_ENTRY => 0,
1238 NOTES => 'Shake reduction information.',
1239 0 => {
1240 Name => 'SRResult',
1241 PrintConv => { #PH/19
1242 0 => 'Not stabilized',
1243 BITMASK => {
1244 0 => 'Stabilized',
1245 6 => 'Not ready',
1246 },
1247 },
1248 },
1249 1 => {
1250 Name => 'ShakeReduction',
1251 PrintConv => { 0 => 'Off', 1 => 'On' },
1252 },
1253 2 => {
1254 Name => 'SR_SWSToSWRTime',
1255 # SWS=photometering switch, SWR=shutter release switch
1256 # (from http://www.patentstorm.us/patents/6597867-description.html)
1257 Notes => q{
1258 time from when the shutter button was half pressed to when the shutter was
1259 released
1260 },
1261 },
1262);
1263
1264# auto-exposure information (ref PH)
1265%Image::ExifTool::Pentax::AEInfo = (
1266 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1267 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1268 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1269 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1270 WRITABLE => 1,
1271 FIRST_ENTRY => 0,
1272 0 => {
1273 Name => 'AEExposureTime',
1274 Notes => 'val = 24 * 2**((32-raw)/8)',
1275 ValueConv => '24*exp(-($val-32)*log(2)/8)',
1276 ValueConvInv => '-log($val/24)*8/log(2)+32',
1277 PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
1278 PrintConvInv => 'eval $val',
1279 },
1280 1 => {
1281 Name => 'AEAperture',
1282 Notes => 'val = (2**((raw-4)/16)) / 16',
1283 # (same as val=2**((raw-68)/16), but 68 isn't a nice power of 2)
1284 ValueConv => 'exp(($val-4)*log(2)/16)/16',
1285 ValueConvInv => 'log($val*16)*16/log(2)+4',
1286 PrintConv => 'sprintf("%.1f",$val)',
1287 PrintConvInv => '$val',
1288 },
1289 2 => {
1290 Name => 'AE_ISO',
1291 Notes => 'val = 100 * 2**((raw-32)/8)',
1292 ValueConv => '100*exp(($val-32)*log(2)/8)',
1293 ValueConvInv => 'log($val/100)*8/log(2)+32',
1294 PrintConv => 'int($val + 0.5)',
1295 PrintConvInv => '$val',
1296 },
1297 3 => {
1298 Name => 'AEXv',
1299 Notes => 'val = (raw-64)/8',
1300 ValueConv => '($val-64)/8',
1301 ValueConvInv => '$val * 8 + 64',
1302 },
1303 4 => {
1304 Name => 'AEBXv',
1305 Format => 'int8s',
1306 Notes => 'val = raw / 8',
1307 ValueConv => '$val/8',
1308 ValueConvInv => '$val * 8',
1309 },
1310 5 => {
1311 Name => 'AEFlashTv',
1312 Notes => 'val = 24 * 2**((32-raw)/8)',
1313 ValueConv => '24*exp(-($val-32)*log(2)/8)', #19
1314 ValueConvInv => '-log($val/24)*8/log(2)+32',
1315 PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
1316 PrintConvInv => 'eval $val',
1317 },
1318 6 => {
1319 Name => 'AEProgramMode',
1320 PrintConv => {
1321 0 => 'Manual/Program AE',
1322 1 => 'Aperture Priority/Bulb',
1323 2 => 'Shutter Speed Priority',
1324 3 => 'Program',
1325 35 => 'Standard',
1326 43 => 'Portrait',
1327 51 => 'Landscape',
1328 59 => 'Macro',
1329 67 => 'Sport',
1330 75 => 'Night Scene Portrait',
1331 83 => 'No Flash',
1332 91 => 'Night Scene',
1333 99 => 'Surf & Snow',
1334 107 => 'Text',
1335 115 => 'Sunset',
1336 123 => 'Kids',
1337 131 => 'Pet',
1338 139 => 'Candlelight',
1339 147 => 'Museum',
1340 },
1341 },
1342 7 => {
1343 Name => 'AEExtra',
1344 Unknown => 1,
1345 },
1346);
1347
1348# lens information (ref PH)
1349%Image::ExifTool::Pentax::LensInfo = (
1350 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1351 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1352 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1353 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1354 WRITABLE => 1,
1355 FIRST_ENTRY => 0,
1356 # (must decode focus distance!)
1357 0 => {
1358 Name => 'LensType',
1359 Format => 'int8u[4]',
1360 Priority => 0,
1361 Notes => q{
1362 for most models the first 2 bytes are LensType, but for the K10D the
1363 decoding is a bit different
1364 },
1365 # this is a bit funny and needs testing with more lenses on the K10D
1366 ValueConv => q{
1367 my @v = split(' ',$val);
1368 if ($v[0] & 0xf0 or $$self{CameraModel} =~ /^PENTAX K10D\b/) {
1369 $v[0] &= 0x0f;
1370 $v[1] = GetByteOrder() eq 'MM' ? $v[2] * 256 + $v[3] : $v[3] * 256 + $v[2];
1371 }
1372 return "$v[0] $v[1]";
1373 },
1374 PrintConv => \%pentaxLensType,
1375 SeparateTable => 1,
1376 },
1377 4 => {
1378 Condition => '$$self{CameraModel} !~ /K10D/',
1379 Name => 'LensCodes',
1380 Format => 'int8u[16]',
1381 Notes => 'all models but the K10D',
1382 },
1383 5 => {
1384 Condition => '$$self{CameraModel} =~ /K10D/',
1385 Name => 'LensCodes',
1386 Format => 'int8u[16]',
1387 Notes => 'K10D only',
1388 },
1389);
1390
1391# flash information (ref PH)
1392%Image::ExifTool::Pentax::FlashInfo = (
1393 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1394 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1395 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1396 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1397 WRITABLE => 1,
1398 FIRST_ENTRY => 0,
1399 0 => 'FlashStatus',
1400 1 => {
1401 Name => 'FlashModeCode',
1402 PrintConv => {
1403 149 => 'On, Wireless', # K10D
1404 192 => 'On', # K10D
1405 193 => 'On, Red-eye reduction', # *istDS2, K10D
1406 194 => 'Auto, Fired', # K100D, K110D
1407 200 => 'On, Slow-sync', # K10D
1408 201 => 'On, Slow-sync, Red-eye reduction', # K10D
1409 202 => 'On, Trailing-curtain Sync', # K10D
1410 240 => 'Off (240)', # *istD, *istDS, K100D, K10D
1411 241 => 'Off (241)', # *istDL
1412 242 => 'Off (242)', # *istDS, *istDL2, K100D, K110D
1413 244 => 'Off (244)', # K100D, K110D (either "Auto, Did not fire" or "Off")
1414 },
1415 },
1416 2 => 'ExternalFlashMode',
1417 3 => 'InternalFlashMagni',
1418 4 => 'TTL_DA_AUp',
1419 5 => 'TTL_DA_ADown',
1420 6 => 'TTL_DA_BUp',
1421 7 => 'TTL_DA_BDown',
1422 # ? => 'ExternalFlashMagniA',
1423 # ? => 'ExternalFlashMagniB',
1424);
1425
1426# camera manufacture information (ref PH)
1427%Image::ExifTool::Pentax::CameraInfo = (
1428 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1429 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1430 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1431 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1432 WRITABLE => 1,
1433 FIRST_ENTRY => 0,
1434 FORMAT => 'int32u',
1435 0 => {
1436 Name => 'PentaxModelID',
1437 Priority => 0, # (Optio SVi uses incorrect Optio SV ID here)
1438 SeparateTable => 1,
1439 PrintConv => \%pentaxModelID,
1440 },
1441 1 => {
1442 Name => 'ManufactureDate',
1443 ValueConv => q{
1444 $val =~ /^(\d{4})(\d{2})(\d{2})$/ and return "$1:$2:$3";
1445 # Optio A10 and A20 leave "200" off the year
1446 $val =~ /^(\d)(\d{2})(\d{2})$/ and return "200$1:$2:$3";
1447 return "Unknown ($val)";
1448 },
1449 ValueConvInv => '$val=~tr/0-9//dc; $val',
1450 },
1451 2 => {
1452 Name => 'ModelRevision',
1453 Format => 'int32u[2]',
1454 ValueConv => '$val=~tr/ /./; $val',
1455 ValueConvInv => '$val=~tr/./ /; $val',
1456 },
1457 4 => 'InternalSerialNumber',
1458);
1459
1460# battery information (ref PH)
1461%Image::ExifTool::Pentax::BatteryInfo = (
1462 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1463 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1464 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1465 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1466 WRITABLE => 1,
1467 FIRST_ENTRY => 0,
1468 0 => {
1469 Name => 'BatteryType',
1470 ValueConv => '$val & 0x7f',
1471 ValueConvInv => '$val | 0x80', # (not sure what this bit means)
1472 },
1473 1 => {
1474 Name => 'BatteryBodyGripStates',
1475 Notes => 'body and grip battery state',
1476 ValueConv => '($val >> 4) . " " . ($val & 0x0f)',
1477 ValueConvInv => 'my @a=split(" ",$val); ($a[0] << 4) + $a[1]',
1478 },
1479 # internal and grip battery voltage Analogue to Digital measurements,
1480 # open circuit and under load
1481 2 => 'BatteryADBodyNoLoad',
1482 3 => 'BatteryADBodyLoad',
1483 4 => 'BatteryADGripNoLoad',
1484 5 => 'BatteryADGripLoad',
1485);
1486
1487# auto focus information (ref 19)
1488%Image::ExifTool::Pentax::AFInfo = (
1489 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1490 WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
1491 CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
1492 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1493 WRITABLE => 1,
1494 FIRST_ENTRY => 0,
1495 0x0b => {
1496 Name => 'AFPointsInFocus',
1497 Notes => q{
1498 may report two points in focus even though a single AFPoint has been
1499 selected, in which case the selected AFPoint is the first reported
1500 },
1501 PrintConv => {
1502 0 => 'None',
1503 1 => 'Lower-left, Bottom',
1504 2 => 'Bottom',
1505 3 => 'Lower-right, Bottom',
1506 4 => 'Mid-left, Center',
1507 5 => 'Center (horizontal)', #PH (K10D)
1508 6 => 'Mid-right, Center',
1509 7 => 'Upper-left, Top',
1510 8 => 'Top',
1511 9 => 'Upper-right, Top',
1512 10 => 'Right',
1513 11 => 'Lower-left, Mid-left',
1514 12 => 'Upper-left, Mid-left',
1515 13 => 'Bottom, Center',
1516 14 => 'Top, Center',
1517 15 => 'Lower-right, Mid-right',
1518 16 => 'Upper-right, Mid-right',
1519 17 => 'Left',
1520 18 => 'Mid-left',
1521 19 => 'Center (vertical)', #PH (K10D)
1522 20 => 'Mid-right',
1523 },
1524 },
1525);
1526
1527# tags in Pentax QuickTime videos (PH - tests with Optio WP)
1528# (note: very similar to information in Nikon videos)
1529%Image::ExifTool::Pentax::MOV = (
1530 PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
1531 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1532 NOTES => 'This information is found in Pentax MOV video images.',
1533 0x00 => {
1534 Name => 'Make',
1535 Format => 'string[6]',
1536 PrintConv => 'ucfirst(lc($val))',
1537 },
1538 0x26 => {
1539 Name => 'ExposureTime',
1540 Format => 'int32u',
1541 ValueConv => '$val ? 10 / $val : 0',
1542 PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
1543 },
1544 0x2a => {
1545 Name => 'FNumber',
1546 Format => 'int32u',
1547 ValueConv => '$val / 10',
1548 PrintConv => 'sprintf("%.1f",$val)',
1549 },
1550 0x32 => {
1551 Name => 'ExposureCompensation',
1552 Format => 'int32s',
1553 ValueConv => '$val / 10',
1554 PrintConv => 'Image::ExifTool::Exif::ConvertFraction($val)',
1555 },
1556 0x44 => {
1557 Name => 'WhiteBalance',
1558 Format => 'int16u',
1559 PrintConv => {
1560 0 => 'Auto',
1561 1 => 'Daylight',
1562 2 => 'Shade',
1563 3 => 'Fluorescent', #2
1564 4 => 'Tungsten',
1565 5 => 'Manual',
1566 },
1567 },
1568 0x48 => {
1569 Name => 'FocalLength',
1570 Writable => 'int32u',
1571 ValueConv => '$val / 10',
1572 PrintConv => 'sprintf("%.1fmm",$val)',
1573 },
1574 0xaf => {
1575 Name => 'ISO',
1576 Format => 'int16u',
1577 },
1578);
1579
1580# Pentax type 2 (Casio-like) maker notes (ref 1)
1581%Image::ExifTool::Pentax::Type2 = (
1582 WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
1583 CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
1584 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1585 WRITABLE => 'int16u',
1586 NOTES => q{
1587 These tags are used by the Pentax Optio 330 and 430, and are similar to the
1588 tags used by Casio.
1589 },
1590 0x0001 => {
1591 Name => 'RecordingMode',
1592 PrintConv => {
1593 0 => 'Auto',
1594 1 => 'Night Scene',
1595 2 => 'Manual',
1596 },
1597 },
1598 0x0002 => {
1599 Name => 'Quality',
1600 PrintConv => {
1601 0 => 'Good',
1602 1 => 'Better',
1603 2 => 'Best',
1604 },
1605 },
1606 0x0003 => {
1607 Name => 'FocusMode',
1608 PrintConv => {
1609 2 => 'Custom',
1610 3 => 'Auto',
1611 },
1612 },
1613 0x0004 => {
1614 Name => 'FlashMode',
1615 PrintConv => {
1616 1 => 'Auto',
1617 2 => 'On',
1618 4 => 'Off',
1619 6 => 'Red-eye reduction',
1620 },
1621 },
1622 # Casio 0x0005 is FlashIntensity
1623 # Casio 0x0006 is ObjectDistance
1624 0x0007 => {
1625 Name => 'WhiteBalance',
1626 PrintConv => {
1627 0 => 'Auto',
1628 1 => 'Daylight',
1629 2 => 'Shade',
1630 3 => 'Tungsten',
1631 4 => 'Fluorescent',
1632 5 => 'Manual',
1633 },
1634 },
1635 0x000a => {
1636 Name => 'DigitalZoom',
1637 Writable => 'int32u',
1638 },
1639 0x000b => {
1640 Name => 'Sharpness',
1641 PrintConv => {
1642 0 => 'Normal',
1643 1 => 'Soft',
1644 2 => 'Hard',
1645 },
1646 },
1647 0x000c => {
1648 Name => 'Contrast',
1649 PrintConv => {
1650 0 => 'Normal',
1651 1 => 'Low',
1652 2 => 'High',
1653 },
1654 },
1655 0x000d => {
1656 Name => 'Saturation',
1657 PrintConv => {
1658 0 => 'Normal',
1659 1 => 'Low',
1660 2 => 'High',
1661 },
1662 },
1663 0x0014 => {
1664 Name => 'ISO',
1665 Priority => 0,
1666 PrintConv => {
1667 10 => 100,
1668 16 => 200,
1669 50 => 50, #PH
1670 100 => 100, #PH
1671 200 => 200, #PH
1672 400 => 400, #PH
1673 800 => 800, #PH
1674 1600 => 1600, #PH
1675 3200 => 3200, #PH
1676 },
1677 },
1678 0x0017 => {
1679 Name => 'ColorFilter',
1680 PrintConv => {
1681 1 => 'Full',
1682 2 => 'Black & White',
1683 3 => 'Sepia',
1684 },
1685 },
1686 # Casio 0x0018 is AFPoint
1687 # Casio 0x0019 is FlashIntensity
1688 0x0e00 => {
1689 Name => 'PrintIM',
1690 Description => 'Print Image Matching',
1691 Writable => 0,
1692 SubDirectory => {
1693 TagTable => 'Image::ExifTool::PrintIM::Main',
1694 },
1695 },
1696 0x1000 => {
1697 Name => 'HometownCityCode',
1698 Writable => 'undef',
1699 Count => 4,
1700 },
1701 0x1001 => { #PH
1702 Name => 'DestinationCityCode',
1703 Writable => 'undef',
1704 Count => 4,
1705 },
1706);
1707
1708# ASCII-based maker notes of Optio E20 - PH
1709%Image::ExifTool::Pentax::Type4 = (
1710 PROCESS_PROC => \&Image::ExifTool::HP::ProcessHP,
1711 GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1712 NOTES => q{
1713 The following few tags are extracted from the wealth of information
1714 available in maker notes of the Optio E20. These maker notes are stored as
1715 ASCII text in a format very similar to some HP models.
1716 },
1717 'F/W Version' => 'FirmwareVersion',
1718);
1719
1720#------------------------------------------------------------------------------
1721# Encrypt or decrypt Pentax ShutterCount (symmetrical encryption) - PH
1722# Inputs: 0) shutter count value, 1) ExifTool object ref
1723# Returns: Encrypted or decrypted ShutterCount
1724sub CryptShutterCount($$)
1725{
1726 my ($val, $exifTool) = @_;
1727 # Pentax Date and Time values are used in the encryption
1728 return undef unless $$exifTool{PentaxDate} and $$exifTool{PentaxTime} and
1729 length($$exifTool{PentaxDate})==4 and length($$exifTool{PentaxTime})>=3;
1730 # get Date and Time as integers (after padding Time with a null byte)
1731 my $date = unpack('N', $$exifTool{PentaxDate});
1732 my $time = unpack('N', $$exifTool{PentaxTime} . "\0");
1733 return $val ^ $date ^ (0xffffffff - $time);
1734}
1735
1736
17371; # end
1738
1739__END__
1740
1741=head1 NAME
1742
1743Image::ExifTool::Pentax - Pentax/Asahi maker notes tags
1744
1745=head1 SYNOPSIS
1746
1747This module is loaded automatically by Image::ExifTool when required.
1748
1749=head1 DESCRIPTION
1750
1751This module contains definitions required by Image::ExifTool to interpret
1752Pentax and Asahi maker notes in EXIF information.
1753
1754=head1 NOTES
1755
1756I couldn't find a good source for Pentax maker notes information, but I've
1757managed to discover a fair bit of information by analyzing sample pictures
1758from the Optio 330, Optio 550, Optio S, *istD, *istDs, and through tests
1759with my own Optio WP, and with help provided by other ExifTool users (see
1760L<ACKNOWLEDGEMENTS>).
1761
1762The Pentax maker notes are stored in standard EXIF format, but the offsets
1763used for some of their cameras are wacky. The Optio 330 gives the offset
1764relative to the offset of the tag in the directory, the Optio WP uses a base
1765offset in the middle of nowhere, and the Optio 550 uses different (and
1766totally illogical) bases for different menu entries. Very weird. (It
1767wouldn't surprise me if Pentax can't read their own maker notes!) Luckily,
1768there are only a few entries in the maker notes which are large enough to
1769require offsets, so this doesn't affect much useful information. ExifTool
1770attempts to make sense of this fiasco by making an assumption about where
1771the information should be stored to deduce the correct offsets.
1772
1773=head1 REFERENCES
1774
1775=over 4
1776
1777=item L<Image::MakerNotes::Pentax|Image::MakerNotes::Pentax>
1778
1779=item L<http://johnst.org/sw/exiftags/> (Asahi models)
1780
1781=item L<http://kobe1995.jp/~kaz/astro/istD.html>
1782
1783=item L<http://www.cybercom.net/~dcoffin/dcraw/>
1784
1785=item (...plus lots of testing with my Optio WP and K10D!)
1786
1787=back
1788
1789=head1 ACKNOWLEDGEMENTS
1790
1791Thanks to Wayne Smith, John Francis, Douglas O'Brien Cvetan Ivanov and Jens
1792Duttke for help figuring out some Pentax tags, Denis Bourez, Kazumichi
1793Kawabata, David Buret, Barney Garrett and Axel Kellner for adding to the
1794LensType list, and Ger Vermeulen for contributing print conversion values
1795for some tags.
1796
1797=head1 AUTHOR
1798
1799Copyright 2003-2007, Phil Harvey (phil at owl.phy.queensu.ca)
1800
1801This library is free software; you can redistribute it and/or modify it
1802under the same terms as Perl itself.
1803
1804=head1 SEE ALSO
1805
1806L<Image::ExifTool::TagNames/Pentax Tags>,
1807L<Image::ExifTool(3pm)|Image::ExifTool>,
1808L<Image::Info(3pm)|Image::Info>
1809
1810=cut
Note: See TracBrowser for help on using the repository browser.