Panasonic.pm 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374
  1. #------------------------------------------------------------------------------
  2. # File: Panasonic.pm
  3. #
  4. # Description: Panasonic/Leica maker notes tags
  5. #
  6. # Revisions: 11/10/2004 - P. Harvey Created
  7. #
  8. # References: 1) http://www.compton.nu/panasonic.html (based on FZ10)
  9. # 2) Derived from DMC-FZ3 samples from dpreview.com
  10. # 3) http://johnst.org/sw/exiftags/
  11. # 4) Tels (http://bloodgate.com/) private communication (tests with FZ5)
  12. # 7) http://homepage3.nifty.com/kamisaka/makernote/makernote_pana.htm (2007/10/02)
  13. # 8) Marcel Coenen private communication (DMC-FZ50)
  14. # 9) http://forums.dpreview.com/forums/read.asp?forum=1033&message=22756430
  15. # 10) http://bretteville.com/pdfs/M8Metadata_v2.pdf
  16. # 11) http://www.digital-leica.com/lens_codes/index.html
  17. # 12) Joerg - http://www.cpanforum.com/threads/11602 (LX3 firmware 2.0)
  18. # 13) Michael Byczkowski private communication (Leica M9)
  19. # 14) Carl Bretteville private communication (M9)
  20. # 15) Zdenek Mihula private communication (TZ8)
  21. # 16) Olaf Ulrich private communication
  22. # 17) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4922.0.html
  23. # 18) Thomas Modes private communication (G6)
  24. # 19) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,5533.0.html
  25. # JD) Jens Duttke private communication (TZ3,FZ30,FZ50)
  26. #------------------------------------------------------------------------------
  27. package Image::ExifTool::Panasonic;
  28. use strict;
  29. use vars qw($VERSION %leicaLensTypes);
  30. use Image::ExifTool qw(:DataAccess :Utils);
  31. use Image::ExifTool::Exif;
  32. $VERSION = '1.91';
  33. sub ProcessLeicaLEIC($$$);
  34. sub WhiteBalanceConv($;$$);
  35. # Leica lens types (ref 10)
  36. %leicaLensTypes = (
  37. OTHER => sub {
  38. my ($val, $inv, $conv) = @_;
  39. return undef if $inv or not $val =~ s/ .*//;
  40. return $$conv{$val};
  41. },
  42. Notes => q{
  43. the LensType value is obtained by splitting the stored value into 2
  44. integers: The stored value divided by 4, and its lower 2 bits. The second
  45. number is used only if necessary to identify certain manually coded lenses
  46. on the M9, or the focal length of some multi-focal lenses.
  47. },
  48. # All M9 codes (two numbers: first the LensID then the lower 2 bits)
  49. # are ref PH with samples from ref 13. From ref 10, the lower 2 bits of
  50. # the LensType value give the frame selector position for most lenses,
  51. # although for the 28-35-50mm (at least) it gives the focal length selection.
  52. # The M9 also gives the focal length selection but for other lenses the
  53. # lower 3 bits don't change with frame selector position except for the lens
  54. # shows as uncoded for certain lenses and some incorrect positions of the
  55. # frame selector. The bits are zero for uncoded lenses when manually coding
  56. # from the menu on the M9. - PH
  57. # Frame selector bits (from ref 10, M8):
  58. # 1 => '28/90mm frame lines engaged',
  59. # 2 => '24/35mm frame lines engaged',
  60. # 3 => '50/75mm frame lines engaged',
  61. '0 0' => 'Uncoded lens',
  62. #
  63. # NOTE: MUST ADD ENTRY TO %frameSelectorBits below when a new lens is added!!!!
  64. #
  65. # model number(s):
  66. 1 => 'Elmarit-M 21mm f/2.8', # 11134
  67. 3 => 'Elmarit-M 28mm f/2.8 (III)', # 11804
  68. 4 => 'Tele-Elmarit-M 90mm f/2.8 (II)', # 11800
  69. 5 => 'Summilux-M 50mm f/1.4 (II)', # 11868/11856/11114
  70. 6 => 'Summicron-M 35mm f/2 (IV)', # 11310/11311
  71. '6 0' => 'Summilux-M 35mm f/1.4', # 11869/11870/11860
  72. 7 => 'Summicron-M 90mm f/2 (II)', # 11136/11137
  73. 9 => 'Elmarit-M 135mm f/2.8 (I/II)', # 11829
  74. '9 0' => 'Apo-Telyt-M 135mm f/3.4', # 11889
  75. 16 => 'Tri-Elmar-M 16-18-21mm f/4 ASPH.',# 11626
  76. '16 1' => 'Tri-Elmar-M 16-18-21mm f/4 ASPH. (at 16mm)',
  77. '16 2' => 'Tri-Elmar-M 16-18-21mm f/4 ASPH. (at 18mm)',
  78. '16 3' => 'Tri-Elmar-M 16-18-21mm f/4 ASPH. (at 21mm)',
  79. 23 => 'Summicron-M 50mm f/2 (III)', # 11817, version (I) in camera menu
  80. 24 => 'Elmarit-M 21mm f/2.8 ASPH.', # 11135/11897
  81. 25 => 'Elmarit-M 24mm f/2.8 ASPH.', # 11878/11898
  82. 26 => 'Summicron-M 28mm f/2 ASPH.', # 11604
  83. 27 => 'Elmarit-M 28mm f/2.8 (IV)', # 11809
  84. 28 => 'Elmarit-M 28mm f/2.8 ASPH.', # 11606
  85. 29 => 'Summilux-M 35mm f/1.4 ASPH.', # 11874/11883
  86. '29 0' => 'Summilux-M 35mm f/1.4 ASPHERICAL', # 11873 (different from "ASPH." model!)
  87. 30 => 'Summicron-M 35mm f/2 ASPH.', # 11879/11882
  88. 31 => 'Noctilux-M 50mm f/1', # 11821/11822
  89. '31 0' => 'Noctilux-M 50mm f/1.2', # 11820
  90. 32 => 'Summilux-M 50mm f/1.4 ASPH.', # 11891/11892
  91. 33 => 'Summicron-M 50mm f/2 (IV, V)', # 11819/11825/11826/11816, version (II,III) in camera menu
  92. 34 => 'Elmar-M 50mm f/2.8', # 11831/11823/11825
  93. 35 => 'Summilux-M 75mm f/1.4', # 11814/11815/11810
  94. 36 => 'Apo-Summicron-M 75mm f/2 ASPH.', # 11637
  95. 37 => 'Apo-Summicron-M 90mm f/2 ASPH.', # 11884/11885
  96. 38 => 'Elmarit-M 90mm f/2.8', # 11807/11808, version (II) in camera menu
  97. 39 => 'Macro-Elmar-M 90mm f/4', # 11633/11634
  98. '39 0' => 'Tele-Elmar-M 135mm f/4 (II)',# 11861
  99. 40 => 'Macro-Adapter M', # 14409
  100. '41 3' => 'Apo-Summicron-M 50mm f/2 Asph', #16
  101. 42 => 'Tri-Elmar-M 28-35-50mm f/4 ASPH.',# 11625
  102. '42 1' => 'Tri-Elmar-M 28-35-50mm f/4 ASPH. (at 28mm)',
  103. '42 2' => 'Tri-Elmar-M 28-35-50mm f/4 ASPH. (at 35mm)',
  104. '42 3' => 'Tri-Elmar-M 28-35-50mm f/4 ASPH. (at 50mm)',
  105. 43 => 'Summarit-M 35mm f/2.5', # ? (ref PH)
  106. 44 => 'Summarit-M 50mm f/2.5', # ? (ref PH)
  107. 45 => 'Summarit-M 75mm f/2.5', # ? (ref PH)
  108. 46 => 'Summarit-M 90mm f/2.5', # ?
  109. 47 => 'Summilux-M 21mm f/1.4 ASPH.', # ? (ref 11)
  110. 48 => 'Summilux-M 24mm f/1.4 ASPH.', # ? (ref 11)
  111. 49 => 'Noctilux-M 50mm f/0.95 ASPH.', # ? (ref 11)
  112. 50 => 'Elmar-M 24mm f/3.8 ASPH.', # ? (ref 11)
  113. 51 => 'Super-Elmar-M 21mm f/3.4 Asph', # ? (ref 16, frameSelectorBits=1)
  114. '51 2' => 'Super-Elmar-M 14mm f/3.8 Asph', # ? (ref 16)
  115. 52 => 'Super-Elmar-M 18mm f/3.8 ASPH.', # ? (ref PH/11)
  116. '53 2' => 'Apo-Telyt-M 135mm f/3.4', #16
  117. '53 3' => 'Apo-Summicron-M 50mm f/2 (VI)', #LibRaw
  118. );
  119. # M9 frame selector bits for each lens
  120. # 1 = towards lens = 28/90mm or 21mm or Adapter (or Elmarit-M 135mm f/2.8)
  121. # 2 = away from lens = 24/35mm (or 35/135mm on the M9)
  122. # 3 = middle position = 50/75mm or 18mm
  123. my %frameSelectorBits = (
  124. 1 => 1,
  125. 3 => 1,
  126. 4 => 1,
  127. 5 => 3,
  128. 6 => 2,
  129. 7 => 1,
  130. 9 => 1, # (because lens has special magnifier for the rangefinder)
  131. 16 => 1, # or 2 or 3
  132. 23 => 3,
  133. 24 => 1,
  134. 25 => 2,
  135. 26 => 1,
  136. 27 => 1,
  137. 28 => 1,
  138. 29 => 2,
  139. 30 => 2,
  140. 31 => 3,
  141. 32 => 3,
  142. 33 => 3,
  143. 34 => 3,
  144. 35 => 3,
  145. 36 => 3,
  146. 37 => 1,
  147. 38 => 1,
  148. 39 => 1,
  149. 40 => 1,
  150. 42 => 1, # or 2 or 3
  151. 43 => 2, # (NC)
  152. 44 => 3, # (NC)
  153. 45 => 3,
  154. 46 => 1, # (NC)
  155. 47 => 1, # (NC)
  156. 48 => 2, # (NC)
  157. 49 => 3, # (NC)
  158. 50 => 2, # (NC)
  159. 51 => 1, # or 2 (ref 16)
  160. 52 => 3,
  161. 53 => 2, #16
  162. );
  163. # conversions for ShootingMode and SceneMode
  164. my %shootingMode = (
  165. 1 => 'Normal',
  166. 2 => 'Portrait',
  167. 3 => 'Scenery',
  168. 4 => 'Sports',
  169. 5 => 'Night Portrait',
  170. 6 => 'Program',
  171. 7 => 'Aperture Priority',
  172. 8 => 'Shutter Priority',
  173. 9 => 'Macro',
  174. 10 => 'Spot', #7
  175. 11 => 'Manual',
  176. 12 => 'Movie Preview', #PH (LZ6)
  177. 13 => 'Panning',
  178. 14 => 'Simple', #PH (LZ6)
  179. 15 => 'Color Effects', #7
  180. 16 => 'Self Portrait', #PH (TZ5)
  181. 17 => 'Economy', #7
  182. 18 => 'Fireworks',
  183. 19 => 'Party',
  184. 20 => 'Snow',
  185. 21 => 'Night Scenery',
  186. 22 => 'Food', #7
  187. 23 => 'Baby', #JD
  188. 24 => 'Soft Skin', #PH (LZ6)
  189. 25 => 'Candlelight', #PH (LZ6)
  190. 26 => 'Starry Night', #PH (LZ6)
  191. 27 => 'High Sensitivity', #7 (LZ6)
  192. 28 => 'Panorama Assist', #7
  193. 29 => 'Underwater', #7
  194. 30 => 'Beach', #PH (LZ6)
  195. 31 => 'Aerial Photo', #PH (LZ6)
  196. 32 => 'Sunset', #PH (LZ6)
  197. 33 => 'Pet', #JD
  198. 34 => 'Intelligent ISO', #PH (LZ6)
  199. 35 => 'Clipboard', #7
  200. 36 => 'High Speed Continuous Shooting', #7
  201. 37 => 'Intelligent Auto', #7
  202. 39 => 'Multi-aspect', #PH (TZ5)
  203. 41 => 'Transform', #PH (FS7)
  204. 42 => 'Flash Burst', #PH (FZ28)
  205. 43 => 'Pin Hole', #PH (FZ28)
  206. 44 => 'Film Grain', #PH (FZ28)
  207. 45 => 'My Color', #PH (GF1)
  208. 46 => 'Photo Frame', #PH (FS7)
  209. 48 => 'Movie', #PH (GM1)
  210. # 49 - seen for FS4 (snow?)
  211. 51 => 'HDR', #12
  212. 52 => 'Peripheral Defocus', #Horst Wandres
  213. 55 => 'Handheld Night Shot', #PH (FZ47)
  214. 57 => '3D', #PH (3D1)
  215. 59 => 'Creative Control', #PH (FZ47)
  216. 62 => 'Panorama', #17
  217. 63 => 'Glass Through', #17
  218. 64 => 'HDR', #17
  219. 66 => 'Digital Filter', #PH (GF5 "Impressive Art", "Cross Process", "Color Select", "Star")
  220. 67 => 'Clear Portrait', #18
  221. 68 => 'Silky Skin', #18
  222. 69 => 'Backlit Softness', #18
  223. 70 => 'Clear in Backlight', #18
  224. 71 => 'Relaxing Tone', #18
  225. 72 => "Sweet Child's Face", #18
  226. 73 => 'Distinct Scenery', #18
  227. 74 => 'Bright Blue Sky', #18
  228. 75 => 'Romantic Sunset Glow', #18
  229. 76 => 'Vivid Sunset Glow', #18
  230. 77 => 'Glistening Water', #18
  231. 78 => 'Clear Nightscape', #18
  232. 79 => 'Cool Night Sky', #18
  233. 80 => 'Warm Glowing Nightscape', #18
  234. 81 => 'Artistic Nightscape', #18
  235. 82 => 'Glittering Illuminations', #18
  236. 83 => 'Clear Night Portrait', #18
  237. 84 => 'Soft Image of a Flower', #18
  238. 85 => 'Appetizing Food', #18
  239. 86 => 'Cute Desert', #18
  240. 87 => 'Freeze Animal Motion', #18
  241. 88 => 'Clear Sports Shot', #18
  242. 89 => 'Monochrome', #18
  243. 90 => 'Creative Control', #18
  244. );
  245. %Image::ExifTool::Panasonic::Main = (
  246. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  247. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  248. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  249. WRITABLE => 1,
  250. 0x01 => {
  251. Name => 'ImageQuality',
  252. Writable => 'int16u',
  253. PrintConv => {
  254. 1 => 'TIFF', #PH (FZ20)
  255. 2 => 'High',
  256. 3 => 'Normal',
  257. # 5 - seen this for 1920x1080, 30fps SZ7 video - PH
  258. 6 => 'Very High', #3 (Leica)
  259. 7 => 'Raw', #3 (Leica)
  260. 9 => 'Motion Picture', #PH (LZ6)
  261. 11 => 'Full HD Movie', #PH (V-LUX)
  262. 12 => '4k Movie', #PH (V-LUX)
  263. },
  264. },
  265. 0x02 => {
  266. Name => 'FirmwareVersion',
  267. Writable => 'undef',
  268. Notes => q{
  269. for some camera models such as the FZ30 this may be an internal production
  270. reference number and not the actual firmware version
  271. }, # (ref http://www.stevesforums.com/forums/view_topic.php?id=87764&forum_id=23&)
  272. # (can be either binary or ascii -- add decimal points if binary)
  273. ValueConv => '$val=~/[\0-\x2f]/ ? join(" ",unpack("C*",$val)) : $val',
  274. ValueConvInv => q{
  275. $val =~ /(\d+ ){3}\d+/ and $val = pack('C*',split(' ', $val));
  276. length($val) == 4 or warn "Version must be 4 numbers\n";
  277. return $val;
  278. },
  279. PrintConv => '$val=~tr/ /./; $val',
  280. PrintConvInv => '$val=~tr/./ /; $val',
  281. },
  282. 0x03 => {
  283. Name => 'WhiteBalance',
  284. Writable => 'int16u',
  285. PrintConv => {
  286. 1 => 'Auto',
  287. 2 => 'Daylight',
  288. 3 => 'Cloudy',
  289. 4 => 'Incandescent', #PH
  290. 5 => 'Manual',
  291. 8 => 'Flash',
  292. 10 => 'Black & White', #3 (Leica)
  293. 11 => 'Manual', #PH (FZ8)
  294. 12 => 'Shade', #PH (FS7)
  295. 13 => 'Kelvin', #PeterK (NC)
  296. },
  297. },
  298. 0x07 => {
  299. Name => 'FocusMode',
  300. Writable => 'int16u',
  301. PrintConv => {
  302. 1 => 'Auto',
  303. 2 => 'Manual',
  304. 4 => 'Auto, Focus button', #4
  305. 5 => 'Auto, Continuous', #4
  306. 6 => 'AF-S', #18 (also seen for GF1 - PH)
  307. 7 => 'AF-C', #18
  308. 8 => 'AF-F', #18 (auto-focus flexible)
  309. },
  310. },
  311. 0x0f => [
  312. {
  313. Name => 'AFAreaMode',
  314. Condition => '$$self{Model} =~ /DMC-FZ10\b/', #JD
  315. Writable => 'int8u',
  316. Count => 2,
  317. Notes => 'DMC-FZ10',
  318. PrintConv => {
  319. '0 1' => 'Spot Mode On',
  320. '0 16' => 'Spot Mode Off',
  321. },
  322. },{
  323. Name => 'AFAreaMode',
  324. Writable => 'int8u',
  325. Count => 2,
  326. Notes => 'other models',
  327. PrintConv => { #PH
  328. '0 1' => '9-area', # (FS7)
  329. '0 16' => '3-area (high speed)', # (FZ8)
  330. '0 23' => '23-area', #PH (FZ47,NC)
  331. # '0 49' - seen for LX100, V-LUX (PH)
  332. '1 0' => 'Spot Focusing', # (FZ8)
  333. '1 1' => '5-area', # (FZ8)
  334. '16' => 'Normal?', # (only mode for DMC-LC20)
  335. '16 0' => '1-area', # (FZ8)
  336. '16 16' => '1-area (high speed)', # (FZ8)
  337. # '32 0' is Face Detect for FS7, and Face Detect or Focus Tracking
  338. # for the DMC-FZ200 (ref 17), and Auto is DMC-L1 guess,
  339. '32 0' => 'Tracking',
  340. '32 1' => '3-area (left)?', # (DMC-L1 guess)
  341. '32 2' => '3-area (center)?', # (DMC-L1 guess)
  342. '32 3' => '3-area (right)?', # (DMC-L1 guess)
  343. '64 0' => 'Face Detect',
  344. '128 0' => 'Spot Focusing 2', #18
  345. },
  346. },
  347. ],
  348. 0x1a => {
  349. Name => 'ImageStabilization',
  350. Writable => 'int16u',
  351. PrintConv => {
  352. 2 => 'On, Mode 1',
  353. 3 => 'Off',
  354. 4 => 'On, Mode 2',
  355. 5 => 'Panning', #18
  356. # GF1 also has a "Mode 3" - PH
  357. 6 => 'On, Mode 3', #PH (GX7, sensor shift?)
  358. },
  359. },
  360. 0x1c => {
  361. Name => 'MacroMode',
  362. Writable => 'int16u',
  363. PrintConv => {
  364. 1 => 'On',
  365. 2 => 'Off',
  366. 0x101 => 'Tele-Macro', #7
  367. 0x201 => 'Macro Zoom', #PH (FS7)
  368. },
  369. },
  370. 0x1f => {
  371. Name => 'ShootingMode',
  372. Writable => 'int16u',
  373. PrintConvColumns => 2,
  374. PrintConv => \%shootingMode,
  375. },
  376. 0x20 => {
  377. Name => 'Audio',
  378. Writable => 'int16u',
  379. PrintConv => {
  380. 1 => 'Yes',
  381. 2 => 'No',
  382. 3 => 'Stereo', #PH (NC)
  383. },
  384. },
  385. 0x21 => { #2
  386. Name => 'DataDump',
  387. Writable => 0,
  388. Binary => 1,
  389. },
  390. # 0x22 - normally 0, but 2 for 'Simple' ShootingMode in LZ6 sample - PH
  391. 0x23 => {
  392. Name => 'WhiteBalanceBias',
  393. Format => 'int16s',
  394. Writable => 'int16s',
  395. ValueConv => '$val / 3',
  396. ValueConvInv => '$val * 3',
  397. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  398. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  399. },
  400. 0x24 => {
  401. Name => 'FlashBias',
  402. Format => 'int16s',
  403. Writable => 'int16s',
  404. ValueConv => '$val / 3', #17 (older models may not have factor of 3? - PH)
  405. ValueConvInv => '$val * 3',
  406. PrintConv => 'Image::ExifTool::Exif::PrintFraction($val)',
  407. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  408. },
  409. 0x25 => { #PH
  410. Name => 'InternalSerialNumber',
  411. Writable => 'undef',
  412. Count => 16,
  413. Notes => q{
  414. this number is unique, and contains the date of manufacture, but is not the
  415. same as the number printed on the camera body
  416. },
  417. PrintConv => q{
  418. return $val unless $val=~/^([A-Z]\d{2})(\d{2})(\d{2})(\d{2})(\d{4})/;
  419. my $yr = $2 + ($2 < 70 ? 2000 : 1900);
  420. return "($1) $yr:$3:$4 no. $5";
  421. },
  422. PrintConvInv => '$_=$val; tr/A-Z0-9//dc; s/(.{3})(19|20)/$1/; $_',
  423. },
  424. 0x26 => { #PH
  425. Name => 'PanasonicExifVersion',
  426. Writable => 'undef',
  427. },
  428. # 0x27 - values: 0 (LZ6,FX10K)
  429. 0x28 => {
  430. Name => 'ColorEffect',
  431. Writable => 'int16u',
  432. # FX30 manual: (ColorMode) natural, vivid, cool, warm, b/w, sepia
  433. PrintConv => {
  434. 1 => 'Off',
  435. 2 => 'Warm',
  436. 3 => 'Cool',
  437. 4 => 'Black & White',
  438. 5 => 'Sepia',
  439. 6 => 'Happy', #PH (FX70) (yes, really. you wouldn't want sad colors now would you?)
  440. 8 => 'Vivid', #PH (SZ3)
  441. },
  442. },
  443. 0x29 => { #JD
  444. Name => 'TimeSincePowerOn',
  445. Writable => 'int32u',
  446. Notes => q{
  447. time in 1/100 s from when the camera was powered on to when the image is
  448. written to memory card
  449. },
  450. ValueConv => '$val / 100',
  451. ValueConvInv => '$val * 100',
  452. PrintConv => sub { # convert to format "[DD days ]HH:MM:SS.ss"
  453. my $val = shift;
  454. my $str = '';
  455. if ($val >= 24 * 3600) {
  456. my $d = int($val / (24 * 3600));
  457. $str .= "$d days ";
  458. $val -= $d * 24 * 3600;
  459. }
  460. my $h = int($val / 3600);
  461. $val -= $h * 3600;
  462. my $m = int($val / 60);
  463. $val -= $m * 60;
  464. my $s = int($val);
  465. my $f = 100 * ($val - int($val));
  466. return sprintf("%s%.2d:%.2d:%.2d.%.2d",$str,$h,$m,$s,$f);
  467. },
  468. PrintConvInv => sub {
  469. my $val = shift;
  470. my @vals = ($val =~ /\d+(?:\.\d*)?/g);
  471. my $sec = 0;
  472. $sec += 24 * 3600 * shift(@vals) if @vals > 3;
  473. $sec += 3600 * shift(@vals) if @vals > 2;
  474. $sec += 60 * shift(@vals) if @vals > 1;
  475. $sec += shift(@vals) if @vals;
  476. return $sec;
  477. },
  478. },
  479. 0x2a => { #4
  480. Name => 'BurstMode',
  481. Writable => 'int16u',
  482. Notes => 'decoding may be different for some models',
  483. PrintConv => {
  484. 0 => 'Off',
  485. 1 => 'On', #PH (TZ5) [was "Low/High Quality" from ref 4]
  486. 2 => 'Auto Exposure Bracketing (AEB)', #17
  487. 4 => 'Unlimited', #PH (TZ5)
  488. 8 => 'White Balance Bracketing', #18
  489. 17 => 'On (with flash)', #forum5597
  490. },
  491. },
  492. 0x2b => { #4
  493. Name => 'SequenceNumber',
  494. Writable => 'int32u',
  495. },
  496. 0x2c => [
  497. {
  498. Name => 'ContrastMode',
  499. Condition => '$$self{Model} !~ /^DMC-(FX10|G1|L1|L10|LC80|GF\d+|G2|TZ10|ZS7)$/',
  500. Flags => 'PrintHex',
  501. Writable => 'int16u',
  502. Notes => q{
  503. this decoding seems to work for some models such as the LC1, LX2, FZ7, FZ8,
  504. FZ18 and FZ50, but may not be correct for other models such as the FX10, G1, L1,
  505. L10 and LC80
  506. },
  507. PrintConv => {
  508. 0x00 => 'Normal',
  509. 0x01 => 'Low',
  510. 0x02 => 'High',
  511. # 0x03 - observed with LZ6 and TZ5 in Fireworks mode
  512. # and GX7 in Fantasy/Retro/OldDays/HighKey - PH
  513. # 0x04 - observed in MP4 movie with GM1 (EXIF and 0x39 Contrast "Normal") - PH
  514. # 0x05 - observed with FX01, FX40 and FP8 (EXIF contrast "Normal") - PH
  515. 0x06 => 'Medium Low', #PH (FZ18)
  516. 0x07 => 'Medium High', #PH (FZ18)
  517. # 0x08 - GX7 in DynamicMonochrome mode
  518. 0x0d => 'High Dynamic', #PH (FZ47 in ?)
  519. # 0x13 - seen for LX100 (PH)
  520. # DMC-LC1 values:
  521. 0x100 => 'Low',
  522. 0x110 => 'Normal',
  523. 0x120 => 'High',
  524. }
  525. },{
  526. Name => 'ContrastMode',
  527. Condition => '$$self{Model} =~ /^DMC-(GF\d+|G2)$/',
  528. Notes => 'these values are used by the G2, GF1, GF2, GF3, GF5 and GF6',
  529. Writable => 'int16u',
  530. PrintConv => { # (decoded for GF1 unless otherwise noted)
  531. 0 => '-2',
  532. 1 => '-1',
  533. 2 => 'Normal',
  534. 3 => '+1',
  535. 4 => '+2',
  536. # Note: Other Contrast tags will be "Normal" in any of these modes:
  537. 5 => 'Normal 2', # 5 - seen for Portrait (FX80) and Normal (GF6)
  538. 7 => 'Nature (Color Film)', # (GF1,G2; GF3 "Miniature")
  539. 9 => 'Expressive', #(GF3)
  540. 12 => 'Smooth (Color Film) or Pure (My Color)', #(GF1,G2 "Smooth Color")
  541. 17 => 'Dynamic (B&W Film)', #(GF1,G2)
  542. 22 => 'Smooth (B&W Film)', #(GF1,G2)
  543. 25 => 'High Dynamic', #(GF5)
  544. 26 => 'Retro', #(GF5)
  545. 27 => 'Dynamic (Color Film)', #(GF1,G2) (GF3 "High Key")
  546. 28 => 'Low Key', #(GF5)
  547. 29 => 'Toy Effect', #(GF5)
  548. 32 => 'Vibrant (Color Film) or Expressive (My Color)', # (GF1; G2 "Vibrant"; GF2,GF5 "Expressive")
  549. 33 => 'Elegant (My Color)',
  550. 37 => 'Nostalgic (Color Film)', # (GF1,G2; GF5 "Sepia")
  551. 41 => 'Dynamic Art (My Color)', # (GF5 "High Key")
  552. 42 => 'Retro (My Color)',
  553. 45 => 'Cinema', #(GF2)
  554. 47 => 'Dynamic Mono', #(GF5)
  555. 50 => 'Impressive Art', #(GF5)
  556. 51 => 'Cross Process', #(GF5)
  557. 100 => 'High Dynamic 2', #Exiv2 (G6)
  558. 101 => 'Retro 2', #Exiv2 (G6)
  559. 102 => 'High Key 2', #Exiv2 (G6)
  560. 103 => 'Low Key 2', #Exiv2 (G6)
  561. 104 => 'Toy Effect 2', #Exiv2 (G6)
  562. 107 => 'Expressive 2', #(GF6)
  563. 112 => 'Sepia', #Exiv2 (G6)
  564. 117 => 'Miniature', #Exiv2 (G6)
  565. 122 => 'Dynamic Monochrome', #(GF6)
  566. 127 => 'Old Days', #Exiv2 (G6)
  567. 132 => 'Dynamic Monochrome 2', #Exiv2 (G6)
  568. 135 => 'Impressive Art 2', #Exiv2 (G6)
  569. 136 => 'Cross Process 2', #Exiv2 (G6)
  570. 137 => 'Toy Pop', #Exiv2 (G6)
  571. 138 => 'Fantasy', #Exiv2 (G6)
  572. 256 => 'Normal 3', #Exiv2 (G6)
  573. 272 => 'Standard', #Exiv2 (G6)
  574. 288 => 'High', #Exiv2 (G6)
  575. # more new modes for GF6:
  576. # ? => 'Old Days',
  577. # ? => 'Toy Pop',
  578. # ? => 'Bleach Bypass',
  579. # ? => 'Fantasy',
  580. # ? => 'Star Filter',
  581. # ? => 'One Point Color',
  582. # ? => 'Sunshine',
  583. },
  584. },{
  585. Name => 'ContrastMode',
  586. Condition => '$$self{Model} =~ /^DMC-(TZ10|ZS7)$/',
  587. Notes => 'these values are used by the TZ10 and ZS7',
  588. Writable => 'int16u',
  589. PrintConv => {
  590. 0 => 'Normal',
  591. 1 => '-2',
  592. 2 => '+2',
  593. 5 => '-1',
  594. 6 => '+1',
  595. },
  596. },{
  597. Name => 'ContrastMode',
  598. Writable => 'int16u',
  599. },
  600. ],
  601. 0x2d => {
  602. Name => 'NoiseReduction',
  603. Writable => 'int16u',
  604. PrintConv => {
  605. 0 => 'Standard',
  606. 1 => 'Low (-1)',
  607. 2 => 'High (+1)',
  608. 3 => 'Lowest (-2)', #JD
  609. 4 => 'Highest (+2)', #JD
  610. # 65531 - seen for LX100 "NR1" test shots at imaging-resource (PH)
  611. },
  612. },
  613. 0x2e => { #4
  614. Name => 'SelfTimer',
  615. Writable => 'int16u',
  616. PrintConv => {
  617. 1 => 'Off',
  618. 2 => '10 s',
  619. 3 => '2 s',
  620. 4 => '10 s / 3 pictures', #17
  621. },
  622. },
  623. # 0x2f - values: 1 (LZ6,FX10K)
  624. 0x30 => { #7
  625. Name => 'Rotation',
  626. Writable => 'int16u',
  627. PrintConv => {
  628. 1 => 'Horizontal (normal)',
  629. 3 => 'Rotate 180', #PH
  630. 6 => 'Rotate 90 CW', #PH (ref 7 gives 270 CW)
  631. 8 => 'Rotate 270 CW', #PH (ref 7 gives 90 CW)
  632. },
  633. },
  634. 0x31 => { #PH (FS7)
  635. Name => 'AFAssistLamp',
  636. Writable => 'int16u',
  637. PrintConv => {
  638. 1 => 'Fired',
  639. 2 => 'Enabled but Not Used',
  640. 3 => 'Disabled but Required',
  641. 4 => 'Disabled and Not Required',
  642. # have seen a value of 5 - PH
  643. # values possibly related to FOC-L? - JD
  644. },
  645. },
  646. 0x32 => { #7
  647. Name => 'ColorMode',
  648. Writable => 'int16u',
  649. PrintConv => {
  650. 0 => 'Normal',
  651. 1 => 'Natural',
  652. 2 => 'Vivid',
  653. # have seen 3 for GF2 - PH
  654. },
  655. },
  656. 0x33 => { #JD
  657. Name => 'BabyAge',
  658. Writable => 'string',
  659. Notes => 'or pet age', #PH
  660. PrintConv => '$val eq "9999:99:99 00:00:00" ? "(not set)" : $val',
  661. PrintConvInv => '$val =~ /^\d/ ? $val : "9999:99:99 00:00:00"',
  662. },
  663. 0x34 => { #7/PH
  664. Name => 'OpticalZoomMode',
  665. Writable => 'int16u',
  666. PrintConv => {
  667. 1 => 'Standard',
  668. 2 => 'Extended',
  669. },
  670. },
  671. 0x35 => { #9
  672. Name => 'ConversionLens',
  673. Writable => 'int16u',
  674. PrintConv => { #PH (unconfirmed)
  675. 1 => 'Off',
  676. 2 => 'Wide',
  677. 3 => 'Telephoto',
  678. 4 => 'Macro',
  679. },
  680. },
  681. 0x36 => { #8
  682. Name => 'TravelDay',
  683. Writable => 'int16u',
  684. PrintConv => '$val == 65535 ? "n/a" : $val',
  685. PrintConvInv => '$val =~ /(\d+)/ ? $1 : $val',
  686. },
  687. # 0x37 - values: 0,1,2 (LZ6, 0 for movie preview); 257 (FX10K); 0,256 (TZ5, 0 for movie preview)
  688. # 0x38 - values: 0,1,2 (LZ6, same as 0x37); 1,2 (FX10K); 0,256 (TZ5, 0 for movie preview)
  689. 0x39 => { #7 (L1/L10)
  690. Name => 'Contrast',
  691. Format => 'int16s',
  692. Writable => 'int16u',
  693. %Image::ExifTool::Exif::printParameter,
  694. },
  695. 0x3a => {
  696. Name => 'WorldTimeLocation',
  697. Writable => 'int16u',
  698. PrintConv => {
  699. 1 => 'Home',
  700. 2 => 'Destination',
  701. },
  702. },
  703. 0x3b => { #PH (TZ5/FS7)
  704. # (tags 0x3b, 0x3e, 0x8008 and 0x8009 have the same values in all my samples - PH)
  705. Name => 'TextStamp',
  706. Writable => 'int16u',
  707. PrintConv => { 1 => 'Off', 2 => 'On' },
  708. },
  709. 0x3c => { #PH
  710. Name => 'ProgramISO', # (maybe should rename this ISOSetting?)
  711. Writable => 'int16u',
  712. PrintConv => {
  713. OTHER => sub { shift },
  714. 65534 => 'Intelligent ISO', #PH (FS7)
  715. 65535 => 'n/a',
  716. },
  717. },
  718. 0x3d => { #PH
  719. Name => 'AdvancedSceneType',
  720. Writable => 'int16u',
  721. Notes => 'used together with SceneMode to derive Composite AdvancedSceneMode',
  722. },
  723. 0x3e => { #PH (TZ5/FS7)
  724. # (tags 0x3b, 0x3e, 0x8008 and 0x8009 have the same values in all my samples - PH)
  725. Name => 'TextStamp',
  726. Writable => 'int16u',
  727. PrintConv => { 1 => 'Off', 2 => 'On' },
  728. },
  729. 0x3f => { #PH (TZ7)
  730. Name => 'FacesDetected',
  731. Writable => 'int16u',
  732. },
  733. 0x40 => { #7 (L1/L10)
  734. Name => 'Saturation',
  735. Format => 'int16s',
  736. Writable => 'int16u',
  737. %Image::ExifTool::Exif::printParameter,
  738. },
  739. 0x41 => { #7 (L1/L10)
  740. Name => 'Sharpness',
  741. Format => 'int16s',
  742. Writable => 'int16u',
  743. %Image::ExifTool::Exif::printParameter,
  744. },
  745. 0x42 => { #7 (DMC-L1)
  746. Name => 'FilmMode',
  747. Writable => 'int16u',
  748. PrintConv => {
  749. 0 => 'n/a', #PH (eg. FZ100 "Photo Frame" ShootingMode)
  750. 1 => 'Standard (color)',
  751. 2 => 'Dynamic (color)',
  752. 3 => 'Nature (color)',
  753. 4 => 'Smooth (color)',
  754. 5 => 'Standard (B&W)',
  755. 6 => 'Dynamic (B&W)',
  756. 7 => 'Smooth (B&W)',
  757. # 8 => 'My Film 1'? (from owner manual)
  758. # 9 => 'My Film 2'?
  759. 10 => 'Nostalgic', #(GH1)
  760. 11 => 'Vibrant', #(GH1)
  761. # 12 => 'Multi Film'? (in the GH1 specs)
  762. },
  763. },
  764. # 0x43 - int16u: 2,3
  765. 0x44 => {
  766. Name => 'ColorTempKelvin',
  767. Format => 'int16u',
  768. },
  769. 0x45 => { #19
  770. Name => 'BracketSettings',
  771. Writable => 'int16u',
  772. PrintConv => {
  773. 0 => 'No Bracket',
  774. 1 => '3 Images, Sequence 0/-/+',
  775. 2 => '3 Images, Sequence -/0/+',
  776. 3 => '5 Images, Sequence 0/-/+',
  777. 4 => '5 Images, Sequence -/0/+',
  778. 5 => '7 Images, Sequence 0/-/+',
  779. 6 => '7 Images, Sequence -/0/+',
  780. },
  781. },
  782. 0x46 => { #PH/JD
  783. Name => 'WBShiftAB',
  784. Format => 'int16s',
  785. Writable => 'int16u',
  786. Notes => 'positive is a shift toward blue',
  787. },
  788. 0x47 => { #PH/JD
  789. Name => 'WBShiftGM',
  790. Format => 'int16s',
  791. Writable => 'int16u',
  792. Notes => 'positive is a shift toward green',
  793. },
  794. 0x48 => { #17
  795. Name => 'FlashCurtain',
  796. Writable => 'int16u',
  797. PrintConv => {
  798. 0 => 'n/a',
  799. 1 => '1st',
  800. 2 => '2nd',
  801. },
  802. },
  803. 0x49 => { #19
  804. Name => 'LongExposureNoiseReduction',
  805. Writable => 'int16u',
  806. PrintConv => {
  807. 1 => 'Off',
  808. 2 => 'On'
  809. }
  810. },
  811. # 0x4a - int16u: 0
  812. 0x4b => { #PH
  813. Name => 'PanasonicImageWidth',
  814. Writable => 'int32u',
  815. },
  816. 0x4c => { #PH
  817. Name => 'PanasonicImageHeight',
  818. Writable => 'int32u',
  819. },
  820. 0x4d => { #PH (FS7)
  821. Name => 'AFPointPosition',
  822. Writable => 'rational64u',
  823. Count => 2,
  824. Notes => 'X Y coordinates of primary AF area center, in the range 0.0 to 1.0',
  825. PrintConv => q{
  826. return 'none' if $val eq '16777216 16777216';
  827. my @a = split ' ', $val;
  828. sprintf("%.2g %.2g",@a);
  829. },
  830. PrintConvInv => '$val eq "none" ? "16777216 16777216" : $val',
  831. },
  832. 0x4e => { #PH
  833. Name => 'FaceDetInfo',
  834. PrintConv => 'length $val',
  835. SubDirectory => {
  836. TagTable => 'Image::ExifTool::Panasonic::FaceDetInfo',
  837. },
  838. },
  839. # 0x4f,0x50 - int16u: 0
  840. 0x51 => {
  841. Name => 'LensType',
  842. Writable => 'string',
  843. ValueConv => '$val=~s/ +$//; $val', # trim trailing spaces
  844. ValueConvInv => '$val',
  845. },
  846. 0x52 => { #7 (DMC-L1)
  847. Name => 'LensSerialNumber',
  848. Writable => 'string',
  849. ValueConv => '$val=~s/ +$//; $val', # trim trailing spaces
  850. ValueConvInv => '$val',
  851. },
  852. 0x53 => { #7 (DMC-L1)
  853. Name => 'AccessoryType',
  854. Writable => 'string',
  855. ValueConv => '$val=~s/ +$//; $val', # trim trailing spaces
  856. ValueConvInv => '$val',
  857. },
  858. 0x54 => { #19
  859. Name => 'AccessorySerialNumber',
  860. Writable => 'string',
  861. ValueConv => '$val=~s/ +$//; $val', # trim trailing spaces
  862. ValueConvInv => '$val',
  863. },
  864. # 0x55 - int16u: 1
  865. # 0x57 - int16u: 0
  866. 0x59 => { #PH (FS7)
  867. Name => 'Transform',
  868. Writable => 'undef',
  869. Notes => 'decoded as two 16-bit signed integers',
  870. Format => 'int16s',
  871. Count => 2,
  872. PrintConv => {
  873. '-3 2' => 'Slim High',
  874. '-1 1' => 'Slim Low',
  875. '0 0' => 'Off',
  876. '1 1' => 'Stretch Low',
  877. '3 2' => 'Stretch High',
  878. },
  879. },
  880. # 0x5a - int16u: 0,2
  881. # 0x5b - int16u: 0
  882. # 0x5c - int16u: 0,2
  883. 0x5d => { #PH (GF1, FZ35)
  884. Name => 'IntelligentExposure',
  885. Notes => 'not valid for some models', # (doesn't change in ZS7 and GH1 images)
  886. Writable => 'int16u',
  887. PrintConv => {
  888. 0 => 'Off',
  889. 1 => 'Low',
  890. 2 => 'Standard',
  891. 3 => 'High',
  892. },
  893. },
  894. # 0x5e,0x5f - undef[4]
  895. 0x60 => { #18
  896. Name => 'LensFirmwareVersion',
  897. Writable => 'undef',
  898. Format => 'int8u',
  899. Count => 4,
  900. PrintConv => '$val=~tr/ /./; $val',
  901. PrintConvInv => '$val=~tr/./ /; $val',
  902. },
  903. 0x61 => { #PH
  904. Name => 'FaceRecInfo',
  905. SubDirectory => {
  906. TagTable => 'Image::ExifTool::Panasonic::FaceRecInfo',
  907. },
  908. },
  909. 0x62 => { #PH (FS7)
  910. Name => 'FlashWarning',
  911. Writable => 'int16u',
  912. PrintConv => { 0 => 'No', 1 => 'Yes (flash required but disabled)' },
  913. },
  914. 0x63 => { #PH
  915. # not sure exactly what this means, but in my samples this is
  916. # FacesRecognized bytes of 0x01, padded with 0x00 to a length of 4 - PH
  917. Name => 'RecognizedFaceFlags',
  918. Format => 'int8u',
  919. Count => 4,
  920. Writable => 'undef',
  921. Unknown => 1,
  922. },
  923. 0x65 => { #15
  924. Name => 'Title',
  925. Format => 'string',
  926. Writable => 'undef', # (Count 64)
  927. },
  928. 0x66 => { #15
  929. Name => 'BabyName',
  930. Notes => 'or pet name',
  931. Format => 'string',
  932. Writable => 'undef', # (Count 64)
  933. },
  934. 0x67 => { #15
  935. Name => 'Location',
  936. Groups => { 2 => 'Location' },
  937. Format => 'string',
  938. Writable => 'undef', # (Count 64)
  939. },
  940. # 0x68 - int8u: 1
  941. 0x69 => { #PH (ZS7)
  942. Name => 'Country', # (Country/Region)
  943. Groups => { 2 => 'Location' },
  944. Format => 'string',
  945. Writable => 'undef', # (Count 72)
  946. },
  947. # 0x6a - int8u: 1
  948. 0x6b => { #PH (ZS7)
  949. Name => 'State', # (State/Province/Count -- what is Count?)
  950. Groups => { 2 => 'Location' },
  951. Format => 'string',
  952. Writable => 'undef', # (Count 72)
  953. },
  954. # 0x6c - int8u: 1
  955. 0x6d => { #PH (ZS7) (also see forum5997)
  956. Name => 'City', # (City/Town)
  957. Groups => { 2 => 'Location' },
  958. Format => 'string',
  959. Writable => 'undef', # (Count 72)
  960. Notes => 'City/Town as stored by some models, or County/Township for others',
  961. },
  962. # 0x6e - int8u: 1
  963. 0x6f => { #PH (ZS7)
  964. Name => 'Landmark', # (Landmark)
  965. Groups => { 2 => 'Location' },
  966. Format => 'string',
  967. Writable => 'undef', # (Count 128)
  968. },
  969. 0x70 => { #PH (ZS7)
  970. Name => 'IntelligentResolution',
  971. Writable => 'int8u',
  972. PrintConv => {
  973. 0 => 'Off',
  974. # Note: I think these values make sense for the GH2, but meanings
  975. # may be different for other models
  976. 1 => 'Low',
  977. 2 => 'Standard',
  978. 3 => 'High',
  979. 4 => 'Extended',
  980. },
  981. },
  982. # 0x71 - undef[128] (maybe text stamp text?)
  983. 0x77 => { #18
  984. Name => 'BurstSpeed',
  985. Writable => 'int16u',
  986. Notes => 'images per second',
  987. },
  988. # 0x72,0x73,0x74,0x75,0x77,0x78: 0
  989. # 0x76: 0, (3 for G6 with HDR on, ref 18)
  990. 0x79 => { #PH (GH2)
  991. Name => 'IntelligentD-Range',
  992. Writable => 'int16u',
  993. PrintConv => {
  994. 0 => 'Off',
  995. 1 => 'Low',
  996. 2 => 'Standard',
  997. 3 => 'High',
  998. },
  999. },
  1000. # 0x7a,0x7b: 0
  1001. 0x7c => { #18
  1002. Name => 'ClearRetouch',
  1003. Writable => 'int16u',
  1004. PrintConv => { 0 => 'Off', 1 => 'On' },
  1005. },
  1006. 0x80 => { #forum5997 (seen garbage here for SZ5 - PH)
  1007. Name => 'City2', # (City/Town/Village)
  1008. Groups => { 2 => 'Location' },
  1009. Format => 'string',
  1010. Writable => 'undef', # (Count 72)
  1011. Notes => 'City/Town/Village as stored by some models',
  1012. },
  1013. # 0x81 - undef[72]: "---"
  1014. # 0x82 - undef[72]: "---"
  1015. # 0x83 - undef[72]: "---"
  1016. # 0x84 - undef[72]: "---"
  1017. # 0x85 - undef[128]: "---"
  1018. 0x86 => { #http://dev.exiv2.org/issues/825
  1019. Name => 'ManometerPressure',
  1020. Writable => 'int16u',
  1021. RawConv => '$val==65535 ? undef : $val',
  1022. ValueConv => '$val / 10',
  1023. ValueConvInv => '$val * 10',
  1024. PrintConv => 'sprintf("%.1f kPa",$val)',
  1025. PrintConvInv => '$val=~s/ ?kPa//i; $val',
  1026. },
  1027. 0x89 => {
  1028. Name => 'PhotoStyle',
  1029. Writable => 'int16u',
  1030. PrintConv => {
  1031. 0 => 'Auto',
  1032. 1 => 'Standard or Custom',
  1033. 2 => 'Vivid',
  1034. 3 => 'Natural',
  1035. 4 => 'Monochrome',
  1036. 5 => 'Scenery',
  1037. 6 => 'Portrait',
  1038. },
  1039. },
  1040. 0x8a => { #18
  1041. Name => 'ShadingCompensation',
  1042. Writable => 'int16u',
  1043. PrintConv => {
  1044. 0 => 'Off',
  1045. 1 => 'On'
  1046. }
  1047. },
  1048. 0x8c => {
  1049. Name => 'AccelerometerZ',
  1050. Writable => 'int16u',
  1051. Format => 'int16s',
  1052. Notes => 'positive is acceleration upwards',
  1053. },
  1054. 0x8d => {
  1055. Name => 'AccelerometerX',
  1056. Writable => 'int16u',
  1057. Format => 'int16s',
  1058. Notes => 'positive is acceleration to the left',
  1059. },
  1060. 0x8e => {
  1061. Name => 'AccelerometerY',
  1062. Writable => 'int16u',
  1063. Format => 'int16s',
  1064. Notes => 'positive is acceleration backwards',
  1065. },
  1066. 0x8f => { #18
  1067. Name => 'CameraOrientation',
  1068. Writable => 'int8u',
  1069. PrintConv => {
  1070. 0 => 'Normal',
  1071. 1 => 'Rotate CW',
  1072. 2 => 'Rotate 180',
  1073. 3 => 'Rotate CCW',
  1074. 4 => 'Tilt Upwards',
  1075. 5 => 'Tilt Downwards'
  1076. }
  1077. },
  1078. 0x90 => {
  1079. Name => 'RollAngle',
  1080. Writable => 'int16u',
  1081. Format => 'int16s',
  1082. Notes => 'converted to degrees of clockwise camera rotation',
  1083. ValueConv => '$val / 10',
  1084. ValueConvInv => '$val * 10',
  1085. },
  1086. 0x91 => {
  1087. Name => 'PitchAngle',
  1088. Writable => 'int16u',
  1089. Format => 'int16s',
  1090. Notes => 'converted to degrees of upward camera tilt',
  1091. ValueConv => '-$val / 10',
  1092. ValueConvInv => '-$val * 10',
  1093. },
  1094. 0x93 => { #18
  1095. Name => 'SweepPanoramaDirection',
  1096. Writable => 'int8u',
  1097. PrintConv => {
  1098. 0 => 'Off',
  1099. 1 => 'Left to Right',
  1100. 2 => 'Right to Left',
  1101. 3 => 'Top to Bottom',
  1102. 4 => 'Bottom to Top'
  1103. }
  1104. },
  1105. 0x94 => { #18
  1106. Name => 'SweepPanoramaFieldOfView',
  1107. Writable => 'int16u'
  1108. },
  1109. 0x96 => { #18
  1110. Name => 'TimerRecording',
  1111. Writable => 'int8u',
  1112. PrintConv => {
  1113. 0 => 'Off',
  1114. 1 => 'Time Lapse',
  1115. 2 => 'Stop-motion Animation',
  1116. },
  1117. },
  1118. 0x9d => { #18
  1119. Name => 'InternalNDFilter',
  1120. Writable => 'rational64u'
  1121. },
  1122. 0x9e => { #18
  1123. Name => 'HDR',
  1124. Writable => 'int16u',
  1125. PrintConv => {
  1126. 0 => 'Off',
  1127. 100 => '1 EV',
  1128. 200 => '2 EV',
  1129. 300 => '3 EV',
  1130. 32868 => '1 EV (Auto)',
  1131. 32968 => '2 EV (Auto)',
  1132. 33068 => '3 EV (Auto)',
  1133. },
  1134. },
  1135. 0x9f => { #18
  1136. Name => 'ShutterType',
  1137. Writable => 'int16u',
  1138. PrintConv => {
  1139. 0 => 'Mechanical',
  1140. 1 => 'Electronic',
  1141. 2 => 'Hybrid', #PH (GM1, 1st curtain electronic, 2nd curtain mechanical)
  1142. },
  1143. },
  1144. 0xa3 => { #18
  1145. Name => 'ClearRetouchValue',
  1146. Writable => 'rational64u',
  1147. # undef if ClearRetouch is off, 0 if it is on
  1148. },
  1149. 0xab => { #18
  1150. Name => 'TouchAE',
  1151. Writable => 'int16u',
  1152. PrintConv => { 0 => 'Off', 1 => 'On' },
  1153. },
  1154. 0x0e00 => {
  1155. Name => 'PrintIM',
  1156. Description => 'Print Image Matching',
  1157. Writable => 0,
  1158. SubDirectory => {
  1159. TagTable => 'Image::ExifTool::PrintIM::Main',
  1160. },
  1161. },
  1162. 0x8000 => { #PH
  1163. Name => 'MakerNoteVersion',
  1164. Format => 'undef',
  1165. },
  1166. 0x8001 => { #7/PH/JD
  1167. Name => 'SceneMode',
  1168. Writable => 'int16u',
  1169. PrintConvColumns => 2,
  1170. PrintConv => {
  1171. 0 => 'Off',
  1172. %shootingMode,
  1173. },
  1174. },
  1175. # 0x8002 - values: 1,2 related to focus? (PH/JD)
  1176. # 1 for HDR modes, 2 for Portrait (ref 12)
  1177. # 0x8003 - values: 1,2 related to focus? (PH/JD)
  1178. 0x8004 => { #PH/JD
  1179. Name => 'WBRedLevel',
  1180. Writable => 'int16u',
  1181. },
  1182. 0x8005 => { #PH/JD
  1183. Name => 'WBGreenLevel',
  1184. Writable => 'int16u',
  1185. },
  1186. 0x8006 => { #PH/JD
  1187. Name => 'WBBlueLevel',
  1188. Writable => 'int16u',
  1189. },
  1190. 0x8007 => { #PH
  1191. Name => 'FlashFired',
  1192. Writable => 'int16u',
  1193. PrintConv => { 1 => 'No', 2 => 'Yes' },
  1194. },
  1195. 0x8008 => { #PH (TZ5/FS7)
  1196. # (tags 0x3b, 0x3e, 0x8008 and 0x8009 have the same values in all my samples - PH)
  1197. Name => 'TextStamp',
  1198. Writable => 'int16u',
  1199. PrintConv => { 1 => 'Off', 2 => 'On' },
  1200. },
  1201. 0x8009 => { #PH (TZ5/FS7)
  1202. # (tags 0x3b, 0x3e, 0x8008 and 0x8009 have the same values in all my samples - PH)
  1203. Name => 'TextStamp',
  1204. Writable => 'int16u',
  1205. PrintConv => { 1 => 'Off', 2 => 'On' },
  1206. },
  1207. 0x8010 => { #PH
  1208. Name => 'BabyAge',
  1209. Writable => 'string',
  1210. Notes => 'or pet age',
  1211. PrintConv => '$val eq "9999:99:99 00:00:00" ? "(not set)" : $val',
  1212. PrintConvInv => '$val =~ /^\d/ ? $val : "9999:99:99 00:00:00"',
  1213. },
  1214. 0x8012 => { #PH (FS7)
  1215. Name => 'Transform',
  1216. Writable => 'undef',
  1217. Notes => 'decoded as two 16-bit signed integers',
  1218. Format => 'int16s',
  1219. Count => 2,
  1220. PrintConv => {
  1221. '-3 2' => 'Slim High',
  1222. '-1 1' => 'Slim Low',
  1223. '0 0' => 'Off',
  1224. '1 1' => 'Stretch Low',
  1225. '3 2' => 'Stretch High',
  1226. },
  1227. },
  1228. );
  1229. # Leica type2 maker notes (ref 10)
  1230. %Image::ExifTool::Panasonic::Leica2 = (
  1231. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1232. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1233. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1234. WRITABLE => 1,
  1235. NOTES => 'These tags are used by the Leica M8.',
  1236. 0x300 => {
  1237. Name => 'Quality',
  1238. Writable => 'int16u',
  1239. PrintConv => {
  1240. 1 => 'Fine',
  1241. 2 => 'Basic',
  1242. },
  1243. },
  1244. 0x302 => {
  1245. Name => 'UserProfile',
  1246. Writable => 'int32u',
  1247. PrintConv => {
  1248. 1 => 'User Profile 1',
  1249. 2 => 'User Profile 2',
  1250. 3 => 'User Profile 3',
  1251. 4 => 'User Profile 0 (Dynamic)',
  1252. },
  1253. },
  1254. 0x303 => {
  1255. Name => 'SerialNumber',
  1256. Writable => 'int32u',
  1257. PrintConv => 'sprintf("%.7d", $val)',
  1258. PrintConvInv => '$val',
  1259. },
  1260. 0x304 => {
  1261. Name => 'WhiteBalance',
  1262. Writable => 'int16u',
  1263. Notes => 'values above 0x8000 are converted to Kelvin color temperatures',
  1264. PrintConv => {
  1265. 0 => 'Auto or Manual',
  1266. 1 => 'Daylight',
  1267. 2 => 'Fluorescent',
  1268. 3 => 'Tungsten',
  1269. 4 => 'Flash',
  1270. 10 => 'Cloudy',
  1271. 11 => 'Shade',
  1272. OTHER => \&WhiteBalanceConv,
  1273. },
  1274. },
  1275. 0x310 => {
  1276. Name => 'LensType',
  1277. Writable => 'int32u',
  1278. SeparateTable => 1,
  1279. ValueConv => '($val >> 2) . " " . ($val & 0x3)',
  1280. ValueConvInv => \&LensTypeConvInv,
  1281. PrintConv => \%leicaLensTypes,
  1282. },
  1283. 0x311 => {
  1284. Name => 'ExternalSensorBrightnessValue',
  1285. Format => 'rational64s', # (incorrectly unsigned in JPEG images)
  1286. Writable => 'rational64s',
  1287. Notes => '"blue dot" measurement',
  1288. PrintConv => 'sprintf("%.2f", $val)',
  1289. PrintConvInv => '$val',
  1290. },
  1291. 0x312 => {
  1292. Name => 'MeasuredLV',
  1293. Format => 'rational64s', # (incorrectly unsigned in JPEG images)
  1294. Writable => 'rational64s',
  1295. Notes => 'imaging sensor or TTL exposure meter measurement',
  1296. PrintConv => 'sprintf("%.2f", $val)',
  1297. PrintConvInv => '$val',
  1298. },
  1299. 0x313 => {
  1300. Name => 'ApproximateFNumber',
  1301. Writable => 'rational64u',
  1302. PrintConv => 'sprintf("%.1f", $val)',
  1303. PrintConvInv => '$val',
  1304. },
  1305. 0x320 => {
  1306. Name => 'CameraTemperature',
  1307. Writable => 'int32s',
  1308. PrintConv => '"$val C"',
  1309. PrintConvInv => '$val=~s/ ?C//; $val',
  1310. },
  1311. 0x321 => { Name => 'ColorTemperature', Writable => 'int32u' },
  1312. 0x322 => { Name => 'WBRedLevel', Writable => 'rational64u' },
  1313. 0x323 => { Name => 'WBGreenLevel', Writable => 'rational64u' },
  1314. 0x324 => { Name => 'WBBlueLevel', Writable => 'rational64u' },
  1315. 0x325 => {
  1316. Name => 'UV-IRFilterCorrection',
  1317. Description => 'UV/IR Filter Correction',
  1318. Writable => 'int32u',
  1319. PrintConv => {
  1320. 0 => 'Not Active',
  1321. 1 => 'Active',
  1322. },
  1323. },
  1324. 0x330 => { Name => 'CCDVersion', Writable => 'int32u' },
  1325. 0x331 => { Name => 'CCDBoardVersion', Writable => 'int32u' },
  1326. 0x332 => { Name => 'ControllerBoardVersion', Writable => 'int32u' },
  1327. 0x333 => { Name => 'M16CVersion', Writable => 'int32u' },
  1328. 0x340 => { Name => 'ImageIDNumber', Writable => 'int32u' },
  1329. );
  1330. # Leica type3 maker notes (ref PH)
  1331. %Image::ExifTool::Panasonic::Leica3 = (
  1332. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1333. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1334. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1335. WRITABLE => 1,
  1336. NOTES => 'These tags are used by the Leica R8 and R9 digital backs.',
  1337. 0x0d => {
  1338. Name => 'WB_RGBLevels',
  1339. Writable => 'int16u',
  1340. Count => 3,
  1341. },
  1342. );
  1343. # Leica type4 maker notes (ref PH) (M9)
  1344. %Image::ExifTool::Panasonic::Leica4 = (
  1345. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1346. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1347. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1348. WRITABLE => 1,
  1349. NOTES => 'This information is written by the M9.',
  1350. 0x3000 => {
  1351. Name => 'Subdir3000',
  1352. SubDirectory => {
  1353. TagTable => 'Image::ExifTool::Panasonic::Subdir',
  1354. ByteOrder => 'Unknown',
  1355. },
  1356. },
  1357. 0x3100 => {
  1358. Name => 'Subdir3100',
  1359. SubDirectory => {
  1360. TagTable => 'Image::ExifTool::Panasonic::Subdir',
  1361. ByteOrder => 'Unknown',
  1362. },
  1363. },
  1364. 0x3400 => {
  1365. Name => 'Subdir3400',
  1366. SubDirectory => {
  1367. TagTable => 'Image::ExifTool::Panasonic::Subdir',
  1368. ByteOrder => 'Unknown',
  1369. },
  1370. },
  1371. 0x3900 => {
  1372. Name => 'Subdir3900',
  1373. SubDirectory => {
  1374. TagTable => 'Image::ExifTool::Panasonic::Subdir',
  1375. ByteOrder => 'Unknown',
  1376. },
  1377. },
  1378. );
  1379. # Leica M9 SubDirectory tags (ref PH)
  1380. %Image::ExifTool::Panasonic::Subdir = (
  1381. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1382. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1383. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1384. TAG_PREFIX => 'Leica_Subdir',
  1385. WRITABLE => 1,
  1386. # 0x3001 - normally 0 but value of 2 when manual coding is used
  1387. # with a coded lens (but only tested with Elmar-M 50mm f/2.8) - PH
  1388. 0x300a => {
  1389. Name => 'Contrast',
  1390. Writable => 'int32u',
  1391. PrintConv => {
  1392. 0 => 'Low',
  1393. 1 => 'Medium Low',
  1394. 2 => 'Normal',
  1395. 3 => 'Medium High',
  1396. 4 => 'High',
  1397. },
  1398. },
  1399. 0x300b => {
  1400. Name => 'Sharpening',
  1401. Writable => 'int32u',
  1402. PrintConv => {
  1403. 0 => 'Off',
  1404. 1 => 'Low',
  1405. 2 => 'Normal',
  1406. 3 => 'Medium High',
  1407. 4 => 'High',
  1408. },
  1409. },
  1410. 0x300d => {
  1411. Name => 'Saturation',
  1412. Writable => 'int32u',
  1413. PrintConv => {
  1414. 0 => 'Low',
  1415. 1 => 'Medium Low',
  1416. 2 => 'Normal',
  1417. 3 => 'Medium High',
  1418. 4 => 'High',
  1419. 5 => 'Black & White',
  1420. 6 => 'Vintage B&W',
  1421. },
  1422. },
  1423. # 0x3032 - some sort of RGB coefficients? (zeros unless Kelvin WB, but same for all Color Temps)
  1424. 0x3033 => {
  1425. Name => 'WhiteBalance',
  1426. Writable => 'int32u',
  1427. PrintConv => { #13
  1428. 0 => 'Auto',
  1429. 1 => 'Tungsten',
  1430. 2 => 'Fluorescent',
  1431. 3 => 'Daylight Fluorescent',
  1432. 4 => 'Daylight',
  1433. 5 => 'Flash',
  1434. 6 => 'Cloudy',
  1435. 7 => 'Shade',
  1436. 8 => 'Manual',
  1437. 9 => 'Kelvin',
  1438. },
  1439. },
  1440. 0x3034 => {
  1441. Name => 'JPEGQuality',
  1442. Writable => 'int32u',
  1443. PrintConv => {
  1444. 94 => 'Basic',
  1445. 97 => 'Fine',
  1446. },
  1447. },
  1448. # 0x3035 (int32u): -1 unless Manual WB (2 in my Manual sample)
  1449. 0x3036 => {
  1450. Name => 'WB_RGBLevels',
  1451. Writable => 'rational64u',
  1452. Count => 3,
  1453. },
  1454. 0x3038 => {
  1455. Name => 'UserProfile', # (CameraProfile according to ref 14)
  1456. Writable => 'string',
  1457. },
  1458. 0x303a => {
  1459. Name => 'JPEGSize',
  1460. Writable => 'int32u',
  1461. PrintConv => {
  1462. 0 => '5216x3472',
  1463. 1 => '3840x2592',
  1464. 2 => '2592x1728',
  1465. 3 => '1728x1152',
  1466. 4 => '1280x864',
  1467. },
  1468. },
  1469. 0x3103 => { #13 (valid for FW 1.116 and later)
  1470. Name => 'SerialNumber',
  1471. Writable => 'string',
  1472. },
  1473. # 0x3104 body-dependent string ("00012905000000") (not serial number)
  1474. # 0x3105 body-dependent string ("00012905000000")
  1475. # 0x3107 - body-dependent string ("4H205800116800") (not serial number)
  1476. 0x3109 => {
  1477. Name => 'FirmwareVersion',
  1478. Writable => 'string',
  1479. },
  1480. 0x312a => { #14 (NC)
  1481. Name => 'BaseISO',
  1482. Writable => 'int32u',
  1483. },
  1484. 0x312b => {
  1485. Name => 'SensorWidth',
  1486. Writable => 'int32u',
  1487. },
  1488. 0x312c => {
  1489. Name => 'SensorHeight',
  1490. Writable => 'int32u',
  1491. },
  1492. 0x312d => { #14 (NC)
  1493. Name => 'SensorBitDepth',
  1494. Writable => 'int32u',
  1495. },
  1496. 0x3402 => { #PH/13
  1497. Name => 'CameraTemperature',
  1498. Writable => 'int32s',
  1499. PrintConv => '"$val C"',
  1500. PrintConvInv => '$val=~s/ ?C//; $val',
  1501. },
  1502. 0x3405 => {
  1503. Name => 'LensType',
  1504. Writable => 'int32u',
  1505. SeparateTable => 1,
  1506. ValueConv => '($val >> 2) . " " . ($val & 0x3)',
  1507. ValueConvInv => \&LensTypeConvInv,
  1508. PrintConv => \%leicaLensTypes,
  1509. },
  1510. 0x3406 => { #PH/13
  1511. Name => 'ApproximateFNumber',
  1512. Writable => 'rational64u',
  1513. PrintConv => 'sprintf("%.1f", $val)',
  1514. PrintConvInv => '$val',
  1515. },
  1516. 0x3407 => { #14
  1517. Name => 'MeasuredLV',
  1518. Writable => 'int32s',
  1519. Notes => 'imaging sensor or TTL exposure meter measurement',
  1520. ValueConv => '$val / 1e5', #PH (NC)
  1521. ValueConvInv => '$val * 1e5', #PH (NC)
  1522. PrintConv => 'sprintf("%.2f", $val)',
  1523. PrintConvInv => '$val',
  1524. },
  1525. 0x3408 => { #14
  1526. Name => 'ExternalSensorBrightnessValue',
  1527. Writable => 'int32s',
  1528. Notes => '"blue dot" measurement',
  1529. ValueConv => '$val / 1e5', #PH (NC)
  1530. ValueConvInv => '$val * 1e5', #PH (NC)
  1531. PrintConv => 'sprintf("%.2f", $val)',
  1532. PrintConvInv => '$val',
  1533. },
  1534. 0x3901 => {
  1535. Name => 'Data1',
  1536. SubDirectory => { TagTable => 'Image::ExifTool::Panasonic::Data1' },
  1537. },
  1538. 0x3902 => {
  1539. Name => 'Data2',
  1540. SubDirectory => { TagTable => 'Image::ExifTool::Panasonic::Data2' },
  1541. },
  1542. # 0x3903 - larger binary data block
  1543. );
  1544. %Image::ExifTool::Panasonic::Data1 = (
  1545. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1546. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  1547. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  1548. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1549. WRITABLE => 1,
  1550. TAG_PREFIX => 'Leica_Data1',
  1551. FIRST_ENTRY => 0,
  1552. 0x0016 => {
  1553. Name => 'LensType',
  1554. Writable => 'int32u',
  1555. Priority => 0,
  1556. SeparateTable => 1,
  1557. ValueConv => '($val >> 2) . " " . ($val & 0x3)',
  1558. ValueConvInv => \&LensTypeConvInv,
  1559. PrintConv => \%leicaLensTypes,
  1560. },
  1561. );
  1562. %Image::ExifTool::Panasonic::Data2 = (
  1563. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1564. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1565. TAG_PREFIX => 'Leica_Data2',
  1566. FIRST_ENTRY => 0,
  1567. );
  1568. # Leica type5 maker notes (ref PH) (X1)
  1569. %Image::ExifTool::Panasonic::Leica5 = (
  1570. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1571. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1572. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1573. WRITABLE => 1,
  1574. PRIORITY => 0,
  1575. NOTES => 'This information is written by the X1, X2, X VARIO and T.',
  1576. 0x0303 => {
  1577. Name => 'LensModel',
  1578. Condition => '$format eq "string"',
  1579. Notes => 'Leica T only',
  1580. Writable => 'string',
  1581. },
  1582. # 0x0406 - saturation or sharpness
  1583. 0x0407 => { Name => 'OriginalFileName', Writable => 'string' },
  1584. 0x0408 => { Name => 'OriginalDirectory',Writable => 'string' },
  1585. # 0x040b - related to white balance
  1586. 0x040d => {
  1587. Name => 'ExposureMode',
  1588. Format => 'int8u',
  1589. Count => 4,
  1590. PrintConv => {
  1591. '0 0 0 0' => 'Program AE',
  1592. # '0 1 0 0' - seen for X (Typ 113) - PH
  1593. '1 0 0 0' => 'Aperture-priority AE',
  1594. '1 1 0 0' => 'Aperture-priority AE (1)', # (see for Leica T)
  1595. '2 0 0 0' => 'Shutter speed priority AE', #(guess)
  1596. '3 0 0 0' => 'Manual',
  1597. },
  1598. },
  1599. 0x0410 => {
  1600. Name => 'ShotInfo',
  1601. SubDirectory => { TagTable => 'Image::ExifTool::Panasonic::ShotInfo' },
  1602. },
  1603. # 0x0410 - int8u[16]: first byte is FileNumber
  1604. # 0x0411 - int8u[4]: first number is FilmMode (1=Standard,2=Vivid,3=Natural,4=BW Natural,5=BW High Contrast)
  1605. 0x0412 => { Name => 'FilmMode', Writable => 'string' },
  1606. 0x0413 => { Name => 'WB_RGBLevels', Writable => 'rational64u', Count => 3 },
  1607. );
  1608. # Leica type5 ShotInfo (ref PH) (X2)
  1609. %Image::ExifTool::Panasonic::ShotInfo = (
  1610. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1611. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  1612. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  1613. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1614. TAG_PREFIX => 'Leica_ShotInfo',
  1615. FIRST_ENTRY => 0,
  1616. WRITABLE => 1,
  1617. 0 => {
  1618. Name => 'FileIndex',
  1619. Format => 'int16u',
  1620. },
  1621. );
  1622. # Leica type6 maker notes (ref PH) (S2)
  1623. %Image::ExifTool::Panasonic::Leica6 = (
  1624. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1625. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1626. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1627. NOTES => q{
  1628. This information is written by the S2 and M (Typ 240), as a trailer in JPEG
  1629. images.
  1630. },
  1631. 0x300 => {
  1632. Name => 'PreviewImage',
  1633. Groups => { 2 => 'Preview' },
  1634. Writable => 'undef',
  1635. Notes => 'S2 and M (Typ 240)',
  1636. DataTag => 'PreviewImage',
  1637. RawConv => q{
  1638. return \$val if $val =~ /^Binary/;
  1639. return \$val if $val =~ /^\xff\xd8\xff/;
  1640. $$self{PreviewError} = 1 unless $val eq 'none';
  1641. return undef;
  1642. },
  1643. ValueConvInv => '$val || "none"',
  1644. WriteCheck => 'return $val=~/^(none|\xff\xd8\xff)/s ? undef : "Not a valid image"',
  1645. ChangeBase => '$dirStart + $dataPos - 8',
  1646. },
  1647. 0x301 => {
  1648. Name => 'UnknownBlock',
  1649. Notes => 'unknown 320kB block, not copied to JPEG images',
  1650. Flags => [ 'Unknown', 'Binary', 'Drop' ],
  1651. },
  1652. # 0x302 - same value as 4 unknown bytes at the end of JPEG or after the DNG TIFF header
  1653. 0x303 => {
  1654. Name => 'LensType',
  1655. Writable => 'string',
  1656. ValueConv => '$val=~s/ +$//; $val', # trim trailing spaces
  1657. ValueConvInv => '$val',
  1658. },
  1659. # 0x340 - same as 0x302
  1660. );
  1661. # Leica type9 maker notes (ref PH) (S)
  1662. %Image::ExifTool::Panasonic::Leica9 = (
  1663. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1664. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1665. GROUPS => { 0 => 'MakerNotes', 1 => 'Leica', 2 => 'Camera' },
  1666. NOTES => 'This information is written by the Leica S (Typ 007).',
  1667. );
  1668. # Type 2 tags (ref PH)
  1669. %Image::ExifTool::Panasonic::Type2 = (
  1670. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1671. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  1672. FIRST_ENTRY => 0,
  1673. FORMAT => 'int16u',
  1674. NOTES => q{
  1675. This type of maker notes is used by models such as the NV-DS65, PV-D2002,
  1676. PV-DC3000, PV-DV203, PV-DV401, PV-DV702, PV-L2001, PV-SD4090, PV-SD5000 and
  1677. iPalm.
  1678. },
  1679. 0 => {
  1680. Name => 'MakerNoteType',
  1681. Format => 'string[4]',
  1682. },
  1683. # seems to vary inversely with amount of light, so I'll call it 'Gain' - PH
  1684. # (minimum is 16, maximum is 136. Value is 0 for pictures captured from video)
  1685. 3 => 'Gain',
  1686. );
  1687. # Face detection position information (ref PH)
  1688. %Image::ExifTool::Panasonic::FaceDetInfo = (
  1689. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1690. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  1691. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  1692. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  1693. WRITABLE => 1,
  1694. FORMAT => 'int16u',
  1695. FIRST_ENTRY => 0,
  1696. DATAMEMBER => [ 0 ],
  1697. NOTES => 'Face detection position information.',
  1698. 0 => {
  1699. Name => 'NumFacePositions',
  1700. Format => 'int16u',
  1701. DataMember => 'NumFacePositions',
  1702. RawConv => '$$self{NumFacePositions} = $val',
  1703. Notes => q{
  1704. number of detected face positions stored in this record. May be less than
  1705. FacesDetected
  1706. },
  1707. },
  1708. 1 => {
  1709. Name => 'Face1Position',
  1710. Format => 'int16u[4]',
  1711. RawConv => '$$self{NumFacePositions} < 1 ? undef : $val',
  1712. Notes => q{
  1713. 4 numbers: X/Y coordinates of the face center and width/height of face.
  1714. Coordinates are relative to an image twice the size of the thumbnail, or 320
  1715. pixels wide
  1716. },
  1717. },
  1718. 5 => {
  1719. Name => 'Face2Position',
  1720. Format => 'int16u[4]',
  1721. RawConv => '$$self{NumFacePositions} < 2 ? undef : $val',
  1722. },
  1723. 9 => {
  1724. Name => 'Face3Position',
  1725. Format => 'int16u[4]',
  1726. RawConv => '$$self{NumFacePositions} < 3 ? undef : $val',
  1727. },
  1728. 13 => {
  1729. Name => 'Face4Position',
  1730. Format => 'int16u[4]',
  1731. RawConv => '$$self{NumFacePositions} < 4 ? undef : $val',
  1732. },
  1733. 17 => {
  1734. Name => 'Face5Position',
  1735. Format => 'int16u[4]',
  1736. RawConv => '$$self{NumFacePositions} < 5 ? undef : $val',
  1737. },
  1738. );
  1739. # Face recognition information from DMC-TZ7 (ref PH)
  1740. %Image::ExifTool::Panasonic::FaceRecInfo = (
  1741. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1742. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  1743. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  1744. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  1745. WRITABLE => 1,
  1746. FIRST_ENTRY => 0,
  1747. DATAMEMBER => [ 0 ],
  1748. NOTES => q{
  1749. Tags written by cameras with facial recognition. These cameras not only
  1750. detect faces in an image, but also recognize specific people based a
  1751. user-supplied set of known faces.
  1752. },
  1753. 0 => {
  1754. Name => 'FacesRecognized',
  1755. Format => 'int16u',
  1756. DataMember => 'FacesRecognized',
  1757. RawConv => '$$self{FacesRecognized} = $val',
  1758. },
  1759. 4 => {
  1760. Name => 'RecognizedFace1Name',
  1761. Format => 'string[20]',
  1762. RawConv => '$$self{FacesRecognized} < 1 ? undef : $val',
  1763. },
  1764. 24 => {
  1765. Name => 'RecognizedFace1Position',
  1766. Format => 'int16u[4]',
  1767. RawConv => '$$self{FacesRecognized} < 1 ? undef : $val',
  1768. Notes => 'coordinates in same format as face detection tags above',
  1769. },
  1770. 32 => {
  1771. Name => 'RecognizedFace1Age',
  1772. Format => 'string[20]',
  1773. RawConv => '$$self{FacesRecognized} < 1 ? undef : $val',
  1774. },
  1775. 52 => {
  1776. Name => 'RecognizedFace2Name',
  1777. Format => 'string[20]',
  1778. RawConv => '$$self{FacesRecognized} < 2 ? undef : $val',
  1779. },
  1780. 72 => {
  1781. Name => 'RecognizedFace2Position',
  1782. Format => 'int16u[4]',
  1783. RawConv => '$$self{FacesRecognized} < 2 ? undef : $val',
  1784. },
  1785. 80 => {
  1786. Name => 'RecognizedFace2Age',
  1787. Format => 'string[20]',
  1788. RawConv => '$$self{FacesRecognized} < 2 ? undef : $val',
  1789. },
  1790. 100 => {
  1791. Name => 'RecognizedFace3Name',
  1792. Format => 'string[20]',
  1793. RawConv => '$$self{FacesRecognized} < 3 ? undef : $val',
  1794. },
  1795. 120 => {
  1796. Name => 'RecognizedFace3Position',
  1797. Format => 'int16u[4]',
  1798. RawConv => '$$self{FacesRecognized} < 3 ? undef : $val',
  1799. },
  1800. 128 => {
  1801. Name => 'RecognizedFace3Age',
  1802. Format => 'string[20]',
  1803. RawConv => '$$self{FacesRecognized} < 3 ? undef : $val',
  1804. },
  1805. );
  1806. # PANA atom found in user data of MP4 videos (ref PH)
  1807. %Image::ExifTool::Panasonic::PANA = (
  1808. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  1809. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  1810. NOTES => q{
  1811. Tags extracted from the PANA and LEIC user data found in MP4 videos from
  1812. various Panasonic and Leica models.
  1813. },
  1814. 0x00 => {
  1815. Name => 'Make',
  1816. Condition => '$$valPt =~ /^(LEICA|Panasonic)/', # (only seen "LEICA")
  1817. Groups => { 2 => 'Camera' },
  1818. Format => 'string[22]',
  1819. RawConv => '$$self{LeicaLEIC} = 1;$$self{Make} = $val',
  1820. },
  1821. 0x04 => {
  1822. Name => 'Model',
  1823. Condition => '$$valPt =~ /^[^\0]{6}/ and not $$self{LeicaLEIC}',
  1824. Description => 'Camera Model Name',
  1825. Groups => { 2 => 'Camera' },
  1826. Format => 'string[16]',
  1827. RawConv => '$$self{Model} = $val',
  1828. },
  1829. 0x0c => { # (FZ1000)
  1830. Name => 'Model',
  1831. Condition => '$$valPt =~ /^[^\0]{6}/ and not $$self{LeicaLEIC} and not $$self{Model}',
  1832. Description => 'Camera Model Name',
  1833. Groups => { 2 => 'Camera' },
  1834. Format => 'string[16]',
  1835. RawConv => '$$self{Model} = $val',
  1836. },
  1837. 0x16 => {
  1838. Name => 'Model',
  1839. Condition => '$$self{LeicaLEIC}',
  1840. Description => 'Camera Model Name',
  1841. Groups => { 2 => 'Camera' },
  1842. Format => 'string[30]',
  1843. RawConv => '$$self{Model} = $val',
  1844. },
  1845. 0x40 => {
  1846. Name => 'ThumbnailTest',
  1847. Format => 'undef[0x600]',
  1848. Hidden => 1,
  1849. RawConv => q{
  1850. if (substr($val,0x1c,3) eq "\xff\xd8\xff") { # offset 0x5c
  1851. $$self{ThumbType} = 1;
  1852. } elsif (substr($val,0x506,3) eq "\xff\xd8\xff") { # offset 0x546
  1853. $$self{ThumbType} = 2;
  1854. } elsif (substr($val,0x51e,3) eq "\xff\xd8\xff") { # offset 0x55e (Leica T)
  1855. $$self{ThumbType} = 3;
  1856. } else {
  1857. $$self{ThumbType} = 0;
  1858. }
  1859. return undef;
  1860. },
  1861. },
  1862. 0x34 => {
  1863. Name => 'Version1',
  1864. Condition => '$$self{LeicaLEIC}',
  1865. Format => 'string[14]',
  1866. },
  1867. 0x3e => {
  1868. Name => 'Version2',
  1869. Condition => '$$self{LeicaLEIC}',
  1870. Format => 'string[14]',
  1871. },
  1872. 0x50 => {
  1873. Name => 'MakerNoteLeica5',
  1874. Condition => '$$self{LeicaLEIC}',
  1875. SubDirectory => {
  1876. TagTable => 'Image::ExifTool::Panasonic::Leica5',
  1877. ProcessProc => \&ProcessLeicaLEIC,
  1878. },
  1879. },
  1880. 0x58 => {
  1881. Name => 'ThumbnailWidth',
  1882. Condition => '$$self{ThumbType} == 1',
  1883. Notes => 'Panasonic models',
  1884. Format => 'int16u',
  1885. },
  1886. 0x5a => {
  1887. Name => 'ThumbnailHeight',
  1888. Condition => '$$self{ThumbType} == 1',
  1889. Format => 'int16u',
  1890. },
  1891. 0x5c => {
  1892. Name => 'ThumbnailImage',
  1893. Condition => '$$self{ThumbType} == 1',
  1894. Groups => { 2 => 'Preview' },
  1895. Format => 'undef[16384]',
  1896. ValueConv => '$val=~s/\0*$//; \$val', # remove trailing zeros
  1897. },
  1898. # 0x5c - there is some messed-up EXIF-IFD-looking data starting here in
  1899. # Leica X VARIO MP4 videos, but it doesn't quite make sense
  1900. 0x536 => { # (Leica X VARIO)
  1901. Name => 'ThumbnailWidth',
  1902. Condition => '$$self{ThumbType} == 2',
  1903. Notes => 'Leica X Vario',
  1904. Format => 'int32uRev', # (little-endian)
  1905. },
  1906. 0x53a => { # (Leica X VARIO)
  1907. Name => 'ThumbnailHeight',
  1908. Condition => '$$self{ThumbType} == 2',
  1909. Format => 'int32uRev', # (little-endian)
  1910. },
  1911. 0x53e => { # (Leica X VARIO)
  1912. Name => 'ThumbnailLength',
  1913. Condition => '$$self{ThumbType} == 2',
  1914. Format => 'int32uRev', # (little-endian)
  1915. },
  1916. 0x546 => { # (Leica X VARIO)
  1917. Name => 'ThumbnailImage',
  1918. Condition => '$$self{ThumbType} == 2',
  1919. Groups => { 2 => 'Preview' },
  1920. Format => 'undef[$val{0x53e}]',
  1921. Binary => 1,
  1922. },
  1923. 0x54e => { # (Leica T)
  1924. Name => 'ThumbnailWidth',
  1925. Condition => '$$self{ThumbType} == 3',
  1926. Notes => 'Leica X Vario',
  1927. Format => 'int32uRev', # (little-endian)
  1928. },
  1929. 0x552 => { # (Leica T)
  1930. Name => 'ThumbnailHeight',
  1931. Condition => '$$self{ThumbType} == 3',
  1932. Format => 'int32uRev', # (little-endian)
  1933. },
  1934. 0x556 => { # (Leica T)
  1935. Name => 'ThumbnailLength',
  1936. Condition => '$$self{ThumbType} == 3',
  1937. Format => 'int32uRev', # (little-endian)
  1938. },
  1939. 0x55e => { # (Leica T)
  1940. Name => 'ThumbnailImage',
  1941. Condition => '$$self{ThumbType} == 3',
  1942. Groups => { 2 => 'Preview' },
  1943. Format => 'undef[$val{0x556}]',
  1944. Binary => 1,
  1945. },
  1946. 0x4068 => {
  1947. Name => 'ExifData',
  1948. Condition => '$$valPt =~ /^\xff\xd8\xff\xe1..Exif\0\0/s',
  1949. SubDirectory => {
  1950. TagTable => 'Image::ExifTool::Exif::Main',
  1951. ProcessProc => \&Image::ExifTool::ProcessTIFF,
  1952. Start => 12,
  1953. },
  1954. },
  1955. 0x4080 => { # (FZ1000)
  1956. Name => 'ExifData',
  1957. Condition => '$$valPt =~ /^\xff\xd8\xff\xe1..Exif\0\0/s',
  1958. SubDirectory => {
  1959. TagTable => 'Image::ExifTool::Exif::Main',
  1960. ProcessProc => \&Image::ExifTool::ProcessTIFF,
  1961. Start => 12,
  1962. },
  1963. },
  1964. );
  1965. # Panasonic Composite tags
  1966. %Image::ExifTool::Panasonic::Composite = (
  1967. GROUPS => { 2 => 'Camera' },
  1968. AdvancedSceneMode => {
  1969. SeparateTable => 'Panasonic AdvancedSceneMode', # print values in a separate table
  1970. Require => {
  1971. 0 => 'Model',
  1972. 1 => 'SceneMode',
  1973. 2 => 'AdvancedSceneType',
  1974. },
  1975. ValueConv => '"$val[0] $val[1] $val[2]"',
  1976. PrintConv => { #PH
  1977. OTHER => sub {
  1978. my ($val,$flag,$conv) = @_;
  1979. $val =~ s/.* (\d+ \d+)/$1/; # drop model name
  1980. return $$conv{$val} if $$conv{$val};
  1981. my @v = split ' ', $val;
  1982. my $prt = $shootingMode{$v[0]};
  1983. # AdvancedSceneType=1 for non-automatic modes P,A,S,SCN (ref 19)
  1984. # AdvancedSceneType=5 for automatic mode iA (ref 19)
  1985. if ($prt) {
  1986. return $prt if $v[1] == 1;
  1987. return "$prt (intelligent auto)" if $v[1] == 5;
  1988. return "$prt ($v[1])";
  1989. }
  1990. return "Unknown ($val)";
  1991. },
  1992. Notes => 'A Composite tag derived from Model, SceneMode and AdvancedSceneType.',
  1993. '0 1' => 'Off',
  1994. # '0 7' - seen this for V-LUX movies (PH)
  1995. # '0 8' - seen for D-LUX(Typ104) movies (PH)
  1996. '2 2' => 'Outdoor Portrait', #(FZ28)
  1997. '2 3' => 'Indoor Portrait', #(FZ28)
  1998. '2 4' => 'Creative Portrait', #(FZ28)
  1999. '3 2' => 'Nature', #(FZ28)
  2000. '3 3' => 'Architecture', #(FZ28)
  2001. '3 4' => 'Creative Scenery', #(FZ28)
  2002. #'3 5' - ? (FT1)
  2003. '4 2' => 'Outdoor Sports', #(FZ28)
  2004. '4 3' => 'Indoor Sports', #(FZ28)
  2005. '4 4' => 'Creative Sports', #(FZ28)
  2006. '9 2' => 'Flower', #(FZ28)
  2007. '9 3' => 'Objects', #(FZ28)
  2008. '9 4' => 'Creative Macro', #(FZ28)
  2009. #'9 5' - ? (GF3)
  2010. '21 2' => 'Illuminations', #(FZ28)
  2011. '21 4' => 'Creative Night Scenery', #(FZ28)
  2012. #'21 5' - ? (LX3)
  2013. #'37 5' - ? (various)
  2014. '45 2' => 'Cinema', #(GF2)
  2015. '45 7' => 'Expressive', #(GF1,GF2)
  2016. '45 8' => 'Retro', #(GF1,GF2)
  2017. '45 9' => 'Pure', #(GF1,GF2)
  2018. '45 10' => 'Elegant', #(GF1,GF2)
  2019. '45 12' => 'Monochrome', #(GF1,GF2)
  2020. '45 13' => 'Dynamic Art', #(GF1,GF2)
  2021. '45 14' => 'Silhouette', #(GF1,GF2)
  2022. '51 2' => 'HDR Art', #12
  2023. '51 3' => 'HDR B&W', #12
  2024. '59 1' => 'Expressive', #(GF5)
  2025. '59 2' => 'Retro', #(GF5)
  2026. '59 3' => 'High Key', #(GF5)
  2027. '59 4' => 'Sepia', #(GF3,GF5)
  2028. '59 5' => 'High Dynamic', #(GF3,GF5)
  2029. '59 6' => 'Miniature', #(GF3)
  2030. '59 9' => 'Low Key', #(GF5)
  2031. '59 10' => 'Toy Effect', #(GF5)
  2032. '59 11' => 'Dynamic Monochrome', #(GF5)
  2033. '59 12' => 'Soft', #(GF5)
  2034. '66 1' => 'Impressive Art', #19
  2035. '66 2' => 'Cross Process', #(GF5)
  2036. '66 3' => 'Color Select', #(GF5) (called "One Point Color" by some other models - PH)
  2037. '66 4' => 'Star', #(GF5)
  2038. '90 3' => 'Old Days', #18
  2039. '90 4' => 'Sunshine', #18
  2040. '90 5' => 'Bleach Bypass', #18
  2041. '90 6' => 'Toy Pop', #18
  2042. '90 7' => 'Fantasy', #18
  2043. '90 8' => 'Monochrome', #PH (GX7)
  2044. '90 9' => 'Rough Monochrome', #PH (GX7)
  2045. '90 10' => 'Silky Monochrome', #PH (GX7)
  2046. '92 1' => 'Handheld Night Shot', #Horst Wandres (FZ1000)
  2047. # TZ40 Creative Control modes (ref 19)
  2048. 'DMC-TZ40 90 1' => 'Expressive',
  2049. 'DMC-TZ40 90 2' => 'Retro',
  2050. 'DMC-TZ40 90 3' => 'High Key',
  2051. 'DMC-TZ40 90 4' => 'Sepia',
  2052. 'DMC-TZ40 90 5' => 'High Dynamic',
  2053. 'DMC-TZ40 90 6' => 'Miniature',
  2054. 'DMC-TZ40 90 9' => 'Low Key',
  2055. 'DMC-TZ40 90 10' => 'Toy Effect',
  2056. 'DMC-TZ40 90 11' => 'Dynamic Monochrome',
  2057. 'DMC-TZ40 90 12' => 'Soft',
  2058. },
  2059. },
  2060. );
  2061. # add our composite tags
  2062. Image::ExifTool::AddCompositeTags('Image::ExifTool::Panasonic');
  2063. #------------------------------------------------------------------------------
  2064. # Inverse conversion for Leica M9 lens codes
  2065. # Inputs: 0) value
  2066. # Returns: Converted value, or undef on error
  2067. sub LensTypeConvInv($)
  2068. {
  2069. my $val = shift;
  2070. if ($val =~ /^(\d+) (\d+)$/) {
  2071. return ($1 << 2) + ($2 & 0x03);
  2072. } elsif ($val =~ /^\d+$/) {
  2073. my $bits = $frameSelectorBits{$val};
  2074. return undef unless defined $bits;
  2075. return ($val << 2) | $bits;
  2076. } else {
  2077. return undef;
  2078. }
  2079. }
  2080. #------------------------------------------------------------------------------
  2081. # Convert Leica Kelvin white balance
  2082. # Inputs: 0) value, 1) flag to perform inverse conversion
  2083. # Returns: Converted value, or undef on error
  2084. sub WhiteBalanceConv($;$$)
  2085. {
  2086. my ($val, $inv) = @_;
  2087. if ($inv) {
  2088. return $1 + 0x8000 if $val =~ /(\d+)/;
  2089. } else {
  2090. return ($val - 0x8000) . ' Kelvin' if $val > 0x8000;
  2091. }
  2092. return undef;
  2093. }
  2094. #------------------------------------------------------------------------------
  2095. # Process Leica makernotes in LEIC atom of MP4 videos (Leica T and X Vario)
  2096. # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) tag table ref
  2097. # Returns: 1 on success
  2098. sub ProcessLeicaLEIC($$$)
  2099. {
  2100. my ($et, $dirInfo, $tagTablePtr) = @_;
  2101. my $dataPt = $$dirInfo{DataPt};
  2102. my $dirStart = $$dirInfo{DirStart} || 0;
  2103. my $dirLen = $$dirInfo{DirLen} || (length($$dataPt) - $dirStart);
  2104. return 0 if $dirLen < 6;
  2105. SetByteOrder('II');
  2106. my $numEntries = Get16u($dataPt, $dirStart);
  2107. return 0 if $numEntries < 1 or $numEntries > 255;
  2108. my $size = Get32u($dataPt, $dirStart + 2);
  2109. return 0 if $size < $numEntries * 12 or $size + 6 > $dirLen;
  2110. # the Leica programmers want to make things difficult, so they store
  2111. # the entry count before the directory size, making it impossible to
  2112. # process as a standard TIFF IFD without a bit of reorganization...
  2113. Set16u($numEntries, $dataPt, $dirStart + 4);
  2114. my %dirInfo = %$dirInfo;
  2115. $dirInfo{DirStart} = $dirStart + 4;
  2116. $dirInfo{DirLen} = $size - 4;
  2117. $dirInfo{DataPos} -= $dirStart;
  2118. $dirInfo{Base} += $dirStart;
  2119. return Image::ExifTool::Exif::ProcessExif($et, \%dirInfo, $tagTablePtr);
  2120. return 1;
  2121. }
  2122. #------------------------------------------------------------------------------
  2123. # Process MakerNote trailer written by Leica S2
  2124. # Inputs: 0) ExifTool object ref, 1) new absolute position of Leica trailer when writing
  2125. # Returns: On success: 1 when reading, directory data when writing; othewise undef
  2126. # Notes:
  2127. # - may be called twice for a file if the first call doesn't succeed
  2128. # - must leave RAF position unchanged
  2129. # - uses information from LeicaTrailer member:
  2130. # TagInfo = tag info ref for MakerNote SubDirectory
  2131. # Offset/Size = value offset/size from MakerNote IFD
  2132. # TrailStart/TrailLen = actual JPEG trailer position/size (2nd call only)
  2133. # - deletes LeicaTrailer member and sets LeicaTrailerPos when successful
  2134. sub ProcessLeicaTrailer($;$)
  2135. {
  2136. my ($et, $newPos) = @_;
  2137. my $trail = $$et{LeicaTrailer};
  2138. my $raf = $$et{RAF};
  2139. my $trailPos = $$trail{TrailPos};
  2140. my $pos = $trailPos || $$trail{Offset};
  2141. my $len = $$trail{TrailLen} || $$trail{Size};
  2142. my ($buff, $result, %tagPtr);
  2143. delete $$et{LeicaTrailer} if $trailPos; # done after this
  2144. unless ($len > 0) {
  2145. $et->Warn('Missing Leica MakerNote trailer', 1) if $trailPos;
  2146. delete $$et{LeicaTrailer};
  2147. return undef;
  2148. }
  2149. my $oldPos = $raf->Tell();
  2150. my $ok = ($raf->Seek($pos, 0) and $raf->Read($buff, $len) == $len);
  2151. $raf->Seek($oldPos, 0);
  2152. unless ($ok) {
  2153. $et->Warn('Error reading Leica MakerNote trailer', 1) if $trailPos;
  2154. return undef;
  2155. }
  2156. # look for Leica MakerNote header (should be at start of
  2157. # trailer, but allow up to 256 bytes of garbage just in case)
  2158. if ($buff !~ /^(.{0,256})LEICA\0..../sg) {
  2159. my $what = $trailPos ? 'trailer' : 'offset';
  2160. $et->Warn("Invalid Leica MakerNote $what", 1);
  2161. return undef;
  2162. }
  2163. my $junk = $1;
  2164. my $start = pos($buff) - 10;
  2165. if ($start and not $trailPos) {
  2166. $et->Warn('Invalid Leica MakerNote offset', 1);
  2167. return undef;
  2168. }
  2169. #
  2170. # all checks passed -- go ahead and process the trailer now
  2171. #
  2172. my $hdrLen = 8;
  2173. my $dirStart = $start + $hdrLen;
  2174. my $tagInfo = $$trail{TagInfo};
  2175. if ($$et{HTML_DUMP}) {
  2176. my $name = $$tagInfo{Name};
  2177. $et->HDump($pos+$start, $len-$start, "$name value", 'Leica MakerNote trailer', 4);
  2178. $et->HDump($pos+$start, $hdrLen, "MakerNotes header", $name);
  2179. } elsif ($et->Options('Verbose')) {
  2180. my $where = sprintf('at offset 0x%x', $pos);
  2181. $et->VPrint(0, "Leica MakerNote trailer ($len bytes $where):\n");
  2182. }
  2183. # delete LeicaTrailer member so we don't try to process it again
  2184. delete $$et{LeicaTrailer};
  2185. $$et{LeicaTrailerPos} = $pos + $start; # return actual start position of Leica trailer
  2186. my $oldOrder = GetByteOrder();
  2187. my $num = Get16u(\$buff, $dirStart); # get entry count
  2188. ToggleByteOrder() if ($num>>8) > ($num&0xff); # set byte order
  2189. # use specialized algorithm to automatically fix offsets
  2190. my $valStart = $dirStart + 2 + 12 * $num + 4;
  2191. my $fix = 0;
  2192. if ($valStart < $len) {
  2193. my $valBlock = Image::ExifTool::MakerNotes::GetValueBlocks(\$buff, $dirStart, \%tagPtr);
  2194. # find the minimum offset (excluding the PreviewImage tag 0x300 and 0x301)
  2195. my $minPtr;
  2196. foreach (keys %tagPtr) {
  2197. my $ptr = $tagPtr{$_};
  2198. next if $_ == 0x300 or $_ == 0x301 or not $ptr or $ptr == 0xffffffff;
  2199. $minPtr = $ptr if not defined $minPtr or $minPtr > $ptr;
  2200. }
  2201. if ($minPtr) {
  2202. my $diff = $minPtr - ($valStart + $pos);
  2203. pos($buff) = $valStart;
  2204. my $expect;
  2205. if ($$et{Model} eq 'S2') {
  2206. # scan value data for the first non-zero byte
  2207. if ($buff =~ /[^\0]/g) {
  2208. my $n = pos($buff) - 1 - $valStart; # number of zero bytes
  2209. # S2 writes 282 bytes of zeros, exiftool writes none
  2210. $expect = $n >= 282 ? 282 : 0;
  2211. }
  2212. } else { # M (Type 240)
  2213. # scan for the lens type (M writes 114 bytes of garbage first)
  2214. if ($buff =~ /\G.{114}([\x20-\x7f]*\0*)/sg and length($1) >= 50) {
  2215. $expect = 114;
  2216. }
  2217. }
  2218. my $fixBase = $et->Options('FixBase');
  2219. if (not defined $expect) {
  2220. $et->Warn('Unrecognized Leica trailer structure');
  2221. } elsif ($diff != $expect or defined $fixBase) {
  2222. $fix = $expect - $diff;
  2223. if (defined $fixBase) {
  2224. $fix = $fixBase if $fixBase ne '';
  2225. $et->Warn("Adjusted MakerNotes base by $fix",1);
  2226. } else {
  2227. $et->Warn("Possibly incorrect maker notes offsets (fixed by $fix)",1);
  2228. }
  2229. }
  2230. }
  2231. }
  2232. # generate dirInfo for Leica MakerNote directory
  2233. my %dirInfo = (
  2234. Name => $$tagInfo{Name},
  2235. Base => $fix,
  2236. DataPt => \$buff,
  2237. DataPos => $pos - $fix,
  2238. DataLen => $len,
  2239. DirStart => $dirStart,
  2240. DirLen => $len - $dirStart,
  2241. DirName => 'MakerNotes',
  2242. Parent => 'ExifIFD',
  2243. TagInfo => $tagInfo,
  2244. );
  2245. my $tagTablePtr = GetTagTable($$tagInfo{SubDirectory}{TagTable});
  2246. if ($newPos) { # are we writing?
  2247. if ($$et{Model} ne 'S2') {
  2248. $et->Warn('Leica MakerNote trailer too messed up to edit. Copying as a block', 1);
  2249. return $buff;
  2250. }
  2251. # set position of new MakerNote IFD (+ 8 for Leica MakerNote header)
  2252. $dirInfo{NewDataPos} = $newPos + $start + 8;
  2253. $result = $et->WriteDirectory(\%dirInfo, $tagTablePtr);
  2254. # write preview image last if necessary and fix up the preview offsets
  2255. my $previewInfo = $$et{PREVIEW_INFO};
  2256. delete $$et{PREVIEW_INFO};
  2257. if ($result) {
  2258. if ($previewInfo) {
  2259. my $fixup = $previewInfo->{Fixup};
  2260. # set preview offset (relative to start of makernotes, + 8 for makernote header)
  2261. $fixup->SetMarkerPointers(\$result, 'PreviewImage', length($result) + 8);
  2262. $result .= $$previewInfo{Data};
  2263. }
  2264. return $junk . substr($buff, $start, $hdrLen) . $result;
  2265. }
  2266. } else {
  2267. # extract information
  2268. $result = $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
  2269. # also extract as a block if necessary
  2270. if ($et->Options('MakerNotes') or
  2271. $$et{REQ_TAG_LOOKUP}{lc($$tagInfo{Name})})
  2272. {
  2273. # makernote header must be included in RebuildMakerNotes call
  2274. $dirInfo{DirStart} -= 8;
  2275. $dirInfo{DirLen} += 8;
  2276. $$et{MAKER_NOTE_BYTE_ORDER} = GetByteOrder();
  2277. # rebuild maker notes (creates $$et{MAKER_NOTE_FIXUP})
  2278. my $val = Image::ExifTool::Exif::RebuildMakerNotes($et, $tagTablePtr, \%dirInfo);
  2279. unless (defined $val) {
  2280. $et->Warn('Error rebuilding maker notes (may be corrupt)') if $len > 4;
  2281. $val = $buff,
  2282. }
  2283. my $key = $et->FoundTag($tagInfo, $val);
  2284. $et->SetGroup($key, 'ExifIFD');
  2285. }
  2286. }
  2287. SetByteOrder($oldOrder);
  2288. return $result;
  2289. }
  2290. 1; # end
  2291. __END__
  2292. =head1 NAME
  2293. Image::ExifTool::Panasonic - Panasonic/Leica maker notes tags
  2294. =head1 SYNOPSIS
  2295. This module is loaded automatically by Image::ExifTool when required.
  2296. =head1 DESCRIPTION
  2297. This module contains definitions required by Image::ExifTool to interpret
  2298. Panasonic and Leica maker notes in EXIF information.
  2299. =head1 AUTHOR
  2300. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  2301. This library is free software; you can redistribute it and/or modify it
  2302. under the same terms as Perl itself.
  2303. =head1 REFERENCES
  2304. =over 4
  2305. =item L<http://www.compton.nu/panasonic.html>
  2306. =item L<http://johnst.org/sw/exiftags/>
  2307. =item L<http://homepage3.nifty.com/kamisaka/makernote/makernote_pana.htm>
  2308. =item L<http://bretteville.com/pdfs/M8Metadata_v2.pdf>
  2309. =item L<http://www.digital-leica.com/lens_codes/index.html>
  2310. =item (...plus lots of testing with store demos and my wife's DMC-FS7!)
  2311. =back
  2312. =head1 ACKNOWLEDGEMENTS
  2313. Thanks to Tels, Marcel Coenen, Jens Duttke, Joerg, Michael Byczkowski, Carl
  2314. Bretteville, Zdenek Mihula and Olaf Ulrich for their contributions.
  2315. =head1 SEE ALSO
  2316. L<Image::ExifTool::TagNames/Panasonic Tags>,
  2317. L<Image::ExifTool(3pm)|Image::ExifTool>
  2318. =cut