Pentax.pm 207 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978
  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 LensType 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. # 10/22/2007 - P. Harvey Got my new K10D! (more new tags to decode)
  14. # 11/03/2010 - P. Harvey Got my new K-5! (a gold mine of new tags to discover!)
  15. #
  16. # References: 1) Image::MakerNotes::Pentax
  17. # 2) http://johnst.org/sw/exiftags/ (Asahi cameras)
  18. # 3) Wayne Smith private communication (Optio 550)
  19. # 4) http://kobe1995.jp/~kaz/astro/istD.html
  20. # 5) John Francis (http://www.panix.com/~johnf/raw/index.html) (ist-D/ist-DS)
  21. # 6) http://www.cybercom.net/~dcoffin/dcraw/
  22. # 7) Douglas O'Brien private communication (*istD, K10D)
  23. # 8) Denis Bourez private communication
  24. # 9) Kazumichi Kawabata private communication
  25. # 10) David Buret private communication (*istD)
  26. # 11) http://forums.dpreview.com/forums/read.asp?forum=1036&message=17465929
  27. # 12) Derby Chang private communication
  28. # 13) http://homepage3.nifty.com/kamisaka/makernote/makernote_pentax.htm (2007/02/28)
  29. # 14) Ger Vermeulen private communication (Optio S6)
  30. # 15) Barney Garrett private communication (Samsung GX-1S)
  31. # 16) Axel Kellner private communication (K10D)
  32. # 17) Cvetan Ivanov private communication (K100D)
  33. # 18) http://gvsoft.homedns.org/exif/makernote-pentax-type3.html
  34. # 19) Dave Nicholson private communication (K10D)
  35. # 20) Bogdan and yeryry (http://www.cpanforum.com/posts/8037)
  36. # 21) Peter (*istD, http://www.cpanforum.com/posts/8078)
  37. # 22) Bozi (K10D, http://www.cpanforum.com/posts/8480)
  38. # 23) Akos Szalkai (https://rt.cpan.org/Ticket/Display.html?id=43743)
  39. # 24) Albert Bogner private communication
  40. # 25) Niels Kristian Bech Jensen private communication
  41. # 26) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3444.0.html
  42. # 27) http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3833.0.html
  43. # 28) Klaus Homeister http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4803.0.html
  44. # 29) Louis Granboulan private communication (K-5II)
  45. # 30) http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=5433
  46. # 31) Iliah Borg private communication (LibRaw)
  47. # JD) Jens Duttke private communication
  48. #
  49. # Notes: See POD documentation at the bottom of this file
  50. #------------------------------------------------------------------------------
  51. package Image::ExifTool::Pentax;
  52. use strict;
  53. use vars qw($VERSION %pentaxLensTypes);
  54. use Image::ExifTool::Exif;
  55. use Image::ExifTool::HP;
  56. $VERSION = '2.99';
  57. sub CryptShutterCount($$);
  58. sub PrintFilter($$$);
  59. # pentax lens type codes (ref 4)
  60. # The first number gives the lens series, and the 2nd gives the model number
  61. # Series numbers: K=1; A=2; F=3; FAJ=4; DFA=4,7; FA=3,4,5,6; FA*=5,6;
  62. # DA=3,4,7; DA*=7,8; FA645=11; DFA645=13; Q=21
  63. %pentaxLensTypes = (
  64. Notes => q{
  65. The first number gives the series of the lens, and the second identifies the
  66. lens model. Note that newer series numbers may not always be properly
  67. identified by cameras running older firmware versions. Decimal values have
  68. been added to differentiate lenses which would otherwise have the same
  69. LensType, and are used by the Composite LensID tag when attempting to
  70. identify the specific lens model.
  71. },
  72. OTHER => sub {
  73. my ($val, $inv, $conv) = @_;
  74. return undef if $inv;
  75. # *istD may report a series number of 4 for series 7 lenses
  76. $val =~ s/^4 /7 / and $$conv{$val} and return "$$conv{$val} ($_[0])";
  77. # cameras that don't recognize SDM lenses (eg. older K10 firmware)
  78. # may report series 7 instead of 8
  79. $val =~ s/^7 /8 / and $$conv{$val} and return "$$conv{$val} ? ($_[0])";
  80. # there seems to some inconsistency between FA and DFA lenses for the 645D...
  81. ($val =~ s/^11 /13 / or $val =~ s/^13 /11 /) and $$conv{$val} and return "$$conv{$val} ? ($_[0])";
  82. return undef;
  83. },
  84. '0 0' => 'M-42 or No Lens', #17
  85. '1 0' => 'K or M Lens',
  86. '2 0' => 'A Series Lens', #7 (from smc PENTAX-A 400mm F5.6)
  87. '3 0' => 'Sigma', # (includes 'Sigma 30mm F1.4 EX DC' - PH)
  88. # (and 'Sigma 105mm F2.8 EX DG Macro', ref 24)
  89. # (and 'Sigma 18-50mm F2.8 EX Macro')
  90. # (and 'Sigma 180mm F4.5 EX DG Macro')
  91. # (and 'Sigma 70mm F2.8 EX DG Macro')
  92. # (and 'Sigma 50-500mm F4-6.3 DG APO')
  93. '3 17' => 'smc PENTAX-FA SOFT 85mm F2.8',
  94. '3 18' => 'smc PENTAX-F 1.7X AF ADAPTER',
  95. '3 19' => 'smc PENTAX-F 24-50mm F4',
  96. '3 20' => 'smc PENTAX-F 35-80mm F4-5.6',
  97. '3 21' => 'smc PENTAX-F 80-200mm F4.7-5.6',
  98. '3 22' => 'smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5',
  99. '3 23' => 'smc PENTAX-F 100-300mm F4.5-5.6 or Sigma Lens',
  100. '3 23.1' => 'Sigma AF 28-300mm F3.5-5.6 DL IF', #JD
  101. '3 23.2' => 'Sigma AF 28-300mm F3.5-6.3 DG IF Macro', #JD
  102. '3 23.3' => 'Tokina 80-200mm F2.8 ATX-Pro', #Exiv2
  103. '3 24' => 'smc PENTAX-F 35-135mm F3.5-4.5',
  104. '3 25' => 'smc PENTAX-F 35-105mm F4-5.6 or Sigma or Tokina Lens',
  105. '3 25.1' => 'Sigma AF 28-300mm F3.5-5.6 DL IF', #11
  106. '3 25.2' => 'Sigma 55-200mm F4-5.6 DC', #JD
  107. '3 25.3' => 'Sigma AF 28-300mm F3.5-6.3 DL IF', #Exiv2
  108. '3 25.4' => 'Sigma AF 28-300mm F3.5-6.3 DG IF Macro', #JD
  109. '3 25.5' => 'Tokina 80-200mm F2.8 ATX-Pro', #12
  110. '3 26' => 'smc PENTAX-F* 250-600mm F5.6 ED[IF]',
  111. '3 27' => 'smc PENTAX-F 28-80mm F3.5-4.5 or Tokina Lens',
  112. '3 27.1' => 'Tokina AT-X Pro AF 28-70mm F2.6-2.8', #JD
  113. '3 28' => 'smc PENTAX-F 35-70mm F3.5-4.5 or Tokina Lens',
  114. '3 28.1' => 'Tokina 19-35mm F3.5-4.5 AF', #12
  115. '3 28.2' => 'Tokina AT-X AF 400mm F5.6', #25
  116. '3 29' => 'PENTAX-F 28-80mm F3.5-4.5 or Sigma or Tokina Lens',
  117. '3 29.1' => 'Sigma AF 18-125mm F3.5-5.6 DC', #11
  118. '3 29.2' => 'Tokina AT-X PRO 28-70mm F2.6-2.8', #22
  119. '3 30' => 'PENTAX-F 70-200mm F4-5.6',
  120. '3 31' => 'smc PENTAX-F 70-210mm F4-5.6 or Tokina or Takumar Lens',
  121. '3 31.1' => 'Tokina AF 730 75-300mm F4.5-5.6',
  122. '3 31.2' => 'Takumar-F 70-210mm F4-5.6', #JD
  123. '3 32' => 'smc PENTAX-F 50mm F1.4',
  124. '3 33' => 'smc PENTAX-F 50mm F1.7',
  125. '3 34' => 'smc PENTAX-F 135mm F2.8 [IF]',
  126. '3 35' => 'smc PENTAX-F 28mm F2.8',
  127. '3 36' => 'Sigma 20mm F1.8 EX DG Aspherical RF',
  128. '3 38' => 'smc PENTAX-F* 300mm F4.5 ED[IF]',
  129. '3 39' => 'smc PENTAX-F* 600mm F4 ED[IF]',
  130. '3 40' => 'smc PENTAX-F Macro 100mm F2.8',
  131. '3 41' => 'smc PENTAX-F Macro 50mm F2.8 or Sigma Lens', #4
  132. '3 41.1' => 'Sigma 50mm F2.8 Macro', #16
  133. '3 42' => 'Sigma 300mm F2.8 EX DG APO IF', #27
  134. '3 44' => 'Sigma or Tamron Lens (3 44)',
  135. '3 44.1' => 'Sigma AF 10-20mm F4-5.6 EX DC', #JD
  136. '3 44.2' => 'Sigma 12-24mm F4.5-5.6 EX DG', #12 (added "-5.6", ref 29)
  137. '3 44.3' => 'Sigma 17-70mm F2.8-4.5 DC Macro', #(Bart Hickman)
  138. '3 44.4' => 'Sigma 18-50mm F3.5-5.6 DC', #4
  139. '3 44.5' => 'Tamron 35-90mm F4 AF', #12
  140. '3 46' => 'Sigma or Samsung Lens (3 46)',
  141. '3 46.1' => 'Sigma APO 70-200mm F2.8 EX',
  142. '3 46.2' => 'Sigma EX APO 100-300mm F4 IF', #JD
  143. '3 46.3' => 'Samsung/Schneider D-XENON 50-200mm F4-5.6 ED', #29
  144. '3 50' => 'smc PENTAX-FA 28-70mm F4 AL',
  145. '3 51' => 'Sigma 28mm F1.8 EX DG Aspherical Macro',
  146. '3 52' => 'smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF] or Tamron Lens',
  147. '3 52.1' => 'Tamron AF LD 28-200mm F3.8-5.6 [IF] Aspherical (171D)', #JD
  148. '3 53' => 'smc PENTAX-FA 28-80mm F3.5-5.6 AL',
  149. '3 247' => 'smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]',
  150. '3 248' => 'smc PENTAX-DA 12-24mm F4 ED AL[IF]',
  151. '3 250' => 'smc PENTAX-DA 50-200mm F4-5.6 ED',
  152. '3 251' => 'smc PENTAX-DA 40mm F2.8 Limited',
  153. '3 252' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL',
  154. '3 253' => 'smc PENTAX-DA 14mm F2.8 ED[IF]',
  155. '3 254' => 'smc PENTAX-DA 16-45mm F4 ED AL',
  156. '3 255' => 'Sigma Lens (3 255)',
  157. '3 255.1' => 'Sigma 18-200mm F3.5-6.3 DC', #8
  158. '3 255.2' => 'Sigma DL-II 35-80mm F4-5.6', #12
  159. '3 255.3' => 'Sigma DL Zoom 75-300mm F4-5.6', #12
  160. '3 255.4' => 'Sigma DF EX Aspherical 28-70mm F2.8', #12
  161. '3 255.5' => 'Sigma AF Tele 400mm F5.6 Multi-coated', #JD
  162. '3 255.6' => 'Sigma 24-60mm F2.8 EX DG', #PH
  163. '3 255.7' => 'Sigma 70-300mm F4-5.6 Macro', #JD
  164. '3 255.8' => 'Sigma 55-200mm F4-5.6 DC', #JD
  165. '3 255.9' => 'Sigma 18-50mm F2.8 EX DC', #JD (also Macro version - PH)
  166. '4 1' => 'smc PENTAX-FA SOFT 28mm F2.8',
  167. '4 2' => 'smc PENTAX-FA 80-320mm F4.5-5.6',
  168. '4 3' => 'smc PENTAX-FA 43mm F1.9 Limited',
  169. '4 6' => 'smc PENTAX-FA 35-80mm F4-5.6',
  170. '4 12' => 'smc PENTAX-FA 50mm F1.4', #17
  171. '4 15' => 'smc PENTAX-FA 28-105mm F4-5.6 [IF]',
  172. '4 16' => 'Tamron AF 80-210mm F4-5.6 (178D)', #13
  173. '4 19' => 'Tamron SP AF 90mm F2.8 (172E)',
  174. '4 20' => 'smc PENTAX-FA 28-80mm F3.5-5.6',
  175. '4 21' => 'Cosina AF 100-300mm F5.6-6.7', #20
  176. '4 22' => 'Tokina 28-80mm F3.5-5.6', #13
  177. '4 23' => 'smc PENTAX-FA 20-35mm F4 AL',
  178. '4 24' => 'smc PENTAX-FA 77mm F1.8 Limited',
  179. '4 25' => 'Tamron SP AF 14mm F2.8', #13
  180. '4 26' => 'smc PENTAX-FA Macro 100mm F3.5 or Cosina Lens',
  181. '4 26.1' => 'Cosina 100mm F3.5 Macro', #JD
  182. '4 27' => 'Tamron AF 28-300mm F3.5-6.3 LD Aspherical[IF] Macro (185D/285D)',
  183. '4 28' => 'smc PENTAX-FA 35mm F2 AL',
  184. '4 29' => 'Tamron AF 28-200mm F3.8-5.6 LD Super II Macro (371D)', #JD
  185. '4 34' => 'smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]',
  186. '4 35' => 'smc PENTAX-FA 100-300mm F4.7-5.8',
  187. # '4 36' => 'Tamron AF70-300mm F4-5.6 LD Macro', # both 572D and A17 (Di) - ref JD
  188. '4 36' => 'Tamron AF 70-300mm F4-5.6 LD Macro 1:2', #25
  189. '4 37' => 'Tamron SP AF 24-135mm F3.5-5.6 AD AL (190D)', #13
  190. '4 38' => 'smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]',
  191. '4 39' => 'smc PENTAX-FA 31mm F1.8 AL Limited',
  192. '4 41' => 'Tamron AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] Macro (A03)',
  193. '4 43' => 'smc PENTAX-FA 28-90mm F3.5-5.6',
  194. '4 44' => 'smc PENTAX-FA J 75-300mm F4.5-5.8 AL',
  195. '4 45' => 'Tamron Lens (4 45)',
  196. '4 45.1' => 'Tamron 28-300mm F3.5-6.3 Ultra zoom XR',
  197. '4 45.2' => 'Tamron AF 28-300mm F3.5-6.3 XR Di LD Aspherical [IF] Macro', #JD
  198. '4 46' => 'smc PENTAX-FA J 28-80mm F3.5-5.6 AL',
  199. '4 47' => 'smc PENTAX-FA J 18-35mm F4-5.6 AL',
  200. #'4 49' => 'Tamron SP AF 28-75mm F2.8 XR Di (A09)',
  201. '4 49' => 'Tamron SP AF 28-75mm F2.8 XR Di LD Aspherical [IF] Macro', #25
  202. '4 51' => 'smc PENTAX-D FA 50mm F2.8 Macro',
  203. '4 52' => 'smc PENTAX-D FA 100mm F2.8 Macro',
  204. '4 55' => 'Samsung/Schneider D-XENOGON 35mm F2', #29
  205. '4 56' => 'Samsung/Schneider D-XENON 100mm F2.8 Macro', #Alan Robinson
  206. '4 75' => 'Tamron SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)', #JD
  207. '4 214' => 'smc PENTAX-DA 35mm F2.4 AL', #PH
  208. '4 229' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL II', #JD
  209. '4 230' => 'Tamron SP AF 17-50mm F2.8 XR Di II', #20
  210. '4 231' => 'smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]', #21
  211. '4 237' => 'Samsung/Schneider D-XENOGON 10-17mm F3.5-4.5', #JD
  212. '4 239' => 'Samsung/Schneider D-XENON 12-24mm F4 ED AL [IF]', #23
  213. '4 242' => 'smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM unused)', #Pietu Pohjalainen
  214. '4 243' => 'smc PENTAX-DA 70mm F2.4 Limited', #JD
  215. '4 244' => 'smc PENTAX-DA 21mm F3.2 AL Limited', #9
  216. '4 245' => 'Samsung/Schneider D-XENON 50-200mm F4-5.6', #15
  217. '4 246' => 'Samsung/Schneider D-XENON 18-55mm F3.5-5.6', #15
  218. '4 247' => 'smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]', #10
  219. '4 248' => 'smc PENTAX-DA 12-24mm F4 ED AL [IF]', #10
  220. '4 249' => 'Tamron XR DiII 18-200mm F3.5-6.3 (A14)',
  221. '4 250' => 'smc PENTAX-DA 50-200mm F4-5.6 ED', #8
  222. '4 251' => 'smc PENTAX-DA 40mm F2.8 Limited', #9
  223. '4 252' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL', #8
  224. '4 253' => 'smc PENTAX-DA 14mm F2.8 ED[IF]',
  225. '4 254' => 'smc PENTAX-DA 16-45mm F4 ED AL',
  226. '5 1' => 'smc PENTAX-FA* 24mm F2 AL[IF]',
  227. '5 2' => 'smc PENTAX-FA 28mm F2.8 AL',
  228. '5 3' => 'smc PENTAX-FA 50mm F1.7',
  229. '5 4' => 'smc PENTAX-FA 50mm F1.4',
  230. '5 5' => 'smc PENTAX-FA* 600mm F4 ED[IF]',
  231. '5 6' => 'smc PENTAX-FA* 300mm F4.5 ED[IF]',
  232. '5 7' => 'smc PENTAX-FA 135mm F2.8 [IF]',
  233. '5 8' => 'smc PENTAX-FA Macro 50mm F2.8',
  234. '5 9' => 'smc PENTAX-FA Macro 100mm F2.8',
  235. '5 10' => 'smc PENTAX-FA* 85mm F1.4 [IF]',
  236. '5 11' => 'smc PENTAX-FA* 200mm F2.8 ED[IF]',
  237. '5 12' => 'smc PENTAX-FA 28-80mm F3.5-4.7',
  238. '5 13' => 'smc PENTAX-FA 70-200mm F4-5.6',
  239. '5 14' => 'smc PENTAX-FA* 250-600mm F5.6 ED[IF]',
  240. '5 15' => 'smc PENTAX-FA 28-105mm F4-5.6',
  241. '5 16' => 'smc PENTAX-FA 100-300mm F4.5-5.6',
  242. '5 98' => 'smc PENTAX-FA 100-300mm F4.5-5.6', #JD (pre-production? - PH)
  243. '6 1' => 'smc PENTAX-FA* 85mm F1.4 [IF]',
  244. '6 2' => 'smc PENTAX-FA* 200mm F2.8 ED[IF]',
  245. '6 3' => 'smc PENTAX-FA* 300mm F2.8 ED[IF]',
  246. '6 4' => 'smc PENTAX-FA* 28-70mm F2.8 AL',
  247. '6 5' => 'smc PENTAX-FA* 80-200mm F2.8 ED[IF]',
  248. '6 6' => 'smc PENTAX-FA* 28-70mm F2.8 AL',
  249. '6 7' => 'smc PENTAX-FA* 80-200mm F2.8 ED[IF]',
  250. '6 8' => 'smc PENTAX-FA 28-70mm F4AL',
  251. '6 9' => 'smc PENTAX-FA 20mm F2.8',
  252. '6 10' => 'smc PENTAX-FA* 400mm F5.6 ED[IF]',
  253. '6 13' => 'smc PENTAX-FA* 400mm F5.6 ED[IF]',
  254. '6 14' => 'smc PENTAX-FA* Macro 200mm F4 ED[IF]',
  255. '7 0' => 'smc PENTAX-DA 21mm F3.2 AL Limited', #13
  256. '7 58' => 'smc PENTAX-D FA Macro 100mm F2.8 WR', #PH - this bit of information cost me $600 ;)
  257. '7 75' => 'Tamron SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)', #(Anton Bondar)
  258. '7 201' => 'smc Pentax-DA L 50-200mm F4-5.6 ED WR', #(Bruce Rusk)
  259. '7 202' => 'smc PENTAX-DA L 18-55mm F3.5-5.6 AL WR', #29
  260. '7 203' => 'HD PENTAX-DA 55-300mm F4-5.8 ED WR', #29
  261. '7 204' => 'HD PENTAX-DA 15mm F4 ED AL Limited', #forum5318
  262. '7 205' => 'HD PENTAX-DA 35mm F2.8 Macro Limited', #29
  263. '7 206' => 'HD PENTAX-DA 70mm F2.4 Limited', #29
  264. '7 207' => 'HD PENTAX-DA 21mm F3.2 ED AL Limited', #forum5327
  265. '7 208' => 'HD PENTAX-DA 40mm F2.8 Limited', #PH
  266. '7 212' => 'smc PENTAX-DA 50mm F1.8', #PH
  267. '7 213' => 'smc PENTAX-DA 40mm F2.8 XS', #PH
  268. '7 214' => 'smc PENTAX-DA 35mm F2.4 AL', #PH
  269. '7 216' => 'smc PENTAX-DA L 55-300mm F4-5.8 ED', #PH
  270. '7 217' => 'smc PENTAX-DA 50-200mm F4-5.6 ED WR', #JD
  271. '7 218' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL WR', #JD
  272. '7 220' => 'Tamron SP AF 10-24mm F3.5-4.5 Di II LD Aspherical [IF]', #24
  273. '7 221' => 'smc PENTAX-DA L 50-200mm F4-5.6 ED', #Ar't
  274. '7 222' => 'smc PENTAX-DA L 18-55mm F3.5-5.6', #PH (tag 0x003f -- was '7 229' in LensInfo of one test image)
  275. '7 223' => 'Samsung/Schneider D-XENON 18-55mm F3.5-5.6 II', #PH
  276. '7 224' => 'smc PENTAX-DA 15mm F4 ED AL Limited', #JD
  277. '7 225' => 'Samsung/Schneider D-XENON 18-250mm F3.5-6.3', #8/PH
  278. '7 226' => 'smc PENTAX-DA* 55mm F1.4 SDM (SDM unused)', #PH (NC)
  279. '7 227' => 'smc PENTAX-DA* 60-250mm F4 [IF] SDM (SDM unused)', #PH (NC)
  280. '7 228' => 'Samsung 16-45mm F4 ED', #29
  281. '7 229' => 'smc PENTAX-DA 18-55mm F3.5-5.6 AL II', #JD
  282. '7 230' => 'Tamron AF 17-50mm F2.8 XR Di-II LD (Model A16)', #JD
  283. '7 231' => 'smc PENTAX-DA 18-250mm F3.5-6.3 ED AL [IF]', #JD
  284. '7 233' => 'smc PENTAX-DA 35mm F2.8 Macro Limited', #JD
  285. '7 234' => 'smc PENTAX-DA* 300mm F4 ED [IF] SDM (SDM unused)', #19 (NC)
  286. '7 235' => 'smc PENTAX-DA* 200mm F2.8 ED [IF] SDM (SDM unused)', #PH (NC)
  287. '7 236' => 'smc PENTAX-DA 55-300mm F4-5.8 ED', #JD
  288. '7 238' => 'Tamron AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] Macro', #JD
  289. '7 241' => 'smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM (SDM unused)', #PH
  290. '7 242' => 'smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM unused)', #19
  291. '7 243' => 'smc PENTAX-DA 70mm F2.4 Limited', #PH
  292. '7 244' => 'smc PENTAX-DA 21mm F3.2 AL Limited', #16
  293. '8 0' => 'Sigma 50-150mm F2.8 II APO EX DC HSM', #forum2997
  294. '8 3' => 'Sigma AF 18-125mm F3.5-5.6 DC', #29
  295. '8 4' => 'Sigma 50mm F1.4 EX DG HSM', #Artur private communication
  296. '8 7' => 'Sigma 24-70mm F2.8 IF EX DG HSM', #Exiv2
  297. '8 8' => 'Sigma 18-250mm F3.5-6.3 DC OS HSM', #27
  298. '8 11' => 'Sigma 10-20mm F3.5 EX DC HSM', #27
  299. '8 12' => 'Sigma 70-300mm F4-5.6 DG OS', #forum3382
  300. '8 13' => 'Sigma 120-400mm F4.5-5.6 APO DG OS HSM', #26
  301. '8 14' => 'Sigma 17-70mm F2.8-4.0 DC Macro OS HSM', #(Hubert Meier)
  302. '8 15' => 'Sigma 150-500mm F5-6.3 APO DG OS HSM', #26
  303. '8 16' => 'Sigma 70-200mm F2.8 EX DG Macro HSM II', #26
  304. '8 17' => 'Sigma 50-500mm F4.5-6.3 DG OS HSM', #(Heike Herrmann) (also APO, ref 26)
  305. '8 18' => 'Sigma 8-16mm F4.5-5.6 DC HSM', #forum2998
  306. '8 21' => 'Sigma 17-50mm F2.8 EX DC OS HSM', #26
  307. '8 22' => 'Sigma 85mm F1.4 EX DG HSM', #26
  308. '8 23' => 'Sigma 70-200mm F2.8 APO EX DG OS HSM', #27
  309. '8 25' => 'Sigma 17-50mm F2.8 EX DC HSM', #Exiv2
  310. '8 27' => 'Sigma 18-200mm F3.5-6.3 II DC HSM', #27
  311. '8 28' => 'Sigma 18-250mm F3.5-6.3 DC Macro HSM', #27
  312. '8 29' => 'Sigma 35mm F1.4 DG HSM', #27
  313. '8 30' => 'Sigma 17-70mm F2.8-4 DC Macro HSM Contemporary', #27
  314. '8 31' => 'Sigma 18-35mm F1.8 DC HSM', #27
  315. '8 32' => 'Sigma 30mm F1.4 DC HSM | A', #27
  316. '8 34' => 'Sigma 18-300mm F3.5-6.3 DC Macro HSM', #25
  317. '8 59' => 'HD PENTAX-D FA 150-450mm F4.5-5.6 ED DC AW', #29
  318. '8 60' => 'HD PENTAX-D FA* 70-200mm F2.8 ED DC AW', #29
  319. '8 62' => 'HD PENTAX-D FA 24-70mm F2.8 ED SDM WR', #PH
  320. '8 198' => 'smc PENTAX-DA L 18-50mm F4-5.6 DC WR RE', #29
  321. '8 199' => 'HD PENTAX-DA 18-50mm F4-5.6 DC WR RE', #29
  322. '8 200' => 'HD PENTAX-DA 16-85mm F3.5-5.6 ED DC WR', #29
  323. '8 209' => 'HD PENTAX-DA 20-40mm F2.8-4 ED Limited DC WR', #29
  324. '8 210' => 'smc PENTAX-DA 18-270mm F3.5-6.3 ED SDM', #Helmut Schutz
  325. '8 211' => 'HD PENTAX-DA 560mm F5.6 ED AW', #PH
  326. '8 215' => 'smc PENTAX-DA 18-135mm F3.5-5.6 ED AL [IF] DC WR', #PH
  327. '8 226' => 'smc PENTAX-DA* 55mm F1.4 SDM', #JD
  328. '8 227' => 'smc PENTAX-DA* 60-250mm F4 [IF] SDM', #JD
  329. '8 232' => 'smc PENTAX-DA 17-70mm F4 AL [IF] SDM', #JD
  330. '8 234' => 'smc PENTAX-DA* 300mm F4 ED [IF] SDM', #19
  331. '8 235' => 'smc PENTAX-DA* 200mm F2.8 ED [IF] SDM', #JD
  332. '8 241' => 'smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM', #JD
  333. '8 242' => 'smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM', #JD
  334. '8 255' => 'Sigma Lens (8 255)',
  335. '8 255.1' => 'Sigma 70-200mm F2.8 EX DG Macro HSM II', #JD
  336. '8 255.2' => 'Sigma 150-500mm F5-6.3 DG APO [OS] HSM', #JD (non-OS version has same type, ref 29)
  337. '8 255.3' => 'Sigma 50-150mm F2.8 II APO EX DC HSM', #forum2997
  338. '8 255.4' => 'Sigma 4.5mm F2.8 EX DC HSM Circular Fisheye', #PH
  339. '8 255.5' => 'Sigma 50-200mm F4-5.6 DC OS', #26
  340. '8 255.6' => 'Sigma 24-70mm F2.8 EX DG HSM', #29
  341. #
  342. # 645 lenses
  343. #
  344. '9 0' => '645 Manual Lens', #PH (NC)
  345. '10 0' => '645 A Series Lens', #PH
  346. '11 1' => 'smc PENTAX-FA 645 75mm F2.8', #PH
  347. '11 2' => 'smc PENTAX-FA 645 45mm F2.8', #PH
  348. '11 3' => 'smc PENTAX-FA* 645 300mm F4 ED [IF]', #PH
  349. '11 4' => 'smc PENTAX-FA 645 45-85mm F4.5', #PH
  350. '11 5' => 'smc PENTAX-FA 645 400mm F5.6 ED [IF]', #PH
  351. '11 7' => 'smc PENTAX-FA 645 Macro 120mm F4', #PH
  352. '11 8' => 'smc PENTAX-FA 645 80-160mm F4.5', #PH
  353. '11 9' => 'smc PENTAX-FA 645 200mm F4 [IF]', #PH
  354. '11 10' => 'smc PENTAX-FA 645 150mm F2.8 [IF]', #PH
  355. '11 11' => 'smc PENTAX-FA 645 35mm F3.5 AL [IF]', #PH
  356. '11 12' => 'smc PENTAX-FA 645 300mm F5.6 ED [IF]', #29
  357. '11 14' => 'smc PENTAX-FA 645 55-110mm F5.6', #PH
  358. '11 16' => 'smc PENTAX-FA 645 33-55mm F4.5 AL', #PH
  359. '11 17' => 'smc PENTAX-FA 645 150-300mm F5.6 ED [IF]', #PH
  360. '11 21' => 'HD PENTAX-D FA 645 35mm F3.5 AL [IF]', #29
  361. '13 18' => 'smc PENTAX-D FA 645 55mm F2.8 AL [IF] SDM AW', #PH
  362. '13 19' => 'smc PENTAX-D FA 645 25mm F4 AL [IF] SDM AW', #PH
  363. '13 20' => 'HD PENTAX-D FA 645 90mm F2.8 ED AW SR', #PH
  364. '13 253' => 'HD PENTAX-DA 645 28-45mm F4.5 ED AW SR', #Dominique Schrekling email
  365. # missing:
  366. # 'smc PENTAX-DA 645 25mm F4.0 AL SDM AW [IF]' ? different than D FA version?
  367. #
  368. # Q-mount lenses (21=auto focus lens, 22=manual focus)
  369. #
  370. '21 0' => 'Pentax Q Manual Lens', #PH
  371. '21 1' => '01 Standard Prime 8.5mm F1.9', #PH
  372. '21 2' => '02 Standard Zoom 5-15mm F2.8-4.5', #PH
  373. '22 3' => '03 Fish-eye 3.2mm F5.6', #PH
  374. '22 4' => '04 Toy Lens Wide 6.3mm F7.1', #PH
  375. '22 5' => '05 Toy Lens Telephoto 18mm F8', #PH
  376. '21 6' => '06 Telephoto Zoom 15-45mm F2.8', #PH
  377. '21 7' => '07 Mount Shield 11.5mm F9', #PH (NC)
  378. '21 8' => '08 Wide Zoom 3.8-5.9mm F3.7-4', #PH (NC)
  379. );
  380. # Pentax model ID codes - PH
  381. my %pentaxModelID = (
  382. 0x0000d => 'Optio 330/430',
  383. 0x12926 => 'Optio 230',
  384. 0x12958 => 'Optio 330GS',
  385. 0x12962 => 'Optio 450/550',
  386. 0x1296c => 'Optio S',
  387. 0x12971 => 'Optio S V1.01',
  388. 0x12994 => '*ist D',
  389. 0x129b2 => 'Optio 33L',
  390. 0x129bc => 'Optio 33LF',
  391. 0x129c6 => 'Optio 33WR/43WR/555',
  392. 0x129d5 => 'Optio S4',
  393. 0x12a02 => 'Optio MX',
  394. 0x12a0c => 'Optio S40',
  395. 0x12a16 => 'Optio S4i',
  396. 0x12a34 => 'Optio 30',
  397. 0x12a52 => 'Optio S30',
  398. 0x12a66 => 'Optio 750Z',
  399. 0x12a70 => 'Optio SV',
  400. 0x12a75 => 'Optio SVi',
  401. 0x12a7a => 'Optio X',
  402. 0x12a8e => 'Optio S5i',
  403. 0x12a98 => 'Optio S50',
  404. 0x12aa2 => '*ist DS',
  405. 0x12ab6 => 'Optio MX4',
  406. 0x12ac0 => 'Optio S5n',
  407. 0x12aca => 'Optio WP',
  408. 0x12afc => 'Optio S55',
  409. 0x12b10 => 'Optio S5z',
  410. 0x12b1a => '*ist DL',
  411. 0x12b24 => 'Optio S60',
  412. 0x12b2e => 'Optio S45',
  413. 0x12b38 => 'Optio S6',
  414. 0x12b4c => 'Optio WPi', #13
  415. 0x12b56 => 'BenQ DC X600',
  416. 0x12b60 => '*ist DS2',
  417. 0x12b62 => 'Samsung GX-1S',
  418. 0x12b6a => 'Optio A10',
  419. 0x12b7e => '*ist DL2',
  420. 0x12b80 => 'Samsung GX-1L',
  421. 0x12b9c => 'K100D',
  422. 0x12b9d => 'K110D',
  423. 0x12ba2 => 'K100D Super', #JD
  424. 0x12bb0 => 'Optio T10/T20',
  425. 0x12be2 => 'Optio W10',
  426. 0x12bf6 => 'Optio M10',
  427. 0x12c1e => 'K10D',
  428. 0x12c20 => 'Samsung GX10',
  429. 0x12c28 => 'Optio S7',
  430. 0x12c2d => 'Optio L20',
  431. 0x12c32 => 'Optio M20',
  432. 0x12c3c => 'Optio W20',
  433. 0x12c46 => 'Optio A20',
  434. 0x12c78 => 'Optio E30',
  435. 0x12c7d => 'Optio E35',
  436. 0x12c82 => 'Optio T30',
  437. 0x12c8c => 'Optio M30',
  438. 0x12c91 => 'Optio L30',
  439. 0x12c96 => 'Optio W30',
  440. 0x12ca0 => 'Optio A30',
  441. 0x12cb4 => 'Optio E40',
  442. 0x12cbe => 'Optio M40',
  443. 0x12cc3 => 'Optio L40',
  444. 0x12cc5 => 'Optio L36',
  445. 0x12cc8 => 'Optio Z10',
  446. 0x12cd2 => 'K20D',
  447. 0x12cd4 => 'Samsung GX20', #8
  448. 0x12cdc => 'Optio S10',
  449. 0x12ce6 => 'Optio A40',
  450. 0x12cf0 => 'Optio V10',
  451. 0x12cfa => 'K200D',
  452. 0x12d04 => 'Optio S12',
  453. 0x12d0e => 'Optio E50',
  454. 0x12d18 => 'Optio M50',
  455. 0x12d22 => 'Optio L50',
  456. 0x12d2c => 'Optio V20',
  457. 0x12d40 => 'Optio W60',
  458. 0x12d4a => 'Optio M60',
  459. 0x12d68 => 'Optio E60/M90',
  460. 0x12d72 => 'K2000',
  461. 0x12d73 => 'K-m',
  462. 0x12d86 => 'Optio P70',
  463. 0x12d90 => 'Optio L70',
  464. 0x12d9a => 'Optio E70',
  465. 0x12dae => 'X70',
  466. 0x12db8 => 'K-7',
  467. 0x12dcc => 'Optio W80',
  468. 0x12dea => 'Optio P80',
  469. 0x12df4 => 'Optio WS80',
  470. 0x12dfe => 'K-x',
  471. 0x12e08 => '645D',
  472. 0x12e12 => 'Optio E80',
  473. 0x12e30 => 'Optio W90',
  474. 0x12e3a => 'Optio I-10',
  475. 0x12e44 => 'Optio H90',
  476. 0x12e4e => 'Optio E90',
  477. 0x12e58 => 'X90',
  478. 0x12e6c => 'K-r',
  479. 0x12e76 => 'K-5',
  480. 0x12e8a => 'Optio RS1000/RS1500',
  481. 0x12e94 => 'Optio RZ10',
  482. 0x12e9e => 'Optio LS1000',
  483. 0x12ebc => 'Optio WG-1 GPS',
  484. 0x12ed0 => 'Optio S1',
  485. 0x12ee4 => 'Q',
  486. 0x12ef8 => 'K-01',
  487. 0x12f0c => 'Optio RZ18',
  488. 0x12f16 => 'Optio VS20',
  489. 0x12f2a => 'Optio WG-2 GPS',
  490. 0x12f48 => 'Optio LS465',
  491. 0x12f52 => 'K-30',
  492. 0x12f5c => 'X-5',
  493. 0x12f66 => 'Q10',
  494. 0x12f70 => 'K-5 II',
  495. 0x12f71 => 'K-5 II s', #forum4515
  496. 0x12f7a => 'Q7',
  497. 0x12f84 => 'MX-1',
  498. 0x12f8e => 'WG-3 GPS',
  499. 0x12f98 => 'WG-3',
  500. 0x12fa2 => 'WG-10',
  501. 0x12fb6 => 'K-50',
  502. 0x12fc0 => 'K-3', #29
  503. 0x12fca => 'K-500',
  504. 0x12fe8 => 'WG-4', # (Ricoh)
  505. 0x12fde => 'WG-4 GPS', # (Ricoh)
  506. 0x13006 => 'WG-20', # (Ricoh)
  507. 0x13010 => '645Z',
  508. 0x1301a => 'K-S1',
  509. 0x13024 => 'K-S2', #29 (Ricoh)
  510. 0x1302e => 'Q-S1',
  511. 0x13056 => 'WG-30', # (Ricoh)
  512. 0x1307e => 'WG-30W', # (Ricoh)
  513. 0x13088 => 'WG-5 GPS', # (Ricoh)
  514. 0x1309c => 'K-3 II', #29 (Ricoh)
  515. );
  516. # Pentax city codes - (PH, Optio WP)
  517. my %pentaxCities = (
  518. 0 => 'Pago Pago',
  519. 1 => 'Honolulu',
  520. 2 => 'Anchorage',
  521. 3 => 'Vancouver',
  522. 4 => 'San Francisco',
  523. 5 => 'Los Angeles',
  524. 6 => 'Calgary',
  525. 7 => 'Denver',
  526. 8 => 'Mexico City',
  527. 9 => 'Chicago',
  528. 10 => 'Miami',
  529. 11 => 'Toronto',
  530. 12 => 'New York',
  531. 13 => 'Santiago',
  532. 14 => 'Caracus',
  533. 15 => 'Halifax',
  534. 16 => 'Buenos Aires',
  535. 17 => 'Sao Paulo',
  536. 18 => 'Rio de Janeiro',
  537. 19 => 'Madrid',
  538. 20 => 'London',
  539. 21 => 'Paris',
  540. 22 => 'Milan',
  541. 23 => 'Rome',
  542. 24 => 'Berlin',
  543. 25 => 'Johannesburg',
  544. 26 => 'Istanbul',
  545. 27 => 'Cairo',
  546. 28 => 'Jerusalem',
  547. 29 => 'Moscow',
  548. 30 => 'Jeddah',
  549. 31 => 'Tehran',
  550. 32 => 'Dubai',
  551. 33 => 'Karachi',
  552. 34 => 'Kabul',
  553. 35 => 'Male',
  554. 36 => 'Delhi',
  555. 37 => 'Colombo',
  556. 38 => 'Kathmandu',
  557. 39 => 'Dacca',
  558. 40 => 'Yangon',
  559. 41 => 'Bangkok',
  560. 42 => 'Kuala Lumpur',
  561. 43 => 'Vientiane',
  562. 44 => 'Singapore',
  563. 45 => 'Phnom Penh',
  564. 46 => 'Ho Chi Minh',
  565. 47 => 'Jakarta',
  566. 48 => 'Hong Kong',
  567. 49 => 'Perth',
  568. 50 => 'Beijing',
  569. 51 => 'Shanghai',
  570. 52 => 'Manila',
  571. 53 => 'Taipei',
  572. 54 => 'Seoul',
  573. 55 => 'Adelaide',
  574. 56 => 'Tokyo',
  575. 57 => 'Guam',
  576. 58 => 'Sydney',
  577. 59 => 'Noumea',
  578. 60 => 'Wellington',
  579. 61 => 'Auckland',
  580. 62 => 'Lima',
  581. 63 => 'Dakar',
  582. 64 => 'Algiers',
  583. 65 => 'Helsinki',
  584. 66 => 'Athens',
  585. 67 => 'Nairobi',
  586. 68 => 'Amsterdam',
  587. 69 => 'Stockholm',
  588. 70 => 'Lisbon', #14
  589. 71 => 'Copenhagen', #25
  590. 72 => 'Warsaw',
  591. 73 => 'Prague',
  592. 74 => 'Budapest',
  593. );
  594. # digital filter tag information (ref PH, K-5)
  595. # (also see %filterSettings below for decoding of filter parameters)
  596. my %digitalFilter = (
  597. Format => 'undef[17]',
  598. RawConv => '($val!~/^\\0/ or $$self{OPTIONS}{Unknown}) ? join(" ",unpack("Cc*",$val)) : undef',
  599. SeparateTable => 'DigitalFilter',
  600. ValueConvInv => q{
  601. return "\0" x 17 if $val eq "0";
  602. $val = pack("Cc*", $val=~/[-+]?\d+/g);
  603. length($val)==17 or warn("Expecting 17 values\n"), return undef;
  604. return $val;
  605. },
  606. PrintConv => {
  607. OTHER => \&PrintFilter, # this routine actually converts all values
  608. 0 => 'Off',
  609. 1 => 'Base Parameter Adjust',
  610. 2 => 'Soft Focus',
  611. 3 => 'High Contrast',
  612. 4 => 'Color Filter',
  613. 5 => 'Extract Color',
  614. 6 => 'Monochrome',
  615. 7 => 'Slim',
  616. 9 => 'Fisheye',
  617. 10 => 'Toy Camera',
  618. 11 => 'Retro',
  619. 12 => 'Pastel',
  620. 13 => 'Water Color',
  621. 14 => 'HDR',
  622. 16 => 'Miniature',
  623. 17 => 'Starburst',
  624. 18 => 'Posterization',
  625. 19 => 'Sketch Filter',
  626. 20 => 'Shading', # (Q)
  627. 21 => 'Invert Color', # (Q)
  628. 23 => 'Tone Expansion', #Forum5247
  629. 254 => 'Custom Filter',
  630. },
  631. );
  632. # digital filter setting names and conversions (ref PH, K-5)
  633. # Note: names must be unique for writing
  634. my %filterSettings = (
  635. 1 => ['Brightness', '%+d'], # BPA (-8-+8)
  636. 2 => ['Saturation', '%+d'], # BPA (-3-+3)
  637. 3 => ['Hue', '%+d'], # BPA (-3-+3)
  638. 4 => ['Contrast', '%+d'], # BPA (-3-+3)
  639. 5 => ['Sharpness', '%+d'], # BPA (-3-+3)
  640. 6 => ['SoftFocus', '%d'], # Soft Focus/Custom (1-3)
  641. 7 => ['ShadowBlur', { 0=>'Off',1=>'On' }], # Soft Focus
  642. 8 => ['HighContrast', '%d'], # High Contrast/Custom (1-5)
  643. 9 => ['Color', { 1=>'Red',2=>'Magenta',3=>'Blue',4=>'Cyan',5=>'Green',6=>'Yellow' }], # Color Filter
  644. 10 => ['Density', { 1=>'Light',2=>'Standard',3=>'Dark' }], # Color Filter
  645. 11 => ['ExtractedColor',{ 0=>'Off',1=>'Red',2=>'Magenta',3=>'Blue',4=>'Cyan',5=>'Green',6=>'Yellow' }], # ExtractColor [x2]
  646. 12 => ['ColorRange', '%+d'], # ExtractColor [x2] (-2-+2)
  647. 13 => ['FilterEffect', { 0=>'Off',1=>'Red',2=>'Green',3=>'Blue',4=>'Infrared'}], # Monochrome
  648. 14 => ['ToningBA', '%+d'], # Monochrome (-3-+3)
  649. 15 => ['InvertColor', { 0=>'Off',1=>'On' }], # Custom/Invert Color
  650. 16 => ['Slim', '%+d'], # Slim (-8-+8)
  651. 17 => ['EffectDensity', { 1=>'Sparse',2=>'Normal',3=>'Dense' }], # Starburst
  652. 18 => ['Size', { 1=>'Small',2=>'Medium',3=>'Large' }], # Starburst
  653. 19 => ['Angle', { 0=>'0deg',2=>'30deg',3=>'45deg',4=>'60deg'}], # Starburst (1 is unused)
  654. 20 => ['Fisheye', { 1=>'Weak',2=>'Medium',3=>'Strong' }], # Fisheye
  655. 21 => ['DistortionType', '%d'], # Custom (1-3)
  656. 22 => ['DistortionLevel',{0=>'Off',1=>'Weak',2=>'Medium',3=>'Strong' }], #Custom
  657. 23 => ['ShadingType', '%d'], # Custom/Shading (1-6)
  658. 24 => ['ShadingLevel', '%+d'], # Custom/Shading (-3-+3)
  659. 25 => ['Shading', '%d'], # Toy Camera (1-3)
  660. 26 => ['Blur', '%d'], # Toy Camera (1-3)
  661. 27 => ['ToneBreak', { 0=>'Off',1=>'Red',2=>'Green',3=>'Blue',4=>'Yellow'}], # Toy Camera/Custom
  662. 28 => ['Toning', '%+d'], # Retro (-3-+3)
  663. 29 => ['FrameComposite',{ 0=>'None',1=>'Thin',2=>'Medium',3=>'Thick' }], # Retro
  664. 30 => ['PastelStrength',{ 1=>'Weak',2=>'Medium',3=>'Strong' }], # Pastel
  665. 31 => ['Intensity', '%d'], # Water Color (1-3)
  666. 32 => ['Saturation2', { 0=>'Off',1=>'Low',2=>'Medium',3=>'High' }], # Water Color
  667. 33 => ['HDR', { 1=>'Weak',2=>'Medium',3=>'Strong' }], # HDR
  668. # (34 missing)
  669. 35 => ['FocusPlane', '%+d'], # Miniature (-3-+3)
  670. 36 => ['FocusWidth', { 1=>'Narrow',2=>'Middle',3=>'Wide' }], # Miniature
  671. 37 => ['PlaneAngle', { 0=>'Horizontal',1=>'Vertical',2=>'Positive slope',3=>'Negative slope' }], # Miniature
  672. 38 => ['Blur2', '%d'], # Miniature (1-3)
  673. 39 => ['Shape', { 1=>'Cross',2=>'Star',3=>'Snowflake',4=>'Heart',5=>'Note'}], # Starburst
  674. 40 => ['Posterization', '%d'], # Posterization (1-5)
  675. 41 => ['Contrast2', { 1=>'Low',2=>'Medium',3=>'High'}], # Sketch Filter
  676. 42 => ['ScratchEffect', { 0=>'Off',1=>'On' }], # Sketch Filter
  677. 45 => ['ToneExpansion', { 1=>'Low',2=>'Medium',3=>'High' }], # Tone Expansion (ref Forum5247)
  678. );
  679. # decoding for Pentax Firmware ID tags - PH
  680. my %pentaxFirmwareID = (
  681. # the first 2 numbers are the firmware version, I'm not sure what the second 2 mean
  682. # Note: the byte order may be different for some models
  683. # which give, for example, version 0.01 instead of 1.00
  684. ValueConv => sub {
  685. my $val = shift;
  686. return $val unless length($val) == 4;
  687. # (value is encrypted by toggling all bits)
  688. my @a = map { $_ ^ 0xff } unpack("C*",$val);
  689. return sprintf('%d %.2d %.2d %.2d', @a);
  690. },
  691. ValueConvInv => sub {
  692. my $val = shift;
  693. my @a = $val=~/\b\d+\b/g;
  694. return $val unless @a == 4;
  695. @a = map { ($_ & 0xff) ^ 0xff } @a;
  696. return pack("C*", @a);
  697. },
  698. PrintConv => '$val=~tr/ /./; $val',
  699. PrintConvInv => '$val=~s/^(\d+)\.(\d+)\.(\d+)\.(\d+)/$1 $2 $3 $4/ ? $val : undef',
  700. );
  701. # convert 16 or 77 metering segment values to approximate LV equivalent - PH
  702. my %convertMeteringSegments = (
  703. PrintConv => sub { join ' ', map(
  704. { $_==255 ? 'n/a' : $_==0 ? '0' : sprintf '%.1f', $_ / 8 - 6 } split(' ',$_[0])
  705. ) },
  706. PrintConvInv => sub { join ' ', map(
  707. { /^n/i ? 255 : $_==0 ? '0' : int(($_ + 6) * 8 + 0.5) } split(' ',$_[0])
  708. ) },
  709. );
  710. # lens code conversions
  711. my %lensCode = (
  712. Unknown => 1,
  713. PrintConv => 'sprintf("0x%.2x", $val)',
  714. PrintConvInv => 'hex($val)',
  715. );
  716. # conversions for tags 0x0053-0x005a
  717. my %colorTemp = (
  718. Writable => 'undef',
  719. Count => 4,
  720. ValueConv => sub {
  721. my $val = shift;
  722. return $val unless length $val == 4;
  723. my @a = unpack 'nCC', $val;
  724. $a[0] = 53190 - $a[0];
  725. $a[1] = ($a[2] & 0x0f); $a[1] -= 16 if $a[1] >= 8;
  726. $a[2] = ($a[2] >> 4); $a[2] -= 16 if $a[2] >= 8;
  727. return "@a";
  728. },
  729. ValueConvInv => sub {
  730. my $val = shift;
  731. my @a = split ' ', $val;
  732. return undef unless @a == 3;
  733. return pack 'nCC', 53190 - $a[0], 0, ($a[1] & 0x0f) + (($a[2] & 0x0f) << 4);
  734. },
  735. PrintConv => sub {
  736. $_ = shift;
  737. s/ ([1-9])/ +$1/g;
  738. s/ 0/ 0/g;
  739. return $_;
  740. },
  741. PrintConvInv => '$val',
  742. );
  743. # conversions for KelvinWB tags
  744. my %kelvinWB = (
  745. Format => 'int16u[4]',
  746. ValueConv => sub {
  747. my @a = split ' ', shift;
  748. (53190 - $a[0]) . ' ' . $a[1] . ' ' . ($a[2] / 8192) . ' ' . ($a[3] / 8192);
  749. },
  750. ValueConvInv => sub {
  751. my @a = split ' ', shift;
  752. (53190 - $a[0]) . ' ' . $a[1] . ' ' . int($a[2]*8192+0.5) . ' ' . int($a[3]*8192+0.5);
  753. },
  754. );
  755. # common attributes for writable BinaryData directories
  756. my %binaryDataAttrs = (
  757. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  758. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  759. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  760. WRITABLE => 1,
  761. FIRST_ENTRY => 0,
  762. );
  763. # Pentax makernote tags
  764. %Image::ExifTool::Pentax::Main = (
  765. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  766. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  767. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  768. WRITABLE => 1,
  769. 0x0000 => { #5
  770. Name => 'PentaxVersion',
  771. Writable => 'int8u',
  772. Count => 4,
  773. PrintConv => '$val=~tr/ /./; $val',
  774. PrintConvInv => '$val=~tr/./ /; $val',
  775. # 0.1.0.3 - PENTAX Optio E40
  776. # 3.0.0.0 - K10D
  777. # 3.1.0.0 - Optio A40/S10/L36/L40/M40/V10
  778. # 3.1.2.0 - Optio Z10
  779. # 4.0.2.0 - Optio E50
  780. # 4.1.0.0 - Optio S12
  781. # 4.1.1.0 - Optio M50
  782. # 4.1.2.0 - K20D, K200D
  783. # 4.2.0.0 - Optio L50/V20
  784. # 4.2.1.0 - Optio E60/M90
  785. # 4.2.2.0 - Optio W60
  786. # 4.2.3.0 - Optio M60
  787. # 4.4.0.1 - K-m, K2000
  788. # 4.5.0.0 - Optio E70/L70
  789. # 4.5.0.0 - Optio P70
  790. # 4.6.0.0 - Optio E80/E90/W80
  791. # 5.0.0.0 - K-7, Optio P80/WS80
  792. # 5.1.0.0 - K-x
  793. # 5.2.0.0 - Optio I-10
  794. # 5.3.0.0 - Optio H90
  795. # 5.3.2.0 - Optio W90
  796. # 6.0.0.0 - K-r, 645D
  797. # 6.1.3.0 - Optio LS1000/RS1000/RS1500/RZ10
  798. # 7.0.0.0 - K-5
  799. # 7.1.0.0 - Optio WG-1GPS/WG-10
  800. # 7.2.0.0 - Optio S1
  801. # 8.0.0.0 - Q
  802. # 8.0.1.0 - Optio RZ18
  803. # 8.0.4.0 - Optio VS20
  804. # 8.1.0.0 - Optio LS465/WG-2GPS
  805. # 9.0.0.0 - K-01
  806. # 9.1.2.0 - X-5
  807. # 10.0.0.0 - K-30, K-50, K-500, K-5 II
  808. # 10.0.2.0 - Q10
  809. # 10.2.0.0 - WG-3
  810. # 10.2.1.0 - MX-1
  811. # 10.4.1.0 - WG-3 GPS
  812. # 10.6.1.0 - Q-S1, Q7
  813. # 11.0.0.0 - K-3
  814. # 11.2.1.0 - 645Z
  815. # 11.3.0.0 - K-S1
  816. # 11.5.0.0 - K-S2
  817. # 11.6.1.0 - K-3 II
  818. },
  819. 0x0001 => { #PH
  820. Name => 'PentaxModelType',
  821. Writable => 'int16u',
  822. # (values of 0-5 seem to group models into 6 categories, ref 13)
  823. },
  824. 0x0002 => { #PH
  825. Name => 'PreviewImageSize',
  826. Groups => { 2 => 'Image' },
  827. Writable => 'int16u',
  828. Count => 2,
  829. PrintConv => '$val =~ tr/ /x/; $val',
  830. PrintConvInv => '$val =~ tr/x/ /; $val',
  831. },
  832. 0x0003 => { #PH
  833. Name => 'PreviewImageLength',
  834. OffsetPair => 0x0004, # point to associated offset
  835. DataTag => 'PreviewImage',
  836. Groups => { 2 => 'Image' },
  837. Writable => 'int32u',
  838. Protected => 2,
  839. },
  840. 0x0004 => { #PH
  841. Name => 'PreviewImageStart',
  842. IsOffset => 2, # code to use original base
  843. Protected => 2,
  844. OffsetPair => 0x0003, # point to associated byte count
  845. DataTag => 'PreviewImage',
  846. Groups => { 2 => 'Image' },
  847. Writable => 'int32u',
  848. },
  849. 0x0005 => { #13
  850. Name => 'PentaxModelID',
  851. Writable => 'int32u',
  852. PrintHex => 1,
  853. SeparateTable => 1,
  854. DataMember => 'PentaxModelID',
  855. RawConv => '$$self{PentaxModelID} = $val',
  856. PrintConv => \%pentaxModelID,
  857. },
  858. 0x0006 => { #5
  859. # Note: Year is int16u in MM byte ordering regardless of EXIF byte order
  860. Name => 'Date',
  861. Groups => { 2 => 'Time' },
  862. Notes => 'changing either Date or Time will affect ShutterCount decryption',
  863. Writable => 'undef',
  864. Count => 4,
  865. Shift => 'Time',
  866. DataMember => 'PentaxDate',
  867. RawConv => '$$self{PentaxDate} = $val', # save to decrypt ShutterCount
  868. ValueConv => 'length($val)==4 ? sprintf("%.4d:%.2d:%.2d",unpack("nC2",$val)) : "Unknown ($val)"',
  869. ValueConvInv => q{
  870. $val =~ s/(\d) .*/$1/; # remove Time
  871. my @v = split /:/, $val;
  872. return pack("nC2",$v[0],$v[1],$v[2]);
  873. },
  874. },
  875. 0x0007 => { #5
  876. Name => 'Time',
  877. Groups => { 2 => 'Time' },
  878. Writable => 'undef',
  879. Count => 3,
  880. Shift => 'Time',
  881. DataMember => 'PentaxTime',
  882. RawConv => '$$self{PentaxTime} = $val', # save to decrypt ShutterCount
  883. ValueConv => 'length($val)>=3 ? sprintf("%.2d:%.2d:%.2d",unpack("C3",$val)) : "Unknown ($val)"',
  884. ValueConvInv => q{
  885. $val =~ s/^[0-9:]+ (\d)/$1/; # remove Date
  886. return pack("C3",split(/:/,$val));
  887. },
  888. },
  889. 0x0008 => { #2
  890. Name => 'Quality',
  891. Writable => 'int16u',
  892. PrintConvColumns => 2,
  893. PrintConv => {
  894. 0 => 'Good',
  895. 1 => 'Better',
  896. 2 => 'Best',
  897. 3 => 'TIFF', #5
  898. 4 => 'RAW', #5
  899. 5 => 'Premium', #PH (K20D)
  900. 7 => 'RAW (pixel shift enabled)', #forum6536 (K-3 II)
  901. 65535 => 'n/a', #PH (Q MOV video)
  902. },
  903. },
  904. 0x0009 => { #3
  905. Name => 'PentaxImageSize',
  906. Groups => { 2 => 'Image' },
  907. Writable => 'int16u',
  908. PrintConvColumns => 2,
  909. PrintConv => {
  910. 0 => '640x480',
  911. 1 => 'Full', #PH - this can mean 2048x1536 or 2240x1680 or ... ?
  912. 2 => '1024x768',
  913. 3 => '1280x960', #PH (Optio WP)
  914. 4 => '1600x1200',
  915. 5 => '2048x1536',
  916. 8 => '2560x1920 or 2304x1728', #PH (Optio WP) or #14
  917. 9 => '3072x2304', #PH (Optio M30)
  918. 10 => '3264x2448', #13
  919. 19 => '320x240', #PH (Optio WP)
  920. 20 => '2288x1712', #13
  921. 21 => '2592x1944',
  922. 22 => '2304x1728 or 2592x1944', #2 or #14
  923. 23 => '3056x2296', #13
  924. 25 => '2816x2212 or 2816x2112', #13 or #14
  925. 27 => '3648x2736', #PH (Optio A20)
  926. 29 => '4000x3000', #PH (X70)
  927. 30 => '4288x3216', #PH (Optio RS1000)
  928. 31 => '4608x3456', #PH (Optio RZ18)
  929. 129 => '1920x1080', #PH (Optio RZ10)
  930. 135 => '4608x2592', #PH (Q10 stretch filter)
  931. 257 => '3216x3216', #PH (Optio RZ10)
  932. '0 0' => '2304x1728', #13
  933. '4 0' => '1600x1200', #PH (Optio MX4)
  934. '5 0' => '2048x1536', #13
  935. '8 0' => '2560x1920', #13
  936. '32 2' => '960x640', #7
  937. '33 2' => '1152x768', #7
  938. '34 2' => '1536x1024', #7
  939. '35 1' => '2400x1600', #7
  940. '36 0' => '3008x2008 or 3040x2024', #PH
  941. '37 0' => '3008x2000', #13
  942. # 65535 - seen for an X-5 panorama (PH)
  943. },
  944. },
  945. 0x000b => { #3
  946. Name => 'PictureMode',
  947. Writable => 'int16u',
  948. Count => -1,
  949. Notes => q{
  950. 1 or 2 values. Decimal values differentiate Optio 555 modes which are
  951. different from other models
  952. },
  953. ValueConv => '(IsInt($val) and $val < 4 and $$self{Model} =~ /Optio 555\b/) ? $val + 0.1 : $val',
  954. ValueConvInv => 'int $val',
  955. PrintConvColumns => 2,
  956. PrintConv => [{
  957. 0 => 'Program', #PH
  958. 0.1 => 'Av', #PH (Optio 555)
  959. 1 => 'Shutter Speed Priority', #JD
  960. 1.1 => 'M', #PH (Optio 555)
  961. 2 => 'Program AE', #13
  962. 2.1 => 'Tv', #PH (Optio 555)
  963. 3 => 'Manual', #13
  964. 3.1 => 'USER', #PH (Optio 555)
  965. 5 => 'Portrait',
  966. 6 => 'Landscape',
  967. 8 => 'Sport', #PH
  968. 9 => 'Night Scene',
  969. # 10 "full mode"? #13
  970. 11 => 'Soft', #PH
  971. 12 => 'Surf & Snow',
  972. 13 => 'Candlelight', #13
  973. 14 => 'Autumn',
  974. 15 => 'Macro',
  975. 17 => 'Fireworks',
  976. 18 => 'Text',
  977. 19 => 'Panorama', #PH
  978. 20 => '3-D', #PH (Optio 555)
  979. 21 => 'Black & White', #PH (Optio 555)
  980. 22 => 'Sepia', #PH (Optio 555)
  981. 23 => 'Red', #PH (Optio 555)
  982. 24 => 'Pink', #PH (Optio 555)
  983. 25 => 'Purple', #PH (Optio 555)
  984. 26 => 'Blue', #PH (Optio 555)
  985. 27 => 'Green', #PH (Optio 555)
  986. 28 => 'Yellow', #PH (Optio 555)
  987. 30 => 'Self Portrait', #PH
  988. 31 => 'Illustrations', #13
  989. 33 => 'Digital Filter', #13
  990. 35 => 'Night Scene Portrait', #25
  991. 37 => 'Museum', #PH
  992. 38 => 'Food', #PH
  993. 39 => 'Underwater', #25
  994. 40 => 'Green Mode', #PH
  995. 49 => 'Light Pet', #PH
  996. 50 => 'Dark Pet', #PH
  997. 51 => 'Medium Pet', #PH
  998. 53 => 'Underwater', #PH
  999. 54 => 'Candlelight', #PH
  1000. 55 => 'Natural Skin Tone', #PH
  1001. 56 => 'Synchro Sound Record', #PH
  1002. 58 => 'Frame Composite', #14
  1003. 59 => 'Report', #25
  1004. 60 => 'Kids', #13
  1005. 61 => 'Blur Reduction', #13
  1006. 63 => 'Panorama 2', #PH (X-5)
  1007. 65 => 'Half-length Portrait', #JD
  1008. 66 => 'Portrait 2', #PH (LS645)
  1009. 74 => 'Digital Microscope', #PH (WG-4)
  1010. 75 => 'Blue Sky', #PH (LS465)
  1011. 80 => 'Miniature', #PH (VS20)
  1012. 81 => 'HDR', #PH (LS465)
  1013. 83 => 'Fisheye', #PH (VS20)
  1014. 85 => 'Digital Filter 4', #PH (WG-5)
  1015. 221 => 'P', #PH (Optio 555)
  1016. 255=> 'PICT', #PH (Optio 555)
  1017. }],
  1018. },
  1019. 0x000c => { #PH
  1020. Name => 'FlashMode',
  1021. Writable => 'int16u',
  1022. Count => -1,
  1023. PrintHex => 1,
  1024. PrintConv => [{
  1025. 0x000 => 'Auto, Did not fire',
  1026. 0x001 => 'Off, Did not fire',
  1027. 0x002 => 'On, Did not fire', #19
  1028. 0x003 => 'Auto, Did not fire, Red-eye reduction',
  1029. 0x005 => 'On, Did not fire, Wireless (Master)', #19
  1030. 0x100 => 'Auto, Fired',
  1031. 0x102 => 'On, Fired',
  1032. 0x103 => 'Auto, Fired, Red-eye reduction',
  1033. 0x104 => 'On, Red-eye reduction',
  1034. 0x105 => 'On, Wireless (Master)', #19
  1035. 0x106 => 'On, Wireless (Control)', #19
  1036. 0x108 => 'On, Soft',
  1037. 0x109 => 'On, Slow-sync',
  1038. 0x10a => 'On, Slow-sync, Red-eye reduction',
  1039. 0x10b => 'On, Trailing-curtain Sync',
  1040. },{ #19 (AF-540FGZ flash)
  1041. 0x000 => 'n/a - Off-Auto-Aperture', #19
  1042. 0x03f => 'Internal',
  1043. 0x100 => 'External, Auto',
  1044. 0x23f => 'External, Flash Problem', #JD
  1045. 0x300 => 'External, Manual',
  1046. 0x304 => 'External, P-TTL Auto',
  1047. 0x305 => 'External, Contrast-control Sync', #JD
  1048. 0x306 => 'External, High-speed Sync',
  1049. 0x30c => 'External, Wireless',
  1050. 0x30d => 'External, Wireless, High-speed Sync',
  1051. }],
  1052. },
  1053. 0x000d => [ #2
  1054. {
  1055. Name => 'FocusMode',
  1056. # (can't test for "PENTAX" because MOV videos don't have Make)
  1057. Condition => '$$self{Make} !~ /^Asahi/',
  1058. Notes => 'Pentax models',
  1059. Writable => 'int16u',
  1060. PrintConvColumns => 2,
  1061. PrintConv => { #PH
  1062. 0 => 'Normal',
  1063. 1 => 'Macro',
  1064. 2 => 'Infinity',
  1065. 3 => 'Manual',
  1066. 4 => 'Super Macro', #JD
  1067. 5 => 'Pan Focus',
  1068. 16 => 'AF-S (Focus-priority)', #17
  1069. 17 => 'AF-C (Focus-priority)', #17
  1070. 18 => 'AF-A (Focus-priority)', #PH (educated guess)
  1071. 32 => 'Contrast-detect (Focus-priority)', #PH (K-5)
  1072. 33 => 'Tracking Contrast-detect (Focus-priority)', #PH (K-5)
  1073. # bit 8 indicates release priority
  1074. 272 => 'AF-S (Release-priority)', #PH (K-5,K-3)
  1075. 273 => 'AF-C (Release-priority)', #PH (K-5,K-3)
  1076. 274 => 'AF-A (Release-priority)', #PH (K-3)
  1077. 288 => 'Contrast-detect (Release-priority)', #PH (K-01)
  1078. },
  1079. },{
  1080. Name => 'FocusMode',
  1081. Writable => 'int16u',
  1082. Notes => 'Asahi models',
  1083. PrintConv => { #2
  1084. 0 => 'Normal',
  1085. 1 => 'Macro (1)',
  1086. 2 => 'Macro (2)',
  1087. 3 => 'Infinity',
  1088. },
  1089. },
  1090. ],
  1091. 0x000e => [{ #7
  1092. Name => 'AFPointSelected',
  1093. Condition => '$$self{Model} !~ /K-3\b/',
  1094. Writable => 'int16u',
  1095. Notes => 'all models but the K-3',
  1096. PrintConvColumns => 2,
  1097. PrintConv => [{
  1098. # 0 - Contrast-detect AF? - PH (K-5)
  1099. 0xffff => 'Auto',
  1100. 0xfffe => 'Fixed Center',
  1101. 0xfffd => 'Automatic Tracking AF', #JD
  1102. 0xfffc => 'Face Detect AF', #JD
  1103. 0xfffb => 'AF Select', #PH (Q select from 25-areas)
  1104. 0 => 'None', #PH (Q in manual focus mode)
  1105. 1 => 'Upper-left',
  1106. 2 => 'Top',
  1107. 3 => 'Upper-right',
  1108. 4 => 'Left',
  1109. 5 => 'Mid-left',
  1110. 6 => 'Center',
  1111. 7 => 'Mid-right',
  1112. 8 => 'Right',
  1113. 9 => 'Lower-left',
  1114. 10 => 'Bottom',
  1115. 11 => 'Lower-right',
  1116. },
  1117. # (second number exists for K-5II(s) is usually 0, but is 1 for AF.C with
  1118. # AFPointMode=='Select' and extended tracking focus points are enabled in the settings)
  1119. ],
  1120. },{
  1121. Name => 'AFPointSelected',
  1122. Writable => 'int16u',
  1123. Notes => 'K-3',
  1124. PrintConvColumns => 2,
  1125. PrintConv => [{
  1126. # 0 - Contrast-detect AF? - PH (K-5)
  1127. 0xffff => 'Auto',
  1128. 0xfffe => 'Fixed Center',
  1129. 0xfffd => 'Automatic Tracking AF', #JD
  1130. 0xfffc => 'Face Detect AF', #JD
  1131. 0xfffb => 'AF Select', #PH (Q select from 25-areas)
  1132. # AF pattern: (ref forum5422)
  1133. # 01 02 03 04 05
  1134. # 06 07 08 09 10
  1135. # 11 12 13 14 15 16 17
  1136. # 18 19 20 21 22
  1137. # 23 24 25 26 27
  1138. 0 => 'None',
  1139. 1 => 'Top-left',
  1140. 2 => 'Top Near-left',
  1141. 3 => 'Top',
  1142. 4 => 'Top Near-right',
  1143. 5 => 'Top-right',
  1144. 6 => 'Upper-left',
  1145. 7 => 'Upper Near-left',
  1146. 8 => 'Upper-middle',
  1147. 9 => 'Upper Near-right',
  1148. 10 => 'Upper-right',
  1149. 11 => 'Far Left',
  1150. 12 => 'Left',
  1151. 13 => 'Near-left',
  1152. 14 => 'Center',
  1153. 15 => 'Near-right',
  1154. 16 => 'Right',
  1155. 17 => 'Far Right',
  1156. 18 => 'Lower-left',
  1157. 19 => 'Lower Near-left',
  1158. 20 => 'Lower-middle',
  1159. 21 => 'Lower Near-right',
  1160. 22 => 'Lower-right',
  1161. 23 => 'Bottom-left',
  1162. 24 => 'Bottom Near-left',
  1163. 25 => 'Bottom',
  1164. 26 => 'Bottom Near-right',
  1165. 27 => 'Bottom-right',
  1166. #forum5892
  1167. 257 => 'Zone Select Top-left',
  1168. 258 => 'Zone Select Top Near-left',
  1169. 259 => 'Zone Select Top',
  1170. 260 => 'Zone Select Top Near-right',
  1171. 261 => 'Zone Select Top-right',
  1172. 262 => 'Zone Select Upper-left',
  1173. 263 => 'Zone Select Upper Near-left',
  1174. 264 => 'Zone Select Upper-middle',
  1175. 265 => 'Zone Select Upper Near-right',
  1176. 266 => 'Zone Select Upper-right',
  1177. 267 => 'Zone Select Far Left',
  1178. 268 => 'Zone Select Left',
  1179. 269 => 'Zone Select Near-left',
  1180. 270 => 'Zone Select Center',
  1181. 271 => 'Zone Select Near-right',
  1182. 272 => 'Zone Select Right',
  1183. 273 => 'Zone Select Far Right',
  1184. 274 => 'Zone Select Lower-left',
  1185. 275 => 'Zone Select Lower Near-left',
  1186. 276 => 'Zone Select Lower-middle',
  1187. 277 => 'Zone Select Lower Near-right',
  1188. 278 => 'Zone Select Lower-right',
  1189. 279 => 'Zone Select Bottom-left',
  1190. 280 => 'Zone Select Bottom Near-left',
  1191. 281 => 'Zone Select Bottom',
  1192. 282 => 'Zone Select Bottom Near-right',
  1193. 283 => 'Zone Select Bottom-right',
  1194. },{ #forum5892
  1195. 0 => 'Single Point',
  1196. 1 => 'Expanded Area 9-point (S)',
  1197. 3 => 'Expanded Area 25-point (M)',
  1198. 5 => 'Expanded Area 27-point (L)',
  1199. }],
  1200. }],
  1201. 0x000f => [{ #PH
  1202. Name => 'AFPointsInFocus',
  1203. Condition => '$$self{Model} !~ /K-3\b/',
  1204. Notes => 'models other than the K-3',
  1205. Writable => 'int16u',
  1206. PrintHex => 1,
  1207. PrintConv => {
  1208. 0xffff => 'None',
  1209. 0 => 'Fixed Center or Multiple', #PH/14
  1210. 1 => 'Top-left',
  1211. 2 => 'Top-center',
  1212. 3 => 'Top-right',
  1213. 4 => 'Left',
  1214. 5 => 'Center',
  1215. 6 => 'Right',
  1216. 7 => 'Bottom-left',
  1217. 8 => 'Bottom-center',
  1218. 9 => 'Bottom-right',
  1219. },
  1220. },{ #PH
  1221. Name => 'AFPointsInFocus',
  1222. Writable => 'int32u',
  1223. Notes => 'K-3 only',
  1224. PrintHex => 1,
  1225. PrintConv => {
  1226. 0 => '(none)',
  1227. BITMASK => {
  1228. 0 => 'Top-left',
  1229. 1 => 'Top Near-left',
  1230. 2 => 'Top',
  1231. 3 => 'Top Near-right',
  1232. 4 => 'Top-right',
  1233. 5 => 'Upper-left',
  1234. 6 => 'Upper Near-left',
  1235. 7 => 'Upper-middle',
  1236. 8 => 'Upper Near-right',
  1237. 9 => 'Upper-right',
  1238. 10 => 'Far Left',
  1239. 11 => 'Left',
  1240. 12 => 'Near-left',
  1241. 13 => 'Center',
  1242. 14 => 'Near-right',
  1243. 15 => 'Right',
  1244. 16 => 'Far Right',
  1245. 17 => 'Lower-left',
  1246. 18 => 'Lower Near-left',
  1247. 19 => 'Lower-middle',
  1248. 20 => 'Lower Near-right',
  1249. 21 => 'Lower-right',
  1250. 22 => 'Bottom-left',
  1251. 23 => 'Bottom Near-left',
  1252. 24 => 'Bottom',
  1253. 25 => 'Bottom Near-right',
  1254. 26 => 'Bottom-right',
  1255. },
  1256. },
  1257. }],
  1258. 0x0010 => { #PH
  1259. Name => 'FocusPosition',
  1260. Writable => 'int16u',
  1261. Notes => 'related to focus distance but affected by focal length',
  1262. },
  1263. 0x0012 => { #PH
  1264. Name => 'ExposureTime',
  1265. Writable => 'int32u',
  1266. Priority => 0,
  1267. ValueConv => '$val * 1e-5',
  1268. ValueConvInv => '$val * 1e5',
  1269. # value may be 0xffffffff in Bulb mode (ref JD)
  1270. PrintConv => '$val > 42949 ? "Unknown (Bulb)" : Image::ExifTool::Exif::PrintExposureTime($val)',
  1271. PrintConvInv => '$val=~/(unknown|bulb)/i ? $val : Image::ExifTool::Exif::ConvertFraction($val)',
  1272. },
  1273. 0x0013 => { #PH
  1274. Name => 'FNumber',
  1275. Writable => 'int16u',
  1276. Priority => 0,
  1277. ValueConv => '$val / 10',
  1278. ValueConvInv => '$val * 10',
  1279. PrintConv => 'sprintf("%.1f",$val)',
  1280. PrintConvInv => '$val',
  1281. },
  1282. # ISO Tag - Entries confirmed by W. Smith 12 FEB 04
  1283. 0x0014 => {
  1284. Name => 'ISO',
  1285. Writable => 'int16u',
  1286. Notes => 'may be different than EXIF:ISO, which can round to the nearest full stop',
  1287. PrintConvColumns => 4,
  1288. PrintConv => {
  1289. # 1/3 EV step values
  1290. 3 => 50,
  1291. 4 => 64,
  1292. 5 => 80,
  1293. 6 => 100,
  1294. 7 => 125, #PH
  1295. 8 => 160, #PH
  1296. 9 => 200,
  1297. 10 => 250,
  1298. 11 => 320, #PH
  1299. 12 => 400,
  1300. 13 => 500,
  1301. 14 => 640,
  1302. 15 => 800,
  1303. 16 => 1000,
  1304. 17 => 1250,
  1305. 18 => 1600, #PH
  1306. 19 => 2000, #PH
  1307. 20 => 2500, #PH
  1308. 21 => 3200, #PH
  1309. 22 => 4000,
  1310. 23 => 5000,
  1311. 24 => 6400, #PH
  1312. 25 => 8000, #PH
  1313. 26 => 10000, #PH
  1314. 27 => 12800, #PH
  1315. 28 => 16000, #PH
  1316. 29 => 20000, #PH
  1317. 30 => 25600, #PH
  1318. 31 => 32000, #PH
  1319. 32 => 40000, #PH
  1320. 33 => 51200, #PH
  1321. 34 => 64000, #PH (NC)
  1322. 35 => 80000, #PH (NC)
  1323. 36 => 102400, #27
  1324. 37 => 128000, #PH (NC)
  1325. 38 => 160000, #PH (NC)
  1326. 39 => 204800, #27
  1327. # Optio 330/430 (oddball)
  1328. 50 => 50, #PH
  1329. 100 => 100, #PH
  1330. 200 => 200, #PH
  1331. 400 => 400, #PH
  1332. 800 => 800, #PH
  1333. 1600 => 1600, #PH
  1334. 3200 => 3200, #PH
  1335. # 1/2 EV step values
  1336. 258 => 50, #PH (NC)
  1337. 259 => 70, #PH (NC)
  1338. 260 => 100, #19
  1339. 261 => 140, #19
  1340. 262 => 200, #19
  1341. 263 => 280, #19
  1342. 264 => 400, #19
  1343. 265 => 560, #19
  1344. 266 => 800, #19
  1345. 267 => 1100, #19
  1346. 268 => 1600, #19
  1347. 269 => 2200, #PH
  1348. 270 => 3200, #PH
  1349. 271 => 4500, #PH
  1350. 272 => 6400, #PH
  1351. 273 => 9000, #PH
  1352. 274 => 12800, #PH
  1353. 275 => 18000, #PH
  1354. 276 => 25600, #PH
  1355. 277 => 36000, #PH
  1356. 278 => 51200, #PH
  1357. # 65534 Auto? (Q/Q10/Q7 MOV) PH
  1358. # 65535 Auto? (K-01 MP4) PH
  1359. },
  1360. },
  1361. 0x0015 => { #PH
  1362. Name => 'LightReading',
  1363. Format => 'int16s', # (because I may have seen negative numbers)
  1364. Writable => 'int16u',
  1365. # ranges from 0-12 for my Optio WP - PH
  1366. Notes => q{
  1367. calibrated differently for different models. For the Optio WP, add 6 to get
  1368. approximate Light Value. May not be valid for some models, eg. Optio S
  1369. },
  1370. },
  1371. 0x0016 => { #PH
  1372. Name => 'ExposureCompensation',
  1373. Writable => 'int16u',
  1374. ValueConv => '($val - 50) / 10',
  1375. ValueConvInv => 'int($val * 10 + 50.5)',
  1376. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  1377. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  1378. },
  1379. 0x0017 => { #3
  1380. Name => 'MeteringMode',
  1381. Writable => 'int16u',
  1382. PrintConv => {
  1383. 0 => 'Multi-segment',
  1384. 1 => 'Center-weighted average',
  1385. 2 => 'Spot',
  1386. # have seen value of 16 for E70
  1387. },
  1388. },
  1389. 0x0018 => { #PH
  1390. Name => 'AutoBracketing',
  1391. Writable => 'int16u',
  1392. Count => -1,
  1393. Notes => q{
  1394. 1 or 2 values: exposure bracket step in EV, then extended bracket if
  1395. available. Extended bracket values are printed as 'WB-BA', 'WB-GM',
  1396. 'Saturation', 'Sharpness', 'Contrast', 'Hue' or 'HighLowKey' followed by
  1397. '+1', '+2' or '+3' for step size
  1398. },
  1399. # 1=.3ev, 2=.7, 3=1.0, ... 10=.5ev, 11=1.5, ...
  1400. ValueConv => [ '$val<10 ? $val/3 : $val-9.5' ],
  1401. ValueConvInv => [ 'abs($val-int($val)-.5)>0.05 ? int($val*3+0.5) : int($val+10)' ],
  1402. PrintConv => sub {
  1403. my @v = split(' ', shift);
  1404. $v[0] = sprintf('%.1f', $v[0]) if $v[0];
  1405. if ($v[1]) {
  1406. my %s = (1=>'WB-BA',2=>'WB-GM',3=>'Saturation',4=>'Sharpness',
  1407. 5=>'Contrast',6=>'Hue',7=>'HighLowKey');
  1408. my $t = $v[1] >> 8;
  1409. $v[1] = sprintf('%s+%d', $s{$t} || "Unknown($t)", $v[1] & 0xff);
  1410. } elsif (defined $v[1]) {
  1411. $v[1] = 'No Extended Bracket',
  1412. }
  1413. return join(' EV, ', @v);
  1414. },
  1415. PrintConvInv => sub {
  1416. my @v = split(/, ?/, shift);
  1417. $v[0] =~ s/ ?EV//i;
  1418. if ($v[1]) {
  1419. my %s = ('WB-BA'=>1,'WB-GM'=>2,'Saturation'=>3,'Sharpness'=>4,
  1420. 'Contrast'=>5,'Hue'=>6,'HighLowKey'=>7);
  1421. if ($v[1] =~ /^No\b/i) {
  1422. $v[1] = 0;
  1423. } elsif ($v[1] =~ /Unknown\((\d+)\)\+(\d+)/i) {
  1424. $v[1] = ($1 << 8) + $2;
  1425. } elsif ($v[1] =~ /([\w-]+)\+(\d+)/ and $s{$1}) {
  1426. $v[1] = ($s{$1} << 8) + $2;
  1427. } else {
  1428. warn "Bad extended bracket\n";
  1429. }
  1430. }
  1431. return "@v";
  1432. },
  1433. },
  1434. 0x0019 => { #3
  1435. Name => 'WhiteBalance',
  1436. Writable => 'int16u',
  1437. PrintConvColumns => 2,
  1438. PrintConv => {
  1439. 0 => 'Auto',
  1440. 1 => 'Daylight',
  1441. 2 => 'Shade',
  1442. 3 => 'Fluorescent', #2
  1443. 4 => 'Tungsten',
  1444. 5 => 'Manual',
  1445. 6 => 'Daylight Fluorescent', #13
  1446. 7 => 'Day White Fluorescent', #13
  1447. 8 => 'White Fluorescent', #13
  1448. 9 => 'Flash', #13
  1449. 10 => 'Cloudy', #13
  1450. 11 => 'Warm White Fluorescent', #PH (K-3)
  1451. 14 => 'Multi Auto', #PH (K-3)
  1452. 15 => 'Color Temperature Enhancement', #PH
  1453. 17 => 'Kelvin', #PH
  1454. 0xfffe => 'Unknown', #13
  1455. 0xffff => 'User-Selected', #13
  1456. },
  1457. },
  1458. 0x001a => { #5
  1459. Name => 'WhiteBalanceMode',
  1460. Writable => 'int16u',
  1461. PrintConv => {
  1462. 1 => 'Auto (Daylight)',
  1463. 2 => 'Auto (Shade)',
  1464. 3 => 'Auto (Flash)',
  1465. 4 => 'Auto (Tungsten)',
  1466. 6 => 'Auto (Daylight Fluorescent)', #19 (NC)
  1467. 7 => 'Auto (Day White Fluorescent)', #17 (K100D guess)
  1468. 8 => 'Auto (White Fluorescent)', #17 (K100D guess)
  1469. 10 => 'Auto (Cloudy)', #17 (K100D guess)
  1470. # 0xfffd observed in K100D (ref 17)
  1471. 0xfffe => 'Unknown', #PH (you get this when shooting night sky shots)
  1472. 0xffff => 'User-Selected',
  1473. },
  1474. },
  1475. 0x001b => { #6
  1476. Name => 'BlueBalance',
  1477. Writable => 'int16u',
  1478. ValueConv => '$val / 256',
  1479. ValueConvInv => 'int($val * 256 + 0.5)',
  1480. },
  1481. 0x001c => { #6
  1482. Name => 'RedBalance',
  1483. Writable => 'int16u',
  1484. ValueConv => '$val / 256',
  1485. ValueConvInv => 'int($val * 256 + 0.5)',
  1486. },
  1487. 0x001d => [
  1488. # Would be nice if there was a general way to determine units for FocalLength...
  1489. {
  1490. # Optio 30, 33WR, 43WR, 450, 550, 555, 750Z, X
  1491. Name => 'FocalLength',
  1492. Condition => '$self->{Model} =~ /^PENTAX Optio (30|33WR|43WR|450|550|555|750Z|X)\b/',
  1493. Writable => 'int32u',
  1494. Priority => 0,
  1495. ValueConv => '$val / 10',
  1496. ValueConvInv => '$val * 10',
  1497. PrintConv => 'sprintf("%.1f mm",$val)',
  1498. PrintConvInv => '$val=~s/\s*mm//;$val',
  1499. },
  1500. {
  1501. # K100D, Optio 230, 330GS, 33L, 33LF, A10, M10, MX, MX4, S, S30,
  1502. # S4, S4i, S5i, S5n, S5z, S6, S45, S50, S55, S60, SV, Svi, W10, WP,
  1503. # *ist D, DL, DL2, DS, DS2
  1504. # (Note: the Optio S6 seems to report the minimum focal length - PH)
  1505. Name => 'FocalLength',
  1506. Writable => 'int32u',
  1507. Priority => 0,
  1508. ValueConv => '$val / 100',
  1509. ValueConvInv => '$val * 100',
  1510. PrintConv => 'sprintf("%.1f mm",$val)',
  1511. PrintConvInv => '$val=~s/\s*mm//;$val',
  1512. },
  1513. ],
  1514. 0x001e => { #3
  1515. Name => 'DigitalZoom',
  1516. Writable => 'int16u',
  1517. ValueConv => '$val / 100', #14
  1518. ValueConvInv => '$val * 100', #14
  1519. },
  1520. 0x001f => {
  1521. Name => 'Saturation',
  1522. Writable => 'int16u',
  1523. Count => -1,
  1524. Notes => '1 or 2 values',
  1525. PrintConvColumns => 2,
  1526. PrintConv => [{ # the *istD has pairs of values - PH
  1527. 0 => '-2 (low)', #PH
  1528. 1 => '0 (normal)', #PH
  1529. 2 => '+2 (high)', #PH
  1530. 3 => '-1 (med low)', #2
  1531. 4 => '+1 (med high)', #2
  1532. 5 => '-3 (very low)', #PH
  1533. 6 => '+3 (very high)', #PH (NC)
  1534. 7 => '-4 (minimum)', #PH (NC)
  1535. 8 => '+4 (maximum)', #PH (K-5)
  1536. 65535 => 'None', #PH (Monochrome)
  1537. }],
  1538. },
  1539. 0x0020 => {
  1540. Name => 'Contrast',
  1541. Writable => 'int16u',
  1542. Count => -1,
  1543. Notes => '1 or 2 values',
  1544. PrintConvColumns => 2,
  1545. PrintConv => [{ # the *istD has pairs of values - PH
  1546. 0 => '-2 (low)', #PH
  1547. 1 => '0 (normal)', #PH
  1548. 2 => '+2 (high)', #PH
  1549. 3 => '-1 (med low)', #2
  1550. 4 => '+1 (med high)', #2
  1551. 5 => '-3 (very low)', #PH
  1552. 6 => '+3 (very high)', #PH (NC)
  1553. 7 => '-4 (minimum)', #PH (NC)
  1554. 8 => '+4 (maximum)', #PH (K-5)
  1555. 65535 => 'n/a', # got this for a Backlight Silhouette - PH (Q)
  1556. }],
  1557. },
  1558. 0x0021 => {
  1559. Name => 'Sharpness',
  1560. Writable => 'int16u',
  1561. Count => -1,
  1562. Notes => '1 or 2 values',
  1563. PrintConvColumns => 2,
  1564. PrintConv => [{ # the *istD has pairs of values - PH
  1565. 0 => '-2 (soft)', #PH
  1566. 1 => '0 (normal)', #PH
  1567. 2 => '+2 (hard)', #PH
  1568. 3 => '-1 (med soft)', #2
  1569. 4 => '+1 (med hard)', #2
  1570. 5 => '-3 (very soft)', #(NC)
  1571. 6 => '+3 (very hard)', #(NC)
  1572. 7 => '-4 (minimum)', #PH (NC)
  1573. 8 => '+4 (maximum)', #PH (NC)
  1574. }],
  1575. },
  1576. 0x0022 => { #PH
  1577. Name => 'WorldTimeLocation',
  1578. Groups => { 2 => 'Time' },
  1579. Writable => 'int16u',
  1580. PrintConv => {
  1581. 0 => 'Hometown',
  1582. 1 => 'Destination',
  1583. },
  1584. },
  1585. 0x0023 => { #PH
  1586. Name => 'HometownCity',
  1587. Groups => { 2 => 'Time' },
  1588. Writable => 'int16u',
  1589. SeparateTable => 'City',
  1590. PrintConv => \%pentaxCities,
  1591. },
  1592. 0x0024 => { #PH
  1593. Name => 'DestinationCity',
  1594. Groups => { 2 => 'Time' },
  1595. Writable => 'int16u',
  1596. SeparateTable => 'City',
  1597. PrintConv => \%pentaxCities,
  1598. },
  1599. 0x0025 => { #PH
  1600. Name => 'HometownDST',
  1601. Groups => { 2 => 'Time' },
  1602. Writable => 'int16u',
  1603. PrintConv => { 0 => 'No', 1 => 'Yes' },
  1604. },
  1605. 0x0026 => { #PH
  1606. Name => 'DestinationDST',
  1607. Groups => { 2 => 'Time' },
  1608. Writable => 'int16u',
  1609. PrintConv => { 0 => 'No', 1 => 'Yes' },
  1610. },
  1611. 0x0027 => { #PH
  1612. Name => 'DSPFirmwareVersion',
  1613. Writable => 'undef',
  1614. # - for K10D, this comes from 4 bytes at offset 0x1c in the firmware file
  1615. %pentaxFirmwareID,
  1616. },
  1617. 0x0028 => { #PH
  1618. Name => 'CPUFirmwareVersion',
  1619. Writable => 'undef',
  1620. # - for K10D, this comes from 4 bytes at offset 0x83fbf8 in firmware file
  1621. %pentaxFirmwareID,
  1622. },
  1623. 0x0029 => { #5
  1624. Name => 'FrameNumber',
  1625. # - one report that this has a value of 84 for the first image with a *istDS
  1626. # - another report that file number 4 has frameNumber 154 for *istD, and
  1627. # that framenumber jumped at about 9700 to around 26000
  1628. # - with *istDS firmware 2.0, this tag was removed and ShutterCount was added
  1629. Writable => 'int32u',
  1630. },
  1631. # 0x002b - definitely exposure related somehow - PH
  1632. 0x002d => [{ #PH
  1633. Name => 'EffectiveLV',
  1634. Condition => '$format eq "int16u"',
  1635. Notes => 'camera-calculated light value, but includes exposure compensation',
  1636. Writable => 'int16u',
  1637. Format => 'int16s', # (negative values are valid even though Pentax writes int16u)
  1638. ValueConv => '$val/1024',
  1639. ValueConvInv => '$val * 1024',
  1640. PrintConv => 'sprintf("%.1f",$val)',
  1641. PrintConvInv => '$val',
  1642. },{
  1643. Name => 'EffectiveLV',
  1644. Condition => '$format eq "int32u"',
  1645. Writable => 'int32u',
  1646. Format => 'int32s',
  1647. ValueConv => '$val/1024',
  1648. ValueConvInv => '$val * 1024',
  1649. PrintConv => 'sprintf("%.1f",$val)',
  1650. PrintConvInv => '$val',
  1651. }],
  1652. 0x0032 => { #13
  1653. Name => 'ImageEditing',
  1654. Writable => 'undef',
  1655. Format => 'int8u',
  1656. Count => 4,
  1657. PrintConv => {
  1658. '0 0' => 'None', #PH
  1659. '0 0 0 0' => 'None',
  1660. '0 0 0 4' => 'Digital Filter',
  1661. '1 0 0 0' => 'Resized', #PH (K-5)
  1662. '2 0 0 0' => 'Cropped', #PH
  1663. # note: doesn't apply to digital filters applied when picture is taken
  1664. '4 0 0 0' => 'Digital Filter 4', #PH (K10D, Ricoh WG-5)
  1665. '6 0 0 0' => 'Digital Filter 6', #PH (K-5)
  1666. '8 0 0 0' => 'Red-eye Correction', #PH (WG-10)
  1667. '16 0 0 0' => 'Frame Synthesis?',
  1668. },
  1669. },
  1670. 0x0033 => { #PH (K110D/K100D/K-m)
  1671. Name => 'PictureMode',
  1672. Writable => 'int8u',
  1673. Count => 3,
  1674. Relist => [ [0, 1], 2 ], # join values 0 and 1 for PrintConv
  1675. PrintConvColumns => 2,
  1676. PrintConv => [{
  1677. # Program dial modes (from K110D)
  1678. '0 0' => 'Program', # (also on K10D, custom settings: Program Line 1, e-dial in Program 3, 4 or 5)
  1679. '0 1' => 'Hi-speed Program', #19 (K10D, custom settings: Program Line 2, e-dial in Program 3, 4 or 5)
  1680. '0 2' => 'DOF Program', #19 (K10D, custom settings: Program Line 3, e-dial in Program 3, 4 or 5)
  1681. '0 3' => 'MTF Program', #19 (K10D, custom settings: Program Line 4, e-dial in Program 3, 4 or 5)
  1682. '0 4' => 'Standard', #13
  1683. '0 5' => 'Portrait',
  1684. '0 6' => 'Landscape',
  1685. '0 7' => 'Macro',
  1686. '0 8' => 'Sport',
  1687. '0 9' => 'Night Scene Portrait',
  1688. '0 10' => 'No Flash',
  1689. # SCN modes (menu-selected) (from K100D)
  1690. '0 11' => 'Night Scene',
  1691. '0 12' => 'Surf & Snow',
  1692. '0 13' => 'Text',
  1693. '0 14' => 'Sunset',
  1694. '0 15' => 'Kids',
  1695. '0 16' => 'Pet',
  1696. '0 17' => 'Candlelight',
  1697. '0 18' => 'Museum',
  1698. '0 19' => 'Food',
  1699. '0 20' => 'Stage Lighting',
  1700. '0 21' => 'Night Snap',
  1701. '0 23' => 'Blue Sky', # (Q)
  1702. '0 24' => 'Sunset', # (Q)
  1703. '0 26' => 'Night Scene HDR', # (Q)
  1704. '0 27' => 'HDR', # (Q)
  1705. '0 28' => 'Quick Macro', # (Q)
  1706. '0 29' => 'Forest', # (Q)
  1707. '0 30' => 'Backlight Silhouette', # (Q)
  1708. # AUTO PICT modes (auto-selected)
  1709. '1 4' => 'Auto PICT (Standard)', #13
  1710. '1 5' => 'Auto PICT (Portrait)', #7 (K100D)
  1711. '1 6' => 'Auto PICT (Landscape)', # K110D
  1712. '1 7' => 'Auto PICT (Macro)', #13
  1713. '1 8' => 'Auto PICT (Sport)', #13
  1714. # *istD modes (ref 7)
  1715. '2 0' => 'Program (HyP)', #13 (K-5 Normal program line - PH)
  1716. '2 1' => 'Hi-speed Program (HyP)', #19 (K10D, custom settings: Program Line 2, e-dial in Program 1, 2)
  1717. '2 2' => 'DOF Program (HyP)', #19 (K10D, custom settings: Program Line 3, e-dial in Program 1, 2)
  1718. '2 3' => 'MTF Program (HyP)', #19 (K10D, custom settings: Program Line 4, e-dial in Program 1, 2)
  1719. '2 22' => 'Shallow DOF (HyP)', #PH (K-5)
  1720. '3 0' => 'Green Mode', #16
  1721. '4 0' => 'Shutter Speed Priority',
  1722. '5 0' => 'Aperture Priority',
  1723. '6 0' => 'Program Tv Shift',
  1724. '7 0' => 'Program Av Shift', #19
  1725. '8 0' => 'Manual',
  1726. '9 0' => 'Bulb',
  1727. '10 0' => 'Aperture Priority, Off-Auto-Aperture',
  1728. '11 0' => 'Manual, Off-Auto-Aperture',
  1729. '12 0' => 'Bulb, Off-Auto-Aperture',
  1730. # extra K10D modes (ref 16)
  1731. '13 0' => 'Shutter & Aperture Priority AE',
  1732. '15 0' => 'Sensitivity Priority AE',
  1733. '16 0' => 'Flash X-Sync Speed AE',
  1734. '18 0' => 'Auto Program (Normal)', #PH (K-5)
  1735. '18 1' => 'Auto Program (Hi-speed)', #PH (NC)
  1736. '18 2' => 'Auto Program (DOF)', #PH (K-5)
  1737. '18 3' => 'Auto Program (MTF)', #PH (NC)
  1738. '18 22' => 'Auto Program (Shallow DOF)', #PH (NC)
  1739. '20 22' => 'Blur Control', #PH (Q)
  1740. '254 0' => 'Video', #PH (K-7,K-5)
  1741. '255 0' => 'Video (Auto Aperture)', #PH (K-5)
  1742. '255 4' => 'Video (4)', #PH (K-x,K-01)
  1743. },{
  1744. # EV step size (ref 19)
  1745. 0 => '1/2 EV steps',
  1746. 1 => '1/3 EV steps',
  1747. }],
  1748. },
  1749. 0x0034 => { #7/PH
  1750. Name => 'DriveMode',
  1751. Writable => 'int8u',
  1752. Count => 4,
  1753. PrintConv => [{
  1754. 0 => 'Single-frame', # (also Interval Shooting for K-01 - PH)
  1755. 1 => 'Continuous', # (K-5 Hi)
  1756. 2 => 'Continuous (Lo)', #PH (K-5)
  1757. 3 => 'Burst', #PH (K20D)
  1758. 4 => 'Continuous (Medium)', #PH (K-3)
  1759. 255 => 'Video', #PH (K-x)
  1760. },{
  1761. 0 => 'No Timer',
  1762. 1 => 'Self-timer (12 s)',
  1763. 2 => 'Self-timer (2 s)',
  1764. 15 => 'Video', #PH (Q MOV)
  1765. 16 => 'Mirror Lock-up', # (K-5)
  1766. 255 => 'n/a', #PH (K-x)
  1767. },{
  1768. 0 => 'Shutter Button', # (also computer remote control - PH)
  1769. 1 => 'Remote Control (3 s delay)', #19
  1770. 2 => 'Remote Control', #19
  1771. 4 => 'Remote Continuous Shooting', # (K-5)
  1772. },{
  1773. 0x00 => 'Single Exposure',
  1774. 0x01 => 'Multiple Exposure',
  1775. 0x0f => 'Interval Movie', #PH (K-01)
  1776. 0x10 => 'HDR', #PH (645D)
  1777. 0x20 => 'HDR Strong 1', #PH (NC) (K-5)
  1778. 0x30 => 'HDR Strong 2', #PH (K-5)
  1779. 0x40 => 'HDR Strong 3', #PH (K-5)
  1780. 0xe0 => 'HDR Auto', #PH (K-5)
  1781. 0xff => 'Video', #PH (K-x)
  1782. }],
  1783. },
  1784. 0x0035 => { #PH
  1785. Name => 'SensorSize',
  1786. Format => 'int16u',
  1787. Count => 2,
  1788. Notes => 'includes masked pixels',
  1789. # values for various models (not sure why this is in 2um increments):
  1790. # 11894 7962 (K10D,K-m) 12012 7987 (*istDS,K100D,K110D) 12012 8019 (*istD),
  1791. # 12061 7988 (K-5) 12053 8005 (K-r,K-x) 14352 9535 (K20D,K-7)
  1792. # 22315 16711 (645) 12080 8008 (K-01)
  1793. ValueConv => 'my @a=split(" ",$val); $_/=500 foreach @a; join(" ",@a)',
  1794. ValueConvInv => 'my @a=split(" ",$val); $_*=500 foreach @a; join(" ",@a)',
  1795. PrintConv => 'sprintf("%.3f x %.3f mm", split(" ",$val))',
  1796. PrintConvInv => '$val=~s/\s*mm$//; $val=~s/\s*x\s*/ /; $val',
  1797. },
  1798. 0x0037 => { #13
  1799. Name => 'ColorSpace',
  1800. Writable => 'int16u',
  1801. PrintConv => {
  1802. 0 => 'sRGB',
  1803. 1 => 'Adobe RGB',
  1804. },
  1805. },
  1806. 0x0038 => { #5 (PEF only)
  1807. Name => 'ImageAreaOffset',
  1808. Writable => 'int16u',
  1809. Count => 2,
  1810. },
  1811. 0x0039 => { #PH
  1812. Name => 'RawImageSize',
  1813. Writable => 'int16u',
  1814. Count => 2,
  1815. PrintConv => '$_=$val;s/ /x/;$_',
  1816. },
  1817. 0x003c => { #7/PH
  1818. Name => 'AFPointsInFocus',
  1819. # not writable because I'm not decoding these 4 bytes fully:
  1820. # Nibble pattern: XSSSYUUU
  1821. # X = unknown (AF focused flag?, 0 or 1)
  1822. # SSS = selected AF point bitmask (0x000 or 0x7ff if unused)
  1823. # Y = unknown (observed 0,6,7,b,e, always 0 if SSS is 0x000 or 0x7ff)
  1824. # UUU = af points used
  1825. Format => 'int32u',
  1826. Notes => '*istD only',
  1827. ValueConv => '$val & 0x7ff', # ignore other bits for now
  1828. PrintConvColumns => 2,
  1829. PrintConv => {
  1830. 0 => '(none)',
  1831. BITMASK => {
  1832. 0 => 'Upper-left',
  1833. 1 => 'Top',
  1834. 2 => 'Upper-right',
  1835. 3 => 'Left',
  1836. 4 => 'Mid-left',
  1837. 5 => 'Center',
  1838. 6 => 'Mid-right',
  1839. 7 => 'Right',
  1840. 8 => 'Lower-left',
  1841. 9 => 'Bottom',
  1842. 10 => 'Lower-right',
  1843. },
  1844. },
  1845. },
  1846. 0x003d => { #31
  1847. Name => 'DataScaling',
  1848. Writable => 'int16u',
  1849. # divide by the second value of Pentax_0x0201 (WhitePoint), usually
  1850. # 8192, to get the floating point normalization factor.
  1851. # One of the examples of how this tag can be used is calculation of
  1852. # baseline exposure compensation (Adobe-style) for a PEF:
  1853. # log2(Pentax_0x007e)-14-0.5+log2(Pentax_0x003d)-13
  1854. # or
  1855. # log2(Pentax_0x007e*(Pentax_0x003d/(2^13))/(2^14))-0.5
  1856. # where
  1857. # makernotes:Pentax_0x003d/(2^13) is the normalization factor. (ref 31)
  1858. # - 8192 for most images, but occasionally 11571 for K100D/K110D,
  1859. # and 8289 or 8456 for the K-x (ref PH)
  1860. },
  1861. 0x003e => { #PH
  1862. Name => 'PreviewImageBorders',
  1863. Writable => 'int8u',
  1864. Count => 4,
  1865. Notes => 'top, bottom, left, right',
  1866. },
  1867. 0x003f => { #PH
  1868. Name => 'LensRec',
  1869. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensRec' },
  1870. },
  1871. 0x0040 => { #PH
  1872. Name => 'SensitivityAdjust',
  1873. Writable => 'int16u',
  1874. ValueConv => '($val - 50) / 10',
  1875. ValueConvInv => '$val * 10 + 50',
  1876. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  1877. PrintConvInv => '$val',
  1878. },
  1879. 0x0041 => { #19
  1880. Name => 'ImageEditCount',
  1881. Writable => 'int16u',
  1882. },
  1883. 0x0047 => { #PH
  1884. Name => 'CameraTemperature', # (chassis temperature, ref forum6677)
  1885. Writable => 'int8s',
  1886. PrintConv => '"$val C"',
  1887. PrintConvInv => '$val=~s/ ?c$//i; $val',
  1888. },
  1889. 0x0048 => { #19
  1890. Name => 'AELock',
  1891. Writable => 'int16u',
  1892. PrintConv => {
  1893. 0 => 'Off',
  1894. 1 => 'On',
  1895. },
  1896. },
  1897. 0x0049 => { #13
  1898. Name => 'NoiseReduction',
  1899. Writable => 'int16u',
  1900. PrintConv => { 0 => 'Off', 1 => 'On' },
  1901. },
  1902. 0x004d => [{ #PH
  1903. Name => 'FlashExposureComp',
  1904. Condition => '$count == 1',
  1905. Writable => 'int32s',
  1906. ValueConv => '$val / 256',
  1907. ValueConvInv => 'int($val * 256 + ($val > 0 ? 0.5 : -0.5))',
  1908. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  1909. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  1910. },{ #PH (K-3)
  1911. Name => 'FlashExposureComp',
  1912. Writable => 'int8s',
  1913. Count => 2, # (don't know what the 2nd number is for)
  1914. ValueConv => [ '$val / 6' ],
  1915. ValueConvInv => [ '$val / 6' ],
  1916. PrintConv => [ '$val ? sprintf("%+.1f", $val) : 0' ],
  1917. PrintConvInv => [ 'Image::ExifTool::Exif::ConvertFraction($val)' ],
  1918. }],
  1919. 0x004f => { #PH
  1920. Name => 'ImageTone', # (Called CustomImageMode in K20D manual)
  1921. Writable => 'int16u',
  1922. PrintConvColumns => 2,
  1923. PrintConv => {
  1924. 0 => 'Natural',
  1925. 1 => 'Bright',
  1926. 2 => 'Portrait', # (K20D/K200D)
  1927. 3 => 'Landscape', # (K20D)
  1928. 4 => 'Vibrant', # (K20D)
  1929. 5 => 'Monochrome', # (K20D)
  1930. 6 => 'Muted', # (645D)
  1931. 7 => 'Reversal Film', # (645D) (Ricoh WG-5 "Slide Film")
  1932. 8 => 'Bleach Bypass', # (K-5)
  1933. 9 => 'Radiant', # (Q)
  1934. },
  1935. },
  1936. 0x0050 => { #PH
  1937. Name => 'ColorTemperature',
  1938. Writable => 'int16u',
  1939. RawConv => '$val ? $val : undef',
  1940. ValueConv => '53190 - $val',
  1941. ValueConvInv => '53190 - $val',
  1942. },
  1943. # 0x0053-0x005a - not in JPEG images - PH
  1944. 0x0053 => { #28
  1945. Name => 'ColorTempDaylight',
  1946. %colorTemp,
  1947. Notes => '0x0053-0x005a are 3 numbers: Kelvin, shift AB, shift GM',
  1948. },
  1949. 0x0054 => { Name => 'ColorTempShade', %colorTemp }, #28
  1950. 0x0055 => { Name => 'ColorTempCloudy', %colorTemp }, #28
  1951. 0x0056 => { Name => 'ColorTempTungsten', %colorTemp }, #28
  1952. 0x0057 => { Name => 'ColorTempFluorescentD', %colorTemp }, #28
  1953. 0x0058 => { Name => 'ColorTempFluorescentN', %colorTemp }, #28
  1954. 0x0059 => { Name => 'ColorTempFluorescentW', %colorTemp }, #28
  1955. 0x005a => { Name => 'ColorTempFlash', %colorTemp }, #28
  1956. 0x005c => [{ #PH
  1957. Name => 'ShakeReductionInfo',
  1958. Condition => '$count == 4', # (2 bytes for the K-3)
  1959. Format => 'undef', # (written as int8u) - do this just to save time converting the value
  1960. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::SRInfo' },
  1961. },{
  1962. Name => 'ShakeReductionInfo',
  1963. Format => 'undef', # (written as int8u) - do this just to save time converting the value
  1964. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::SRInfo2' },
  1965. }],
  1966. 0x005d => { #JD/PH
  1967. # (used by all Pentax DSLR's except *istD and *istDS until firmware 2.0 - PH)
  1968. # Observed values for the first shot of a new K10D are: 81 [PH], 181 [19],
  1969. # 246 [7], and 209 [18 (one of the first 20 shots)], so there must be a number
  1970. # of test images shot in the factory. (But my new K-5 started at 1 - PH)
  1971. # This count includes shutter actuations even if they don't result in a
  1972. # recorded image (eg. manual white balance frame or digital preview), but
  1973. # does not include actuations due to Live View or video recording - PH
  1974. Name => 'ShutterCount',
  1975. Writable => 'undef',
  1976. Count => 4,
  1977. Notes => q{
  1978. Note: May be reset by servicing! Also, does not include shutter actuations
  1979. for live view or video recording
  1980. },
  1981. # raw value is a big-endian 4-byte integer, encrypted using Date and Time
  1982. RawConv => 'length($val) == 4 ? unpack("N",$val) : undef',
  1983. RawConvInv => q{
  1984. my $val = Image::ExifTool::Pentax::CryptShutterCount($val,$self);
  1985. return pack('N', $val);
  1986. },
  1987. ValueConv => \&CryptShutterCount,
  1988. ValueConvInv => '$val',
  1989. },
  1990. # 0x005e -
  1991. 0x0060 => { #PH (K-5)
  1992. Name => 'FaceInfo',
  1993. Format => 'undef', # (written as int8u)
  1994. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::FaceInfo' },
  1995. },
  1996. 0x0062 => { #forum4803
  1997. Name => 'RawDevelopmentProcess',
  1998. Condition => '$$self{Make} =~ /^(PENTAX|RICOH)/', # rules out Kodak, which also use this tag
  1999. Writable => 'int16u',
  2000. PrintConv => {
  2001. 1 => '1 (K10D,K200D,K2000,K-m)',
  2002. 3 => '3 (K20D)',
  2003. 4 => '4 (K-7)',
  2004. 5 => '5 (K-x)',
  2005. 6 => '6 (645D)',
  2006. 7 => '7 (K-r)',
  2007. 8 => '8 (K-5,K-5II,K-5IIs)',
  2008. 9 => '9 (Q)',
  2009. 10 => '10 (K-01,K-30)',
  2010. 11 => '11 (Q10)',
  2011. 12 => '12 (MX-1)',
  2012. 13 => '13 (K-3,K-3II)',
  2013. 14 => '14 (645Z)',
  2014. 15 => '15 (K-S1,K-S2)', #PH
  2015. },
  2016. },
  2017. 0x0067 => { #PH (K-5)
  2018. Name => 'Hue',
  2019. Writable => 'int16u',
  2020. PrintConvColumns => 2,
  2021. PrintConv => {
  2022. 0 => -2,
  2023. 1 => 'Normal',
  2024. 2 => 2,
  2025. 3 => -1,
  2026. 4 => 1,
  2027. 5 => -3,
  2028. 6 => 3,
  2029. 7 => -4,
  2030. 8 => 4,
  2031. 65535 => 'None', # (Monochrome)
  2032. },
  2033. },
  2034. # 0x0067 - int16u: 1 [and 65535 in Monochrome] (K20D,K200D) - PH
  2035. 0x0068 => { #PH
  2036. Name => 'AWBInfo',
  2037. Format => 'undef', # (written as int8u)
  2038. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AWBInfo' },
  2039. },
  2040. 0x0069 => { #PH (K20D, K-5, K-01 highlights only)
  2041. Name => 'DynamicRangeExpansion',
  2042. Notes => q{
  2043. called highlight correction by Pentax for the K20D, K-5, K-01 and maybe
  2044. other models
  2045. },
  2046. Writable => 'undef',
  2047. Format => 'int8u',
  2048. Count => 4,
  2049. PrintConv => [{
  2050. 0 => 'Off',
  2051. 1 => 'On',
  2052. },{
  2053. 0 => 0,
  2054. 1 => 'Enabled', # (K-01)
  2055. 2 => 'Auto', # (K-01)
  2056. }],
  2057. },
  2058. 0x006b => { #PH (K-5)
  2059. Name => 'TimeInfo',
  2060. Format => 'undef', # (written as int8u)
  2061. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::TimeInfo' },
  2062. },
  2063. 0x006c => { #PH (K-5)
  2064. Name => 'HighLowKeyAdj',
  2065. Description => 'High/Low Key Adj',
  2066. Writable => 'int16s',
  2067. Count => 2,
  2068. PrintConvColumns => 3,
  2069. PrintConv => {
  2070. '-4 0' => -4,
  2071. '-3 0' => -3,
  2072. '-2 0' => -2,
  2073. '-1 0' => -1,
  2074. '0 0' => 0,
  2075. '1 0' => 1,
  2076. '2 0' => 2,
  2077. '3 0' => 3,
  2078. '4 0' => 4,
  2079. },
  2080. },
  2081. 0x006d => { #PH (K-5)
  2082. Name => 'ContrastHighlight',
  2083. Writable => 'int16s',
  2084. Count => 2,
  2085. PrintConvColumns => 3,
  2086. PrintConv => {
  2087. '-4 0' => -4,
  2088. '-3 0' => -3,
  2089. '-2 0' => -2,
  2090. '-1 0' => -1,
  2091. '0 0' => 0,
  2092. '1 0' => 1,
  2093. '2 0' => 2,
  2094. '3 0' => 3,
  2095. '4 0' => 4,
  2096. },
  2097. },
  2098. 0x006e => { #PH (K-5)
  2099. Name => 'ContrastShadow',
  2100. Writable => 'int16s',
  2101. Count => 2,
  2102. PrintConvColumns => 3,
  2103. PrintConv => {
  2104. '-4 0' => -4,
  2105. '-3 0' => -3,
  2106. '-2 0' => -2,
  2107. '-1 0' => -1,
  2108. '0 0' => 0,
  2109. '1 0' => 1,
  2110. '2 0' => 2,
  2111. '3 0' => 3,
  2112. '4 0' => 4,
  2113. },
  2114. },
  2115. 0x006f => { #PH (K-5)
  2116. Name => 'ContrastHighlightShadowAdj',
  2117. Description => 'Contrast Highlight/Shadow Adj',
  2118. Writable => 'int8u',
  2119. PrintConv => {
  2120. 0 => 'Off',
  2121. 1 => 'On',
  2122. },
  2123. },
  2124. 0x0070 => { #PH (K-5)
  2125. Name => 'FineSharpness',
  2126. Writable => 'int8u',
  2127. Count => -1, # 1 for K20/K200, 2 for K-5
  2128. PrintConv => [{
  2129. 0 => 'Off',
  2130. 1 => 'On',
  2131. },{
  2132. 0 => 'Normal',
  2133. 2 => 'Extra fine',
  2134. }],
  2135. },
  2136. 0x0071 => { #PH (K20D,K-x)
  2137. Name => 'HighISONoiseReduction',
  2138. Format => 'int8u',
  2139. PrintConv => [{
  2140. 0 => 'Off',
  2141. 1 => 'Weakest',
  2142. 2 => 'Weak', # (called "Low" by K-x)
  2143. 3 => 'Strong', # (called "High" by K-x)
  2144. 4 => 'Medium',
  2145. 255 => 'Auto', # (K-5)
  2146. },{
  2147. 0 => 'Inactive',
  2148. 1 => 'Active',
  2149. 2 => 'Active (Weak)', # (K-5)
  2150. 3 => 'Active (Strong)', # (K-5)
  2151. 4 => 'Active (Medium)', # (K-5)
  2152. },{ # Start ISO level for NR (K-x)
  2153. 48 => 'ISO>400',
  2154. 56 => 'ISO>800',
  2155. 64 => 'ISO>1600',
  2156. 72 => 'ISO>3200',
  2157. }],
  2158. },
  2159. 0x0072 => { #JD (K20D)
  2160. Name => 'AFAdjustment',
  2161. Writable => 'int16s',
  2162. },
  2163. 0x0073 => { #PH (K-5)
  2164. Name => 'MonochromeFilterEffect',
  2165. Writable => 'int16u',
  2166. PrintConvColumns => 2,
  2167. PrintConv => {
  2168. 65535 => 'None',
  2169. 1 => 'Green',
  2170. 2 => 'Yellow',
  2171. 3 => 'Orange',
  2172. 4 => 'Red',
  2173. 5 => 'Magenta',
  2174. 6 => 'Blue',
  2175. 7 => 'Cyan',
  2176. 8 => 'Infrared',
  2177. },
  2178. },
  2179. 0x0074 => { #PH (K-5)
  2180. Name => 'MonochromeToning',
  2181. Writable => 'int16u',
  2182. PrintConvColumns => 2,
  2183. PrintConv => {
  2184. 65535 => 'None',
  2185. 0 => -4,
  2186. 1 => -3,
  2187. 2 => -2,
  2188. 3 => -1,
  2189. 4 => 0,
  2190. 5 => 1,
  2191. 6 => 2,
  2192. 7 => 3,
  2193. 8 => 4,
  2194. },
  2195. },
  2196. 0x0076 => { #PH (K-5)
  2197. Name => 'FaceDetect',
  2198. Writable => 'int8u',
  2199. Count => 2,
  2200. # the Optio S12 writes this but not the FacesDetected tag, so get FacesDetected from here
  2201. DataMember => 'FacesDetected',
  2202. RawConv => '$val =~ / (\d+)/ and $$self{FacesDetected} = $1; $val',
  2203. # (the K-3 reports "On" even in phase-detect focus modes)
  2204. PrintConv => [
  2205. '$val ? "On ($val faces max)" : "Off"',
  2206. '"$val faces detected"',
  2207. ],
  2208. PrintConvInv => [
  2209. '$val =~ /(\d+)/ ? $1 : 0',
  2210. '$val =~ /(\d+)/ ? $1 : 0',
  2211. ],
  2212. },
  2213. 0x0077 => { #PH (K-5)
  2214. # set by taking a picture with face detect AF,
  2215. # but it isn't reset until camera is turned off? - PH
  2216. Name => 'FaceDetectFrameSize',
  2217. Writable => 'int16u',
  2218. Count => 2,
  2219. },
  2220. # 0x0078 - int16u[2]: '0 0' (K-5,K-7,K-r,K-x)
  2221. 0x0079 => { #PH
  2222. Name => 'ShadowCorrection',
  2223. Writable => 'int8u',
  2224. Count => -1,
  2225. PrintConvColumns => 2,
  2226. PrintConv => {
  2227. # (1 value for K-m/K2000, 2 for 645D)
  2228. 0 => 'Off',
  2229. 1 => 'On',
  2230. 2 => 'Auto 2', # (NC, WG-3)
  2231. '0 0' => 'Off',
  2232. '1 1' => 'Weak',
  2233. '1 2' => 'Normal',
  2234. '1 3' => 'Strong',
  2235. '2 4' => 'Auto', # (K-01)
  2236. },
  2237. },
  2238. 0x007a => { #PH
  2239. Name => 'ISOAutoParameters',
  2240. Writable => 'int8u',
  2241. Count => 2,
  2242. PrintConv => {
  2243. '1 0' => 'Slow',
  2244. '2 0' => 'Standard',
  2245. '3 0' => 'Fast',
  2246. },
  2247. },
  2248. 0x007b => { #PH (K-5)
  2249. Name => 'CrossProcess',
  2250. Writable => 'int8u',
  2251. PrintConvColumns => 2,
  2252. PrintConv => {
  2253. 0 => 'Off',
  2254. 1 => 'Random',
  2255. 2 => 'Preset 1',
  2256. 3 => 'Preset 2',
  2257. 4 => 'Preset 3',
  2258. 33 => 'Favorite 1',
  2259. 34 => 'Favorite 2',
  2260. 35 => 'Favorite 3',
  2261. },
  2262. },
  2263. 0x007d => { #PH
  2264. Name => 'LensCorr',
  2265. Format => 'undef', # (written as int8u)
  2266. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensCorr' },
  2267. },
  2268. 0x007e => { #31
  2269. Name => 'WhiteLevel', # (with black level already subtracted)
  2270. Writable => 'int32u',
  2271. # 15859,15860,15864,15865,16315 (K-5 PEF/DNG only) - PH
  2272. # 3934, 3935 (Q DNG) - PH
  2273. },
  2274. 0x007f => { #PH (K-5)
  2275. Name => 'BleachBypassToning',
  2276. Writable => 'int16u',
  2277. PrintConvColumns => 2,
  2278. PrintConv => {
  2279. 65535 => 'Off',
  2280. 1 => 'Green',
  2281. 2 => 'Yellow',
  2282. 3 => 'Orange',
  2283. 4 => 'Red',
  2284. 5 => 'Magenta',
  2285. 6 => 'Purple',
  2286. 7 => 'Blue',
  2287. 8 => 'Cyan',
  2288. },
  2289. },
  2290. 0x0080 => { #PH (Q)
  2291. Name => 'AspectRatio',
  2292. PrintConv => {
  2293. 0 => '4:3',
  2294. 1 => '3:2',
  2295. 2 => '16:9',
  2296. 3 => '1:1',
  2297. },
  2298. },
  2299. # 0x0081 - int8u: 0 (Q)
  2300. 0x0082 => {
  2301. Name => 'BlurControl',
  2302. Writable => 'int8u',
  2303. Count => 4,
  2304. PrintConv => [
  2305. {
  2306. 0 => 'Off',
  2307. 1 => 'Low',
  2308. 2 => 'Medium',
  2309. 3 => 'High',
  2310. },
  2311. undef, # 0 with BlurControl is Off, seen 0,1,3 when on (related to subject distance?)
  2312. undef, # 0 with BlurControl Off, 45 when on
  2313. undef, # always 0
  2314. ],
  2315. },
  2316. # 0x0083 - int8u: 0 (Q DNG)
  2317. # 0x0084 - int8u: 0 (Q)
  2318. 0x0085 => { #PH
  2319. Name => 'HDR',
  2320. Format => 'int8u',
  2321. Count => 4,
  2322. PrintConv => [{ # (K-01,K-3)
  2323. 0 => 'Off',
  2324. 1 => 'HDR Auto',
  2325. 2 => 'HDR 1',
  2326. 3 => 'HDR 2',
  2327. 4 => 'HDR 3',
  2328. },{ # (K-01)
  2329. 0 => 'Auto-align Off',
  2330. 1 => 'Auto-align On',
  2331. },{
  2332. # not sure about this - PH
  2333. # - you can set HDR "Exposure Bracket Value" with the K-3
  2334. # - guessed from imaging-resource K-3 samples K3OUTBHDR_A{1,2,3}
  2335. 0 => 'n/a',
  2336. 4 => '1 EV',
  2337. 8 => '2 EV',
  2338. 12 => '3 EV', # (get this from K-01, but can't set EV)
  2339. },
  2340. # (4th number is always 0)
  2341. ],
  2342. },
  2343. # 0x0086 - int8u: 0, 111[Sport,Pet] (Q) - related to Tracking FocusMode?
  2344. # 0x0087 - int8u: 0 (Q)
  2345. 0x0088 => { #PH
  2346. Name => 'NeutralDensityFilter',
  2347. Writable => 'int8u',
  2348. PrintConv => { 0 => 'Off', 1 => 'On' },
  2349. },
  2350. 0x008b => { #PH (LS465)
  2351. Name => 'ISO',
  2352. Priority => 0,
  2353. Writable => 'int32u',
  2354. },
  2355. 0x0200 => { #5
  2356. Name => 'BlackPoint',
  2357. Writable => 'int16u',
  2358. Count => 4,
  2359. },
  2360. 0x0201 => { #5
  2361. # (this doesn't change for different fixed white balances in JPEG images: Daylight,
  2362. # Tungsten, Kelvin, etc -- always "8192 8192 8192 8192", but it varies for these in
  2363. # RAW images, all images in Auto, for different Manual WB settings, and for images
  2364. # taken via Pentax Remote Assistant) - PH
  2365. Name => 'WhitePoint',
  2366. Writable => 'int16u',
  2367. Count => 4,
  2368. },
  2369. # 0x0202: int16u[4]: all 0's in all my samples
  2370. 0x0203 => { #JD (not really sure what these mean)
  2371. Name => 'ColorMatrixA',
  2372. Writable => 'int16s',
  2373. Count => 9,
  2374. ValueConv => 'join(" ",map({ $_/8192 } split(" ",$val)))',
  2375. ValueConvInv => 'join(" ",map({ int($_*8192 + ($_<0?-0.5:0.5)) } split(" ",$val)))',
  2376. PrintConv => 'join(" ",map({sprintf("%.5f",$_)} split(" ",$val)))',
  2377. PrintConvInv => '"$val"',
  2378. },
  2379. 0x0204 => { #JD
  2380. Name => 'ColorMatrixB',
  2381. Writable => 'int16s',
  2382. Count => 9,
  2383. ValueConv => 'join(" ",map({ $_/8192 } split(" ",$val)))',
  2384. ValueConvInv => 'join(" ",map({ int($_*8192 + ($_<0?-0.5:0.5)) } split(" ",$val)))',
  2385. PrintConv => 'join(" ",map({sprintf("%.5f",$_)} split(" ",$val)))',
  2386. PrintConvInv => '"$val"',
  2387. },
  2388. 0x0205 => [{ #19
  2389. Name => 'CameraSettings',
  2390. # size: *istD/*istDs/K100D/K110D=16, K-m/K2000=14, K-7/K-x=19,
  2391. # K200D/K20D/K-5/645D=20, K-r=21, K10D=22, K-01=25
  2392. Condition => '$count < 25', # (not valid for the K-01)
  2393. SubDirectory => {
  2394. TagTable => 'Image::ExifTool::Pentax::CameraSettings',
  2395. ByteOrder => 'BigEndian',
  2396. },
  2397. },{
  2398. Name => 'CameraSettingsUnknown',
  2399. SubDirectory => {
  2400. TagTable => 'Image::ExifTool::Pentax::CameraSettingsUnknown',
  2401. ByteOrder => 'BigEndian',
  2402. },
  2403. }],
  2404. 0x0206 => [{ #PH
  2405. Name => 'AEInfo',
  2406. # size: *istD/*istDs/K100D/K110D=14, K10D/K200D/K20D=16, K-m/K2000=20,
  2407. # K-7/K-x=24, K-5/K-r/645D=25
  2408. Condition => '$count <= 25 and $count != 21 and $$self{AEInfoSize} = $count',
  2409. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AEInfo' },
  2410. },{
  2411. Name => 'AEInfo2',
  2412. # size: K-01=21
  2413. Condition => '$count == 21',
  2414. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AEInfo2' },
  2415. },{
  2416. Name => 'AEInfo3',
  2417. # size: K-30=48
  2418. Condition => '$count == 48',
  2419. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AEInfo3' },
  2420. },{
  2421. Name => 'AEInfoUnknown',
  2422. # size: Q/Q10=34
  2423. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::AEInfoUnknown' },
  2424. }],
  2425. 0x0207 => [ #PH
  2426. {
  2427. Name => 'LensInfo',
  2428. # the *ist series (and Samsung GX-1) always use the old format, and all
  2429. # other models but the K100D, K110D and K100D Super always use the newer
  2430. # format, and for the K110D/K110D we expect ff or 00 00 at byte 20 if
  2431. # it is the old format.)
  2432. Condition => q{
  2433. $$self{Model}=~/(\*ist|GX-1[LS])/ or
  2434. ($$self{Model}=~/(K100D|K110D)/ and $$valPt=~/^.{20}(\xff|\0\0)/s)
  2435. },
  2436. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo' },
  2437. },{
  2438. Name => 'LensInfo',
  2439. Condition => '$count != 90 and $count != 91 and $count != 80 and $count != 128',
  2440. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo2' },
  2441. },{
  2442. Name => 'LensInfo', # 645D
  2443. Condition => '$count == 90',
  2444. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo3' },
  2445. },{
  2446. Name => 'LensInfo', # K-r, K-5, K-5II
  2447. Condition => '$count == 91',
  2448. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo4' },
  2449. },{
  2450. Name => 'LensInfo', # K-01, K-30, K-50, K-500, K-3, K-3II
  2451. Condition => '$count == 80 or $count == 128',
  2452. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfo5' },
  2453. }
  2454. ],
  2455. 0x0208 => [ #PH
  2456. {
  2457. Name => 'FlashInfo',
  2458. Condition => '$count == 27',
  2459. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::FlashInfo' },
  2460. },
  2461. {
  2462. Name => 'FlashInfoUnknown',
  2463. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::FlashInfoUnknown' },
  2464. },
  2465. ],
  2466. 0x0209 => { #PH
  2467. Name => 'AEMeteringSegments',
  2468. Format => 'int8u',
  2469. Count => -1,
  2470. Notes => q{
  2471. measurements from each of the 16 AE metering segments for models such as the
  2472. K10D, 77 metering segments for models such as the K-5, and 4050 metering
  2473. segments for the K-3, converted to LV
  2474. },
  2475. %convertMeteringSegments,
  2476. # 16 metering segment 77 metering segment
  2477. # locations (ref JD, K10D) locations (ref PH, K-5)
  2478. # +-------------------------+
  2479. # | 14 | +----------------------------------+
  2480. # | +---+---+---+---+ | | 0 1 2 3 4 5 6 7 8 9 10 |
  2481. # | | 5 | 3/1\ 2| 4 | | | 11 12 13 14 15 16 17 18 19 20 21 |
  2482. # | +-+-+-+-+ - +-+-+-+-+ | | 22 23 24 25 26 27 28 29 30 31 32 |
  2483. # +--+ 9 | 7 ||0|| 6 | 8 +--+ | 33 34 35 36 37 38 39 40 41 42 43 |
  2484. # | +-+-+-+-+ - +-+-+-+-+ | | 44 45 46 47 48 49 50 51 52 53 54 |
  2485. # | |13 |11\ /10|12 | | | 55 56 57 58 59 60 61 62 63 64 65 |
  2486. # | +---+---+---+---+ | | 66 67 68 69 70 71 72 73 74 75 76 |
  2487. # | 15 | +----------------------------------+
  2488. # +-------------------------+
  2489. },
  2490. 0x020a => { #PH/JD/19
  2491. Name => 'FlashMeteringSegments',
  2492. Format => 'int8u',
  2493. Count => -1,
  2494. %convertMeteringSegments,
  2495. },
  2496. 0x020b => { #PH/JD/19
  2497. Name => 'SlaveFlashMeteringSegments',
  2498. Format => 'int8u',
  2499. Count => -1,
  2500. Notes => 'used in wireless control mode',
  2501. %convertMeteringSegments,
  2502. },
  2503. 0x020d => { #PH
  2504. Name => 'WB_RGGBLevelsDaylight',
  2505. Writable => 'int16u',
  2506. Count => 4,
  2507. },
  2508. 0x020e => { #PH
  2509. Name => 'WB_RGGBLevelsShade',
  2510. Writable => 'int16u',
  2511. Count => 4,
  2512. },
  2513. 0x020f => { #PH
  2514. Name => 'WB_RGGBLevelsCloudy',
  2515. Writable => 'int16u',
  2516. Count => 4,
  2517. },
  2518. 0x0210 => { #PH
  2519. Name => 'WB_RGGBLevelsTungsten',
  2520. Writable => 'int16u',
  2521. Count => 4,
  2522. },
  2523. 0x0211 => { #PH
  2524. Name => 'WB_RGGBLevelsFluorescentD',
  2525. Writable => 'int16u',
  2526. Count => 4,
  2527. },
  2528. 0x0212 => { #PH
  2529. Name => 'WB_RGGBLevelsFluorescentN',
  2530. Writable => 'int16u',
  2531. Count => 4,
  2532. },
  2533. 0x0213 => { #PH
  2534. Name => 'WB_RGGBLevelsFluorescentW',
  2535. Writable => 'int16u',
  2536. Count => 4,
  2537. },
  2538. 0x0214 => { #PH
  2539. Name => 'WB_RGGBLevelsFlash',
  2540. Writable => 'int16u',
  2541. Count => 4,
  2542. },
  2543. 0x0215 => { #PH
  2544. Name => 'CameraInfo',
  2545. Format => 'undef', # (written as int32u)
  2546. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::CameraInfo' },
  2547. },
  2548. 0x0216 => { #PH
  2549. Name => 'BatteryInfo',
  2550. SubDirectory => {
  2551. TagTable => 'Image::ExifTool::Pentax::BatteryInfo',
  2552. ByteOrder => 'BigEndian', # have seen makernotes changed to little-endian in DNG!
  2553. },
  2554. },
  2555. # 0x021a - undef[1068] (K-5) - ToneMode/Saturation mapping matrices (ref 28)
  2556. 0x021b => { #19
  2557. Name => 'SaturationInfo',
  2558. Flags => [ 'Unknown', 'Binary' ],
  2559. Writable => 0,
  2560. Notes => 'only in PEF and DNG images',
  2561. # K10D values with various Saturation settings (ref 19):
  2562. # Very Low: 000000022820f9a0fe4000802660f92002e0fee01e402c40f880fb40ffc02b20f52002e0fe401ee0
  2563. # Low: 000000022ae0f700fe20ff402840f88001e0fcc021602f60f560fb40fe602d20f48001c0fbc02280
  2564. # Med Low: 000000022dc0f420fe20fe002a20f7e000c0fa8024c032c0f220fb20fce02f60f3c000a0f9202640
  2565. # Normal: 000000023120f0e0fe00fc802c40f740ffa0f7e028803660ee80fb20fb4031c0f300ff60f6202a80
  2566. # Med High: 0000000234e0ed40fde0fae02ea0f680fe60f5002ca03a80ea80fb00f9603480f220fe00f2e02f20
  2567. # High: 0000000238c0e960fde0f9203140f5a0fce0f1e031403f00e600fb00f7803760f120fc60ef403460
  2568. # Very High:000000023d20e520fdc0f7203420f4c0fb60ee6036404400e120fae0f5403aa0f020fac0eb403a00
  2569. },
  2570. # 0x021c - undef[18] (K-5)
  2571. # 0x021d - undef[18] (K-5)
  2572. # 0x021e - undef[8] (K-5, Q)
  2573. 0x021f => { #JD
  2574. Name => 'AFInfo',
  2575. SubDirectory => {
  2576. # NOTE: Most of these subdirectories are 'undef' format, and as such the
  2577. # byte ordering is not changed when changed via the Pentax software (which
  2578. # will write a little-endian TIFF on an Intel system). So we must define
  2579. # BigEndian byte ordering for any of these which contain multi-byte values. - PH
  2580. ByteOrder => 'BigEndian',
  2581. TagTable => 'Image::ExifTool::Pentax::AFInfo',
  2582. },
  2583. },
  2584. 0x0220 => { #6
  2585. Name => 'HuffmanTable',
  2586. Flags => [ 'Unknown', 'Binary' ],
  2587. Writable => 0,
  2588. Notes => 'found in K10D, K20D and K2000D PEF images',
  2589. },
  2590. 0x0221 => { #28
  2591. Name => 'KelvinWB',
  2592. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::KelvinWB' },
  2593. },
  2594. 0x0222 => { #PH
  2595. Name => 'ColorInfo',
  2596. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::ColorInfo' },
  2597. },
  2598. # 0x0223 - undef[198] (K-5 PEF/DNG only)
  2599. 0x0224 => { #19
  2600. Name => 'EVStepInfo',
  2601. Drop => 200, # drop if larger than 200 bytes (40 kB in Pentax Q and Q10)
  2602. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::EVStepInfo' },
  2603. },
  2604. 0x0226 => { #PH
  2605. Name => 'ShotInfo', # (may want to change this later when more is decoded)
  2606. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::ShotInfo' },
  2607. },
  2608. 0x0227 => { #PH
  2609. Name => 'FacePos',
  2610. Condition => '$$self{FacesDetected}', # ignore if no faces to decode
  2611. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::FacePos' },
  2612. },
  2613. 0x0228 => { #PH
  2614. Name => 'FaceSize',
  2615. Condition => '$$self{FacesDetected}', # ignore if no faces to decode
  2616. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::FaceSize' },
  2617. },
  2618. 0x0229 => { #PH (verified) (K-m, K-x, K-7)
  2619. Name => 'SerialNumber',
  2620. Writable => 'string',
  2621. Notes => 'left blank by some cameras',
  2622. },
  2623. 0x022a => { #PH (K-5)
  2624. Name => 'FilterInfo',
  2625. SubDirectory => {
  2626. TagTable => 'Image::ExifTool::Pentax::FilterInfo',
  2627. ByteOrder => 'BigEndian',
  2628. },
  2629. },
  2630. 0x022b => { #PH (K-5)
  2631. Name => 'LevelInfo',
  2632. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LevelInfo' },
  2633. },
  2634. # 0x022c - undef[46] (K-5)
  2635. 0x022d => { #28
  2636. Name => 'WBLevels',
  2637. Condition => '$count == 100', # (just to be safe, but no other counts observed)
  2638. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::WBLevels' },
  2639. },
  2640. 0x022e => { #PH (K-5 AVI videos)
  2641. Name => 'Artist',
  2642. Groups => { 2 => 'Author' },
  2643. Writable => 'string',
  2644. },
  2645. 0x022f => { #PH (K-5 AVI videos)
  2646. Name => 'Copyright',
  2647. Groups => { 2 => 'Author' },
  2648. Writable => 'string',
  2649. },
  2650. 0x0230 => { #PH (K-x AVI videos)
  2651. Name => 'FirmwareVersion',
  2652. Notes => 'only in AVI videos',
  2653. # this tag only exists in AVI videos, and for the K-x the value of
  2654. # this tag is "K-x Ver 1.00", which is the same as the EXIF Software
  2655. # tag. I used a different tag name for this because Pentax uses the
  2656. # AVI Software tag for a different string, "PENTAX K-x".
  2657. Writable => 'string',
  2658. },
  2659. 0x0231 => { #PH (K-5)
  2660. Name => 'ContrastDetectAFArea',
  2661. Writable => 'int16u',
  2662. Count => 4,
  2663. Notes => q{
  2664. AF area of the most recent contrast-detect focus operation. Coordinates
  2665. are left, top, width and height in a 720x480 frame, with Y downwards
  2666. },
  2667. },
  2668. 0x0235 => { #PH (K-5)
  2669. Name => 'CrossProcessParams',
  2670. # (it would be interesting to know exactly what these mean)
  2671. Writable => 'undef',
  2672. Format => 'int8u',
  2673. Count => 10,
  2674. },
  2675. # 0x0236 - undef[52] (Q)
  2676. # 0x0237 - undef[11] possibly related to smart effect setting? (Q)
  2677. # 0x0238 - undef[9] (Q)
  2678. 0x0239 => { #PH
  2679. Name => 'LensInfoQ',
  2680. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensInfoQ' },
  2681. },
  2682. # 0x023a - undef[10] (Q)
  2683. # 0x023b - undef[9] (K-01)
  2684. # 01a700500000000000, 91a700500000000000, 41a700500000000000, 002700500000000000
  2685. # c00500400000000000, 400500500000000000, 4004ff420100000000, 4087ff480000000000
  2686. 0x0243 => { #PH
  2687. Name => 'PixelShiftInfo',
  2688. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::PixelShiftInfo' },
  2689. },
  2690. 0x03fe => { #PH
  2691. Name => 'DataDump',
  2692. Writable => 0,
  2693. PrintConv => '\$val',
  2694. },
  2695. 0x03ff => [ #PH
  2696. {
  2697. Name => 'TempInfo',
  2698. Condition => '$$self{Model} =~ /K-(01|3|30|5|50|500)\b/',
  2699. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::TempInfo' },
  2700. },{
  2701. Name => 'UnknownInfo',
  2702. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::UnknownInfo' },
  2703. },
  2704. ],
  2705. 0x0402 => { #5
  2706. Name => 'ToneCurve',
  2707. PrintConv => '\$val',
  2708. },
  2709. 0x0403 => { #5
  2710. Name => 'ToneCurves',
  2711. PrintConv => '\$val',
  2712. },
  2713. # 0x0404 - undef[2086] (K-5)
  2714. 0x0405 => { #PH - undef[24200] (K-5 PEF/DNG only), undef[28672] (Q DNG)
  2715. Name => 'UnknownBlock',
  2716. Writable => 'undef',
  2717. Notes => 'large unknown data block in PEF/DNG images but not JPG images',
  2718. Flags => [ 'Unknown', 'Binary', 'Drop' ],
  2719. },
  2720. # 0x0406 - undef[4116] (K-5)
  2721. # 0x0407 - undef[3072] (Q DNG)
  2722. # 0x0408 - undef[1024] (Q DNG)
  2723. 0x0e00 => {
  2724. Name => 'PrintIM',
  2725. Description => 'Print Image Matching',
  2726. Writable => 0,
  2727. SubDirectory => {
  2728. TagTable => 'Image::ExifTool::PrintIM::Main',
  2729. },
  2730. },
  2731. );
  2732. # shake reduction information (ref PH)
  2733. %Image::ExifTool::Pentax::SRInfo = (
  2734. %binaryDataAttrs,
  2735. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2736. NOTES => 'Shake reduction information.',
  2737. 0 => {
  2738. Name => 'SRResult',
  2739. PrintConv => { #PH/JD
  2740. 0 => 'Not stabilized',
  2741. BITMASK => {
  2742. 0 => 'Stabilized',
  2743. # have seen 1 and 4 for 0.5 and 0.3 sec exposures with NR on and Bit 0 also set - ref 19
  2744. # have seen bits 1,2,3,4 in K-5 AVI videos - PH
  2745. 6 => 'Not ready',
  2746. },
  2747. },
  2748. },
  2749. 1 => {
  2750. Name => 'ShakeReduction',
  2751. PrintConv => {
  2752. 0 => 'Off',
  2753. 1 => 'On',
  2754. 4 => 'Off (4)', # (K20D, K200D, K-7, K-5)
  2755. 5 => 'On but Disabled', # (K20D, K-5)
  2756. # (can be 5 "On but Disabled" for K-5 with HDR [auto-align off only],
  2757. # Composition Adjust, DriveMode = Self-timer or Remote, and movie with SR off!)
  2758. 6 => 'On (Video)', # (K-7)
  2759. 7 => 'On (7)', #(NC) (K20D, K200D, K-m, K-5)
  2760. 15 => 'On (15)', # (K20D with Tamron 10-20mm @ 10mm)
  2761. 39 => 'On (mode 2)', # (K-01) (on during capture and live view)
  2762. 135 => 'On (135)', # (K-5IIs)
  2763. 167 => 'On (mode 1)', # (K-01) (on during capture only)
  2764. },
  2765. },
  2766. 2 => {
  2767. Name => 'SRHalfPressTime',
  2768. # (was SR_SWSToSWRTime: SWS=photometering switch, SWR=shutter release switch)
  2769. # (from http://www.patentstorm.us/patents/6597867-description.html)
  2770. # (here, SR could more accurately mean Shutter Release, not Shake Reduction)
  2771. # (not valid for K-01 - PH)
  2772. Notes => q{
  2773. time from when the shutter button was half pressed to when the shutter was
  2774. released, including time for focusing. Not valid for some models
  2775. },
  2776. # (constant of 60 determined from times: 2sec=127; 3sec=184,197; 4sec=244,249,243,246 - PH)
  2777. ValueConv => '$val / 60',
  2778. ValueConvInv => 'my $v=$val*60; $v < 255 ? int($v + 0.5) : 255',
  2779. PrintConv => 'sprintf("%.2f s",$val) . ($val > 254.5/60 ? " or longer" : "")',
  2780. PrintConvInv => '$val=~tr/0-9.//dc; $val',
  2781. },
  2782. 3 => { #JD
  2783. Name => 'SRFocalLength',
  2784. ValueConv => '$val & 0x01 ? $val * 4 : $val / 2',
  2785. ValueConvInv => '$val <= 127 ? int($val) * 2 : int($val / 4) | 0x01',
  2786. PrintConv => '"$val mm"',
  2787. PrintConvInv => '$val=~s/\s*mm//;$val',
  2788. },
  2789. );
  2790. # shake reduction information for the K-3 (ref PH)
  2791. %Image::ExifTool::Pentax::SRInfo2 = (
  2792. %binaryDataAttrs,
  2793. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2794. NOTES => 'Shake reduction information for the K-3.',
  2795. 0 => {
  2796. Name => 'SRResult',
  2797. Unknown => 1,
  2798. PrintConv => { BITMASK => {
  2799. # Bit 0 - have seen this set in a few Pentax samples - PH
  2800. # Bit 6 - usually set when SR is Off, and occasionally when On - PH
  2801. # Bit 7 - set when AA simulation is on - PH
  2802. }},
  2803. },
  2804. 1 => {
  2805. Name => 'ShakeReduction',
  2806. PrintConv => { #forum5425
  2807. 0 => 'Off', # (NC for K-3)
  2808. 1 => 'On', # (NC for K-3)
  2809. 4 => 'Off (AA simulation off)',
  2810. 5 => 'On but Disabled', # (NC for K-3)
  2811. 6 => 'On (Video)', # (NC for K-3)
  2812. 7 => 'On (AA simulation off)',
  2813. 12 => 'Off (AA simulation type 1)', # (AA linear motion)
  2814. 15 => 'On (AA simulation type 1)', # (AA linear motion)
  2815. 20 => 'Off (AA simulation type 2)', # (AA circular motion)
  2816. 23 => 'On (AA simulation type 2)', # (AA circular motion)
  2817. },
  2818. },
  2819. );
  2820. # face detection information (ref PH, K-5)
  2821. %Image::ExifTool::Pentax::FaceInfo = (
  2822. %binaryDataAttrs,
  2823. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2824. DATAMEMBER => [ 0 ],
  2825. 0 => {
  2826. Name => 'FacesDetected',
  2827. RawConv => '$$self{FacesDetected} = $val',
  2828. },
  2829. 2 => {
  2830. Name => 'FacePosition',
  2831. Notes => q{
  2832. X/Y coordinates of the center of the main face in percent of frame size,
  2833. with positive Y downwards
  2834. },
  2835. Format => 'int8u[2]',
  2836. },
  2837. );
  2838. # automatic white balance settings (ref PH, K-5)
  2839. %Image::ExifTool::Pentax::AWBInfo = (
  2840. %binaryDataAttrs,
  2841. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2842. # 0 - always 1?
  2843. # (data ends here for the K20D, K200D, K-x and K-7)
  2844. 0 => {
  2845. Name => 'WhiteBalanceAutoAdjustment',
  2846. PrintConv => {
  2847. 0 => 'Off',
  2848. 1 => 'On',
  2849. },
  2850. },
  2851. 1 => { # (exists only for K-5)
  2852. Name => 'TungstenAWB',
  2853. PrintConv => {
  2854. 0 => 'Subtle Correction',
  2855. 1 => 'Strong Correction',
  2856. },
  2857. },
  2858. );
  2859. # world time settings (ref PH, K-5)
  2860. %Image::ExifTool::Pentax::TimeInfo = (
  2861. %binaryDataAttrs,
  2862. GROUPS => { 0 => 'MakerNotes', 2 => 'Time' },
  2863. 0.1 => {
  2864. Name => 'WorldTimeLocation',
  2865. Mask => 0x01,
  2866. PrintConv => {
  2867. 0x00 => 'Hometown',
  2868. 0x01 => 'Destination',
  2869. },
  2870. },
  2871. 0.2 => {
  2872. Name => 'HometownDST',
  2873. Mask => 0x02,
  2874. PrintConv => {
  2875. 0x00 => 'No',
  2876. 0x02 => 'Yes',
  2877. },
  2878. },
  2879. 0.3 => {
  2880. Name => 'DestinationDST',
  2881. Mask => 0x04,
  2882. PrintConv => {
  2883. 0x00 => 'No',
  2884. 0x04 => 'Yes',
  2885. },
  2886. },
  2887. 2 => {
  2888. Name => 'HometownCity',
  2889. SeparateTable => 'City',
  2890. PrintConv => \%pentaxCities,
  2891. },
  2892. 3 => {
  2893. Name => 'DestinationCity',
  2894. SeparateTable => 'City',
  2895. PrintConv => \%pentaxCities,
  2896. },
  2897. );
  2898. # lens distortion correction (ref PH, K-5)
  2899. %Image::ExifTool::Pentax::LensCorr = (
  2900. %binaryDataAttrs,
  2901. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  2902. 0 => {
  2903. Name => 'DistortionCorrection',
  2904. PrintConv => { 0 => 'Off', 1 => 'On' },
  2905. },
  2906. 1 => {
  2907. Name => 'ChromaticAberrationCorrection',
  2908. PrintConv => { 0 => 'Off', 1 => 'On' },
  2909. },
  2910. 2 => {
  2911. Name => 'PeripheralIlluminationCorr',
  2912. PrintConv => { 0 => 'Off', 1 => 'On' },
  2913. },
  2914. 3 => {
  2915. Name => 'DiffractionCorrection',
  2916. PrintConv => { 0 => 'Off', 16 => 'On' },
  2917. },
  2918. );
  2919. # camera settings (ref 19)
  2920. %Image::ExifTool::Pentax::CameraSettings = (
  2921. %binaryDataAttrs,
  2922. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2923. PRIORITY => 0,
  2924. NOTES => 'Camera settings information written by Pentax DSLR cameras.',
  2925. 0 => {
  2926. Name => 'PictureMode2',
  2927. PrintConv => {
  2928. 0 => 'Scene Mode', #PH
  2929. 1 => 'Auto PICT', #PH (NC)
  2930. 2 => 'Program AE',
  2931. 3 => 'Green Mode',
  2932. 4 => 'Shutter Speed Priority',
  2933. 5 => 'Aperture Priority',
  2934. 6 => 'Program Tv Shift', #PH
  2935. 7 => 'Program Av Shift',
  2936. 8 => 'Manual', #PH
  2937. 9 => 'Bulb', #PH
  2938. 10 => 'Aperture Priority, Off-Auto-Aperture', #PH (NC)
  2939. 11 => 'Manual, Off-Auto-Aperture', #PH
  2940. 12 => 'Bulb, Off-Auto-Aperture', #PH (NC)
  2941. 13 => 'Shutter & Aperture Priority AE',
  2942. 15 => 'Sensitivity Priority AE',
  2943. 16 => 'Flash X-Sync Speed AE', #PH
  2944. },
  2945. },
  2946. 1.1 => {
  2947. Name => 'ProgramLine',
  2948. # only set to other than Normal when in Program AE mode
  2949. Mask => 0x03,
  2950. PrintConv => {
  2951. 0 => 'Normal',
  2952. 1 => 'Hi Speed',
  2953. 2 => 'Depth',
  2954. 3 => 'MTF',
  2955. },
  2956. },
  2957. 1.2 => { # (K10D, K-5)
  2958. Name => 'EVSteps',
  2959. Mask => 0x20,
  2960. PrintConv => {
  2961. 0x00 => '1/2 EV Steps',
  2962. 0x20 => '1/3 EV Steps',
  2963. },
  2964. },
  2965. 1.3 => { # (this bit is set for movies with the K-5 - PH)
  2966. Name => 'E-DialInProgram',
  2967. # always set even when not in Program AE mode
  2968. Mask => 0x40,
  2969. PrintConv => {
  2970. 0x00 => 'Tv or Av',
  2971. 0x40 => 'P Shift',
  2972. },
  2973. },
  2974. 1.4 => { # (K10D, K-5)
  2975. Name => 'ApertureRingUse',
  2976. # always set even Aperture Ring is in A mode
  2977. Mask => 0x80,
  2978. PrintConv => {
  2979. 0x00 => 'Prohibited',
  2980. 0x80 => 'Permitted',
  2981. },
  2982. },
  2983. 2 => {
  2984. Name => 'FlashOptions',
  2985. Notes => 'the camera flash options settings, set even if the flash is off',
  2986. Mask => 0xf0,
  2987. ValueConv => '$val>>4',
  2988. ValueConvInv => '$val<<4',
  2989. # Note: These tags correlate with the FlashMode and InternalFlashMode values,
  2990. # and match what is displayed by the Pentax software
  2991. PrintConv => {
  2992. 0 => 'Normal', # (this value can occur in Green Mode) - ref 19
  2993. 1 => 'Red-eye reduction', # (this value can occur in Green Mode) - ref 19
  2994. 2 => 'Auto', # (this value can occur in other than Green Mode) - ref 19
  2995. 3 => 'Auto, Red-eye reduction', #PH (this value can occur in other than Green Mode) - ref 19
  2996. 5 => 'Wireless (Master)',
  2997. 6 => 'Wireless (Control)',
  2998. 8 => 'Slow-sync',
  2999. 9 => 'Slow-sync, Red-eye reduction',
  3000. 10 => 'Trailing-curtain Sync'
  3001. },
  3002. },
  3003. 2.1 => {
  3004. Name => 'MeteringMode2',
  3005. Mask => 0x0f,
  3006. Notes => 'may not be valid for some models, eg. *ist D',
  3007. PrintConv => {
  3008. 0 => 'Multi-segment',
  3009. BITMASK => {
  3010. 0 => 'Center-weighted average',
  3011. 1 => 'Spot',
  3012. },
  3013. },
  3014. },
  3015. 3 => {
  3016. Name => 'AFPointMode',
  3017. Mask => 0xf0,
  3018. PrintConv => {
  3019. 0x00 => 'Auto',
  3020. BITMASK => {
  3021. 4 => 'Select',
  3022. 5 => 'Fixed Center',
  3023. # have seen bit 6 set in pre-production images (firmware 0.20) - PH
  3024. },
  3025. },
  3026. },
  3027. 3.1 => {
  3028. Name => 'FocusMode2',
  3029. Mask => 0x0f,
  3030. PrintConv => {
  3031. 0 => 'Manual',
  3032. 1 => 'AF-S',
  3033. 2 => 'AF-C',
  3034. 3 => 'AF-A', #PH
  3035. },
  3036. },
  3037. 4 => {
  3038. Name => 'AFPointSelected2',
  3039. Format => 'int16u',
  3040. PrintConv => {
  3041. 0 => 'Auto',
  3042. BITMASK => {
  3043. 0 => 'Upper-left',
  3044. 1 => 'Top',
  3045. 2 => 'Upper-right',
  3046. 3 => 'Left',
  3047. 4 => 'Mid-left',
  3048. 5 => 'Center',
  3049. 6 => 'Mid-right',
  3050. 7 => 'Right',
  3051. 8 => 'Lower-left',
  3052. 9 => 'Bottom',
  3053. 10 => 'Lower-right',
  3054. },
  3055. },
  3056. },
  3057. 6 => {
  3058. Name => 'ISOFloor', #PH
  3059. # manual ISO or minimum ISO in Auto ISO mode - PH
  3060. ValueConv => 'int(100*exp(Image::ExifTool::Pentax::PentaxEv($val-32)*log(2))+0.5)',
  3061. ValueConvInv => 'Image::ExifTool::Pentax::PentaxEvInv(log($val/100)/log(2))+32',
  3062. },
  3063. 7 => {
  3064. Name => 'DriveMode2',
  3065. PrintConv => {
  3066. 0 => 'Single-frame',
  3067. BITMASK => {
  3068. 0 => 'Continuous', # (K-5 Hi)
  3069. 1 => 'Continuous (Lo)', #PH (K-5)
  3070. 2 => 'Self-timer (12 s)', #PH
  3071. 3 => 'Self-timer (2 s)', #PH
  3072. 4 => 'Remote Control (3 s delay)',
  3073. 5 => 'Remote Control',
  3074. 6 => 'Exposure Bracket', #PH/19
  3075. 7 => 'Multiple Exposure',
  3076. },
  3077. },
  3078. },
  3079. 8 => {
  3080. Name => 'ExposureBracketStepSize',
  3081. # This is set even when Exposure Bracket is Off (and the K10D
  3082. # displays Ò---Ó as the step size when you press the EB button) - DaveN
  3083. # because the last value is remembered and if you turn Exposure Bracket
  3084. # on the step size goes back to what it was before.
  3085. PrintConv => {
  3086. 3 => '0.3',
  3087. 4 => '0.5',
  3088. 5 => '0.7',
  3089. 8 => '1.0', #PH
  3090. 11 => '1.3',
  3091. 12 => '1.5',
  3092. 13 => '1.7', #(NC)
  3093. 16 => '2.0', #PH
  3094. },
  3095. },
  3096. 9 => { #PH/19
  3097. Name => 'BracketShotNumber',
  3098. PrintHex => 1,
  3099. PrintConv => {
  3100. 0 => 'n/a',
  3101. 0x02 => '1 of 2', #PH (K-5)
  3102. 0x12 => '2 of 2', #PH (K-5)
  3103. 0x03 => '1 of 3',
  3104. 0x13 => '2 of 3',
  3105. 0x23 => '3 of 3',
  3106. 0x05 => '1 of 5',
  3107. 0x15 => '2 of 5',
  3108. 0x25 => '3 of 5',
  3109. 0x35 => '4 of 5',
  3110. 0x45 => '5 of 5',
  3111. },
  3112. },
  3113. 10 => {
  3114. Name => 'WhiteBalanceSet',
  3115. Mask => 0xf0,
  3116. # Not necessarily the white balance used; for example if the custom menu is set to
  3117. # "WB when using flash" -> "2 Flash", then this tag reports the camera setting while
  3118. # tag 0x0019 reports Flash if the Flash was used.
  3119. PrintConv => {
  3120. 0 => 'Auto',
  3121. 16 => 'Daylight',
  3122. 32 => 'Shade',
  3123. 48 => 'Cloudy',
  3124. 64 => 'Daylight Fluorescent',
  3125. 80 => 'Day White Fluorescent',
  3126. 96 => 'White Fluorescent',
  3127. 112 => 'Tungsten',
  3128. 128 => 'Flash',
  3129. 144 => 'Manual',
  3130. # The three Set Color Temperature settings refer to the 3 preset settings which
  3131. # can be saved in the menu (see page 123 of the K10D manual)
  3132. 192 => 'Set Color Temperature 1',
  3133. 208 => 'Set Color Temperature 2',
  3134. 224 => 'Set Color Temperature 3',
  3135. },
  3136. },
  3137. 10.1 => {
  3138. Name => 'MultipleExposureSet',
  3139. Mask => 0x0f,
  3140. PrintConv => {
  3141. 0 => 'Off',
  3142. 1 => 'On',
  3143. },
  3144. },
  3145. 13 => {
  3146. Name => 'RawAndJpgRecording',
  3147. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3148. Notes => 'K10D only',
  3149. # this is actually a bit field: - PH
  3150. # bit 0=JPEG, bit 2=PEF, bit 3=DNG; high nibble: 0x00=best, 0x20=better, 0x40=good
  3151. PrintHex => 1,
  3152. PrintConv => {
  3153. 0x01 => 'JPEG (Best)', #PH
  3154. 0x04 => 'RAW (PEF, Best)',
  3155. 0x05 => 'RAW+JPEG (PEF, Best)',
  3156. 0x08 => 'RAW (DNG, Best)', #PH (NC)
  3157. 0x09 => 'RAW+JPEG (DNG, Best)', #PH (NC)
  3158. 0x21 => 'JPEG (Better)', #PH
  3159. 0x24 => 'RAW (PEF, Better)',
  3160. 0x25 => 'RAW+JPEG (PEF, Better)', #PH
  3161. 0x28 => 'RAW (DNG, Better)', #PH
  3162. 0x29 => 'RAW+JPEG (DNG, Better)', #PH (NC)
  3163. 0x41 => 'JPEG (Good)',
  3164. 0x44 => 'RAW (PEF, Good)', #PH (NC)
  3165. 0x45 => 'RAW+JPEG (PEF, Good)', #PH (NC)
  3166. 0x48 => 'RAW (DNG, Good)', #PH (NC)
  3167. 0x49 => 'RAW+JPEG (DNG, Good)',
  3168. # have seen values of 0,2,34 for other models (not K10D) - PH
  3169. },
  3170. },
  3171. 14.1 => { #PH
  3172. Name => 'JpgRecordedPixels',
  3173. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3174. Notes => 'K10D only',
  3175. Mask => 0x03,
  3176. PrintConv => {
  3177. 0 => '10 MP',
  3178. 1 => '6 MP',
  3179. 2 => '2 MP',
  3180. },
  3181. },
  3182. 14.2 => { #PH (K-5)
  3183. Name => 'LinkAEToAFPoint',
  3184. Condition => '$$self{Model} =~ /K-5\b/',
  3185. Notes => 'K-5 only',
  3186. Mask => 0x01,
  3187. PrintConv => {
  3188. 0x00 => 'Off',
  3189. 0x01 => 'On',
  3190. },
  3191. },
  3192. 14.3 => { #PH (K-5)
  3193. Name => 'SensitivitySteps',
  3194. Condition => '$$self{Model} =~ /K-5\b/',
  3195. Notes => 'K-5 only',
  3196. Mask => 0x02,
  3197. PrintConv => {
  3198. 0x00 => '1 EV Steps',
  3199. 0x02 => 'As EV Steps',
  3200. },
  3201. },
  3202. 14.4 => { #PH (K-5)
  3203. Name => 'ISOAuto',
  3204. Condition => '$$self{Model} =~ /K-5\b/',
  3205. Notes => 'K-5 only',
  3206. Mask => 0x04,
  3207. PrintConv => {
  3208. 0x00 => 'Off',
  3209. 0x04 => 'On',
  3210. },
  3211. },
  3212. # 14.5 Mask 0x80 - changes for K-5
  3213. 16 => {
  3214. Name => 'FlashOptions2',
  3215. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3216. Notes => 'K10D only; set even if the flash is off',
  3217. Mask => 0xf0,
  3218. # Note: the Normal and Auto values (0x00 to 0x30) do not tags always
  3219. # correlate with the FlashMode, InternalFlashMode and FlashOptions values
  3220. # however, these values seem to better match the K10D's actual functionality
  3221. # (always Auto in Green mode always Normal otherwise if one of the other options
  3222. # isn't selected) - ref 19
  3223. # (these tags relate closely to InternalFlashMode values - PH)
  3224. PrintConv => {
  3225. 0x00 => 'Normal', # (this value never occurs in Green Mode) - ref 19
  3226. 0x10 => 'Red-eye reduction', # (this value never occurs in Green Mode) - ref 19
  3227. 0x20 => 'Auto', # (this value only occurs in Green Mode) - ref 19
  3228. 0x30 => 'Auto, Red-eye reduction', # (this value only occurs in Green Mode) - ref 19
  3229. 0x50 => 'Wireless (Master)',
  3230. 0x60 => 'Wireless (Control)',
  3231. 0x80 => 'Slow-sync',
  3232. 0x90 => 'Slow-sync, Red-eye reduction',
  3233. 0xa0 => 'Trailing-curtain Sync'
  3234. },
  3235. },
  3236. 16.1 => {
  3237. Name => 'MeteringMode3',
  3238. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3239. Notes => 'K10D only',
  3240. Mask => 0x0f,
  3241. PrintConv => {
  3242. 0 => 'Multi-segment',
  3243. BITMASK => {
  3244. 0 => 'Center-weighted average',
  3245. 1 => 'Spot',
  3246. },
  3247. },
  3248. },
  3249. # 16 Mask 0x0f - changes when changing EV steps? (K-5)
  3250. 17.1 => {
  3251. Name => 'SRActive',
  3252. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3253. Notes => q{
  3254. K10D only; SR is active only when ShakeReduction is On, DriveMode is not
  3255. Remote or Self-timer, and Internal/ExternalFlashMode is not "On, Wireless"
  3256. },
  3257. Mask => 0x80,
  3258. PrintConv => {
  3259. 0x00 => 'No',
  3260. 0x80 => 'Yes',
  3261. },
  3262. },
  3263. 17.2 => {
  3264. Name => 'Rotation',
  3265. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3266. Notes => 'K10D only',
  3267. Mask => 0x60,
  3268. PrintConv => {
  3269. 0x00 => 'Horizontal (normal)',
  3270. 0x20 => 'Rotate 180',
  3271. 0x40 => 'Rotate 90 CW',
  3272. 0x60 => 'Rotate 270 CW',
  3273. },
  3274. },
  3275. # Bit 0x08 is set on 3 of my 3000 shots to (All 3 were Shutter Priority
  3276. # but this may not mean anything with such a small sample) - ref 19
  3277. 17.3 => {
  3278. Name => 'ISOSetting',
  3279. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3280. Notes => 'K10D only',
  3281. Mask => 0x04,
  3282. PrintConv => {
  3283. 0x00 => 'Manual',
  3284. 0x04 => 'Auto',
  3285. },
  3286. },
  3287. 17.4 => {
  3288. Name => 'SensitivitySteps',
  3289. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3290. Notes => 'K10D only',
  3291. Mask => 0x02,
  3292. PrintConv => {
  3293. 0x00 => '1 EV Steps',
  3294. 0x02 => 'As EV Steps',
  3295. },
  3296. },
  3297. # 17 Mask 0x08 - changed when changing Auto ISO range (K-5)
  3298. 18 => {
  3299. Name => 'TvExposureTimeSetting',
  3300. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3301. Notes => 'K10D only',
  3302. ValueConv => 'exp(-Image::ExifTool::Pentax::PentaxEv($val-68)*log(2))',
  3303. ValueConvInv => 'Image::ExifTool::Pentax::PentaxEvInv(-log($val)/log(2))+68',
  3304. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3305. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3306. },
  3307. 19 => {
  3308. Name => 'AvApertureSetting',
  3309. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3310. Notes => 'K10D only',
  3311. ValueConv => 'exp(Image::ExifTool::Pentax::PentaxEv($val-68)*log(2)/2)',
  3312. ValueConvInv => 'Image::ExifTool::Pentax::PentaxEvInv(log($val)*2/log(2))+68',
  3313. PrintConv => 'sprintf("%.1f",$val)',
  3314. PrintConvInv => '$val',
  3315. },
  3316. 20 => { #PH
  3317. Name => 'SvISOSetting',
  3318. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3319. Notes => 'K10D only',
  3320. # ISO setting for sensitivity-priority mode
  3321. # (conversion may not give actual displayed values:)
  3322. # 32 => 100, 35 => 125, 36 => 140, 37 => 160,
  3323. # 40 => 200, 43 => 250, 44 => 280, 45 => 320,
  3324. # 48 => 400, 51 => 500, 52 => 560, 53 => 640,
  3325. # 56 => 800, 59 => 1000,60 => 1100,61 => 1250, 64 => 1600
  3326. ValueConv => 'int(100*exp(Image::ExifTool::Pentax::PentaxEv($val-32)*log(2))+0.5)',
  3327. ValueConvInv => 'Image::ExifTool::Pentax::PentaxEvInv(log($val/100)/log(2))+32',
  3328. },
  3329. 21 => { #PH
  3330. Name => 'BaseExposureCompensation',
  3331. Condition => '$$self{Model} =~ /(K10D|GX10)\b/',
  3332. Notes => 'K10D only; exposure compensation without auto bracketing',
  3333. ValueConv => 'Image::ExifTool::Pentax::PentaxEv(64-$val)',
  3334. ValueConvInv => '64-Image::ExifTool::Pentax::PentaxEvInv($val)',
  3335. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  3336. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3337. },
  3338. );
  3339. # unknown camera settings (K-01)
  3340. %Image::ExifTool::Pentax::CameraSettingsUnknown = (
  3341. %binaryDataAttrs,
  3342. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3343. NOTES => 'This information has not yet been decoded for models such as the K-01.',
  3344. );
  3345. # auto-exposure information (ref PH)
  3346. %Image::ExifTool::Pentax::AEInfo = (
  3347. %binaryDataAttrs,
  3348. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3349. DATAMEMBER => [ 7 ],
  3350. NOTES => 'Auto-exposure information for most Pentax models.',
  3351. # instead of /8, should these be PentaxEv(), as in CameraSettings? - PH
  3352. 0 => {
  3353. Name => 'AEExposureTime',
  3354. Notes => 'val = 24 * 2**((32-raw)/8)',
  3355. ValueConv => '24*exp(-($val-32)*log(2)/8)',
  3356. ValueConvInv => '-log($val/24)*8/log(2)+32',
  3357. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3358. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3359. },
  3360. 1 => {
  3361. Name => 'AEAperture',
  3362. Notes => 'val = 2**((raw-68)/16)',
  3363. ValueConv => 'exp(($val-68)*log(2)/16)',
  3364. ValueConvInv => 'log($val)*16/log(2)+68',
  3365. PrintConv => 'sprintf("%.1f",$val)',
  3366. PrintConvInv => '$val',
  3367. },
  3368. 2 => {
  3369. Name => 'AE_ISO',
  3370. Notes => 'val = 100 * 2**((raw-32)/8)',
  3371. ValueConv => '100*exp(($val-32)*log(2)/8)',
  3372. ValueConvInv => 'log($val/100)*8/log(2)+32',
  3373. PrintConv => 'int($val + 0.5)',
  3374. PrintConvInv => '$val',
  3375. },
  3376. 3 => {
  3377. Name => 'AEXv',
  3378. Notes => 'val = (raw-64)/8',
  3379. ValueConv => '($val-64)/8',
  3380. ValueConvInv => '$val * 8 + 64',
  3381. },
  3382. 4 => {
  3383. Name => 'AEBXv',
  3384. Format => 'int8s',
  3385. Notes => 'val = raw / 8',
  3386. ValueConv => '$val / 8',
  3387. ValueConvInv => '$val * 8',
  3388. },
  3389. 5 => {
  3390. Name => 'AEMinExposureTime', #19
  3391. Notes => 'val = 24 * 2**((32-raw)/8)',
  3392. ValueConv => '24*exp(-($val-32)*log(2)/8)', #JD
  3393. ValueConvInv => '-log($val/24)*8/log(2)+32',
  3394. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3395. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3396. },
  3397. 6 => {
  3398. Name => 'AEProgramMode',
  3399. PrintConvColumns => 2,
  3400. PrintConv => {
  3401. 0 => 'M, P or TAv',
  3402. 1 => 'Av, B or X',
  3403. 2 => 'Tv',
  3404. 3 => 'Sv or Green Mode',
  3405. 8 => 'Hi-speed Program',
  3406. 11 => 'Hi-speed Program (P-Shift)', #19
  3407. 16 => 'DOF Program', #19
  3408. 19 => 'DOF Program (P-Shift)', #19
  3409. 24 => 'MTF Program', #19
  3410. 27 => 'MTF Program (P-Shift)', #19
  3411. 35 => 'Standard',
  3412. 43 => 'Portrait',
  3413. 51 => 'Landscape',
  3414. 59 => 'Macro',
  3415. 67 => 'Sport',
  3416. 75 => 'Night Scene Portrait',
  3417. 83 => 'No Flash',
  3418. 91 => 'Night Scene',
  3419. # 96 - seen for Pentax Q10
  3420. 99 => 'Surf & Snow',
  3421. 104 => 'Night Snap', # (Q)
  3422. 107 => 'Text',
  3423. 115 => 'Sunset',
  3424. # 116 - seen for Pentax Q (vivid?)
  3425. 123 => 'Kids',
  3426. 131 => 'Pet',
  3427. 139 => 'Candlelight',
  3428. 144 => 'SCN', # (Q)
  3429. 160 => 'Program', # (Q)
  3430. # 142 - seen for Pentax Q in Program mode
  3431. 147 => 'Museum',
  3432. 184 => 'Shallow DOF Program', # (K-5)
  3433. 216 => 'HDR', # (Q)
  3434. },
  3435. },
  3436. 7 => {
  3437. Name => 'AEFlags',
  3438. Writable => 0,
  3439. Hook => '$size > 20 and $varSize += 1',
  3440. Notes => 'indices after this are incremented by 1 for some models',
  3441. # (this tag can't be unknown because the Hook must be evaluated
  3442. # to shift the following offsets if necessary. Instead, ignore
  3443. # the return value unless Unknown option used)
  3444. RawConv => '$$self{OPTIONS}{Unknown} ? $val : undef',
  3445. PrintConv => { #19
  3446. # (seems to be the warnings displayed in the viewfinder for several bits)
  3447. BITMASK => {
  3448. # 0 - seen in extreme low light conditions (e.g. Lens Cap On)
  3449. # 1 - seen in 2 cases, Aperture Priority mode, Auto ISO at 100,
  3450. # Shutter speed at 1/4000 and aperture opened wider causing under exposure
  3451. # 2 - only (but not always) set in Shutter Speed Priority (seems to be when over/under exposed).
  3452. # In one case set when auto exposure compensation changed the Tv from 1/250 to 1/80.
  3453. # In another case set when external flash was in SB mode so did not fire.
  3454. 3 => 'AE lock',
  3455. 4 => 'Flash recommended?', # not 100% sure of this one
  3456. # 5 - seen lots...
  3457. # 6 - seen lots...
  3458. 7 => 'Aperture wide open', # mostly true... (Set for all my lenses except for DA* 16-50mm)
  3459. },
  3460. },
  3461. },
  3462. # Note: Offsets below shifted by 1 if record size is > 20 bytes
  3463. # (implemented by the Hook above)
  3464. 8 => { #30
  3465. Name => 'AEApertureSteps',
  3466. Notes => q{
  3467. number of steps the aperture has been stopped down from wide open. There
  3468. are roughly 8 steps per F-stop for most lenses, or 18 steps for 645D lenses,
  3469. but it varies slightly by lens
  3470. },
  3471. PrintConv => '$val == 255 ? "n/a" : $val',
  3472. PrintConvInv => '$val eq "n/a" ? 255 : $val',
  3473. },
  3474. 9 => { #19
  3475. Name => 'AEMaxAperture',
  3476. Notes => 'val = 2**((raw-68)/16)',
  3477. ValueConv => 'exp(($val-68)*log(2)/16)',
  3478. ValueConvInv => 'log($val)*16/log(2)+68',
  3479. PrintConv => 'sprintf("%.1f",$val)',
  3480. PrintConvInv => '$val',
  3481. },
  3482. 10 => { #19
  3483. Name => 'AEMaxAperture2',
  3484. Notes => 'val = 2**((raw-68)/16)',
  3485. ValueConv => 'exp(($val-68)*log(2)/16)',
  3486. ValueConvInv => 'log($val)*16/log(2)+68',
  3487. PrintConv => 'sprintf("%.1f",$val)',
  3488. PrintConvInv => '$val',
  3489. },
  3490. 11 => { #19
  3491. Name => 'AEMinAperture',
  3492. Notes => 'val = 2**((raw-68)/16)',
  3493. ValueConv => 'exp(($val-68)*log(2)/16)',
  3494. ValueConvInv => 'log($val)*16/log(2)+68',
  3495. PrintConv => 'sprintf("%.0f",$val)',
  3496. PrintConvInv => '$val',
  3497. },
  3498. 12 => { #19
  3499. Name => 'AEMeteringMode',
  3500. PrintConv => {
  3501. 0 => 'Multi-segment',
  3502. BITMASK => {
  3503. 4 => 'Center-weighted average',
  3504. 5 => 'Spot',
  3505. },
  3506. },
  3507. },
  3508. 13 => { #30
  3509. Name => 'AEWhiteBalance',
  3510. Condition => '$$self{AEInfoSize} == 24', # (not thoroughly tested for other sizes)
  3511. Notes => 'K7 and Kx',
  3512. Mask => 0xf0,
  3513. PrintConv => {
  3514. 0x00 => 'Standard',
  3515. 0x10 => 'Daylight',
  3516. 0x20 => 'Shade',
  3517. 0x30 => 'Cloudy',
  3518. 0x40 => 'Daylight Fluorescent',
  3519. 0x50 => 'Day White Fluorescent',
  3520. 0x60 => 'White Fluorescent',
  3521. 0x70 => 'Tungsten',
  3522. },
  3523. },
  3524. 13.1 => { #30
  3525. Name => 'AEMeteringMode2',
  3526. Condition => '$$self{AEInfoSize} == 24', # (not thoroughly tested for other sizes)
  3527. Notes => 'K7 and Kx, override for an incompatable metering mode setting',
  3528. Mask => 0x0f,
  3529. PrintConv => {
  3530. 0 => 'Multi-segment',
  3531. BITMASK => {
  3532. 0 => 'Center-weighted average',
  3533. 1 => 'Spot',
  3534. # 2 - seen for K7 AVI movie
  3535. },
  3536. },
  3537. },
  3538. 14 => { #19
  3539. Name => 'FlashExposureCompSet',
  3540. Description => 'Flash Exposure Comp. Setting',
  3541. Format => 'int8s',
  3542. Notes => q{
  3543. reports the camera setting, unlike tag 0x004d which reports 0 in Green mode
  3544. or if flash was on but did not fire. Both this tag and 0x004d report the
  3545. setting even if the flash is off
  3546. },
  3547. ValueConv => 'Image::ExifTool::Pentax::PentaxEv($val)',
  3548. ValueConvInv => 'Image::ExifTool::Pentax::PentaxEvInv($val)',
  3549. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  3550. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3551. },
  3552. 21 => { #30
  3553. Name => 'LevelIndicator',
  3554. PrintConv => '$val == 90 ? "n/a" : $val',
  3555. PrintConvInv => '$val eq "n/a" ? 90 : $val',
  3556. },
  3557. );
  3558. # auto-exposure information for the K-01 (ref PH)
  3559. %Image::ExifTool::Pentax::AEInfo2 = (
  3560. %binaryDataAttrs,
  3561. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3562. NOTES => 'Auto-exposure information for the K-01.',
  3563. # instead of /8, should these be PentaxEv(), as in CameraSettings? - PH
  3564. 2 => {
  3565. Name => 'AEExposureTime',
  3566. Notes => 'val = 24 * 2**((32-raw)/8)',
  3567. ValueConv => '24*exp(-($val-32)*log(2)/8)',
  3568. ValueConvInv => '-log($val/24)*8/log(2)+32',
  3569. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3570. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3571. },
  3572. 3 => {
  3573. Name => 'AEAperture',
  3574. Notes => 'val = 2**((raw-68)/16)',
  3575. ValueConv => 'exp(($val-68)*log(2)/16)',
  3576. ValueConvInv => 'log($val)*16/log(2)+68',
  3577. PrintConv => 'sprintf("%.1f",$val)',
  3578. PrintConvInv => '$val',
  3579. },
  3580. 4 => {
  3581. Name => 'AE_ISO',
  3582. Notes => 'val = 100 * 2**((raw-32)/8)',
  3583. ValueConv => '100*exp(($val-32)*log(2)/8)',
  3584. ValueConvInv => 'log($val/100)*8/log(2)+32',
  3585. PrintConv => 'int($val + 0.5)',
  3586. PrintConvInv => '$val',
  3587. },
  3588. 5 => {
  3589. Name => 'AEXv',
  3590. # this is the negative of exposure compensation, not including bracketing
  3591. Notes => 'val = (raw-64)/8',
  3592. ValueConv => '($val-64)/8',
  3593. ValueConvInv => '$val * 8 + 64',
  3594. },
  3595. 6 => {
  3596. Name => 'AEBXv',
  3597. # this is the negative of auto exposure bracketing compensation
  3598. Format => 'int8s',
  3599. Notes => 'val = raw / 8',
  3600. ValueConv => '$val / 8',
  3601. ValueConvInv => '$val * 8',
  3602. },
  3603. 8 => {
  3604. Name => 'AEError',
  3605. Format => 'int8s',
  3606. # this is usually zero except in M exposure mode, but it can be non-zero
  3607. # in other modes (eg. if you hit an aperture limit in Tv mode)
  3608. ValueConv => '-($val-64)/8', # (negate to make overexposed positive)
  3609. ValueConvInv => '-$val * 8 + 64',
  3610. },
  3611. 11 => {
  3612. Name => 'AEApertureSteps',
  3613. Notes => q{
  3614. number of steps the aperture has been stopped down from wide open. There
  3615. are roughly 8 steps per F-stop, but it varies slightly by lens
  3616. },
  3617. PrintConv => '$val == 255 ? "n/a" : $val',
  3618. PrintConvInv => '$val eq "n/a" ? 255 : $val',
  3619. },
  3620. 15 => {
  3621. Name => 'SceneMode',
  3622. PrintConvColumns => 2,
  3623. PrintConv => {
  3624. 0 => 'Off',
  3625. 1 => 'HDR',
  3626. 4 => 'Auto PICT',
  3627. 5 => 'Portrait',
  3628. 6 => 'Landscape',
  3629. 7 => 'Macro',
  3630. 8 => 'Sport',
  3631. 9 => 'Night Scene Portrait',
  3632. 10 => 'No Flash',
  3633. 11 => 'Night Scene',
  3634. 12 => 'Surf & Snow',
  3635. 14 => 'Sunset',
  3636. 15 => 'Kids',
  3637. 16 => 'Pet',
  3638. 17 => 'Candlelight',
  3639. 18 => 'Museum',
  3640. 20 => 'Food',
  3641. 21 => 'Stage Lighting',
  3642. 22 => 'Night Snap',
  3643. 25 => 'Night Scene HDR',
  3644. 26 => 'Blue Sky',
  3645. 27 => 'Forest',
  3646. 29 => 'Backlight Silhouette',
  3647. },
  3648. },
  3649. 16 => {
  3650. Name => 'AEMaxAperture',
  3651. Notes => 'val = 2**((raw-68)/16)',
  3652. ValueConv => 'exp(($val-68)*log(2)/16)',
  3653. ValueConvInv => 'log($val)*16/log(2)+68',
  3654. PrintConv => 'sprintf("%.1f",$val)',
  3655. PrintConvInv => '$val',
  3656. },
  3657. 17 => {
  3658. Name => 'AEMaxAperture2',
  3659. Notes => 'val = 2**((raw-68)/16)',
  3660. ValueConv => 'exp(($val-68)*log(2)/16)',
  3661. ValueConvInv => 'log($val)*16/log(2)+68',
  3662. PrintConv => 'sprintf("%.1f",$val)',
  3663. PrintConvInv => '$val',
  3664. },
  3665. 18 => {
  3666. Name => 'AEMinAperture',
  3667. Notes => 'val = 2**((raw-68)/16)',
  3668. ValueConv => 'exp(($val-68)*log(2)/16)',
  3669. ValueConvInv => 'log($val)*16/log(2)+68',
  3670. PrintConv => 'sprintf("%.0f",$val)',
  3671. PrintConvInv => '$val',
  3672. },
  3673. 19 => {
  3674. Name => 'AEMinExposureTime',
  3675. Notes => 'val = 24 * 2**((32-raw)/8)',
  3676. ValueConv => '24*exp(-($val-32)*log(2)/8)',
  3677. ValueConvInv => '-log($val/24)*8/log(2)+32',
  3678. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3679. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3680. },
  3681. );
  3682. # auto-exposure information for the K-30 (ref PH)
  3683. %Image::ExifTool::Pentax::AEInfo3 = (
  3684. %binaryDataAttrs,
  3685. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3686. NOTES => 'Auto-exposure information for the K-3, K-30, K-50 and K-500.',
  3687. # instead of /8, should these be PentaxEv(), as in CameraSettings? - PH
  3688. 16 => {
  3689. Name => 'AEExposureTime',
  3690. Notes => 'val = 24 * 2**((32-raw)/8)',
  3691. ValueConv => '24*exp(-($val-32)*log(2)/8)',
  3692. ValueConvInv => '-log($val/24)*8/log(2)+32',
  3693. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3694. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3695. },
  3696. 17 => {
  3697. Name => 'AEAperture',
  3698. Notes => 'val = 2**((raw-68)/16)',
  3699. ValueConv => 'exp(($val-68)*log(2)/16)',
  3700. ValueConvInv => 'log($val)*16/log(2)+68',
  3701. PrintConv => 'sprintf("%.1f",$val)',
  3702. PrintConvInv => '$val',
  3703. },
  3704. 18 => {
  3705. Name => 'AE_ISO',
  3706. Notes => 'val = 100 * 2**((raw-32)/8)',
  3707. ValueConv => '100*exp(($val-32)*log(2)/8)',
  3708. ValueConvInv => 'log($val/100)*8/log(2)+32',
  3709. PrintConv => 'int($val + 0.5)',
  3710. PrintConvInv => '$val',
  3711. },
  3712. 28 => {
  3713. Name => 'AEMaxAperture',
  3714. Notes => 'val = 2**((raw-68)/16)',
  3715. ValueConv => 'exp(($val-68)*log(2)/16)',
  3716. ValueConvInv => 'log($val)*16/log(2)+68',
  3717. PrintConv => 'sprintf("%.1f",$val)',
  3718. PrintConvInv => '$val',
  3719. },
  3720. 29 => {
  3721. Name => 'AEMaxAperture2',
  3722. Notes => 'val = 2**((raw-68)/16)',
  3723. ValueConv => 'exp(($val-68)*log(2)/16)',
  3724. ValueConvInv => 'log($val)*16/log(2)+68',
  3725. PrintConv => 'sprintf("%.1f",$val)',
  3726. PrintConvInv => '$val',
  3727. },
  3728. 30 => {
  3729. Name => 'AEMinAperture',
  3730. Notes => 'val = 2**((raw-68)/16)',
  3731. ValueConv => 'exp(($val-68)*log(2)/16)',
  3732. ValueConvInv => 'log($val)*16/log(2)+68',
  3733. PrintConv => 'sprintf("%.0f",$val)',
  3734. PrintConvInv => '$val',
  3735. },
  3736. 31 => {
  3737. Name => 'AEMinExposureTime',
  3738. Notes => 'val = 24 * 2**((32-raw)/8)',
  3739. ValueConv => '24*exp(-($val-32)*log(2)/8)',
  3740. ValueConvInv => '-log($val/24)*8/log(2)+32',
  3741. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  3742. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3743. },
  3744. );
  3745. # unknown auto-exposure information (Q, Q10)
  3746. %Image::ExifTool::Pentax::AEInfoUnknown = (
  3747. %binaryDataAttrs,
  3748. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3749. );
  3750. # lens type
  3751. %Image::ExifTool::Pentax::LensRec = (
  3752. %binaryDataAttrs,
  3753. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3754. NOTES => q{
  3755. This record stores the LensType, plus one or two unknown bytes for some
  3756. models.
  3757. },
  3758. 0 => {
  3759. Name => 'LensType',
  3760. Format => 'int8u[2]',
  3761. Priority => 0,
  3762. ValueConvInv => '$val=~s/\.\d+$//; $val',
  3763. PrintConv => \%pentaxLensTypes,
  3764. SeparateTable => 1,
  3765. },
  3766. 3 => { #PH
  3767. Name => 'ExtenderStatus',
  3768. Notes => 'not valid if a non-AF lens is used',
  3769. PrintConv => { 0 => 'Not attached', 1 => 'Attached' },
  3770. },
  3771. # this is a binaryData table because some cameras add an extra
  3772. # byte or two here (typically zeros)...
  3773. );
  3774. # lens information (ref PH)
  3775. %Image::ExifTool::Pentax::LensInfo = (
  3776. %binaryDataAttrs,
  3777. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3778. IS_SUBDIR => [ 3 ],
  3779. NOTES => 'Pentax lens information structure for models such as the *istD.',
  3780. 0 => {
  3781. Name => 'LensType',
  3782. Format => 'int8u[2]',
  3783. Priority => 0,
  3784. ValueConvInv => '$val=~s/\.\d+$//; $val',
  3785. PrintConv => \%pentaxLensTypes,
  3786. SeparateTable => 1,
  3787. },
  3788. 3 => {
  3789. Name => 'LensData',
  3790. Format => 'undef[17]',
  3791. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensData' },
  3792. },
  3793. );
  3794. # lens information for newer models (ref PH)
  3795. %Image::ExifTool::Pentax::LensInfo2 = (
  3796. %binaryDataAttrs,
  3797. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3798. IS_SUBDIR => [ 4 ],
  3799. NOTES => 'Pentax lens information structure for models such as the K10D and K20D.',
  3800. 0 => {
  3801. Name => 'LensType',
  3802. Format => 'int8u[4]',
  3803. Priority => 0,
  3804. ValueConv => q{
  3805. my @v = split(' ',$val);
  3806. $v[0] &= 0x0f;
  3807. $v[1] = $v[2] * 256 + $v[3]; # (always high byte first)
  3808. return "$v[0] $v[1]";
  3809. },
  3810. # just fill in the missing bits/bytes with zeros...
  3811. ValueConvInv => q{
  3812. my @v = split(' ',$val);
  3813. return undef unless @v == 2;
  3814. $v[2] = ($v[1] >> 8) & 0xff;
  3815. $v[3] = $v[1] & 0xff;
  3816. $v[1] = 0;
  3817. return "@v";
  3818. },
  3819. PrintConv => \%pentaxLensTypes,
  3820. SeparateTable => 1,
  3821. },
  3822. 4 => {
  3823. Name => 'LensData',
  3824. Format => 'undef[17]',
  3825. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensData' },
  3826. },
  3827. );
  3828. # lens information for 645D (ref PH)
  3829. %Image::ExifTool::Pentax::LensInfo3 = (
  3830. %binaryDataAttrs,
  3831. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3832. IS_SUBDIR => [ 13 ],
  3833. NOTES => 'Pentax lens information structure for 645D.',
  3834. 1 => {
  3835. Name => 'LensType',
  3836. Format => 'int8u[4]',
  3837. Priority => 0,
  3838. ValueConv => q{
  3839. my @v = split(' ',$val);
  3840. $v[0] &= 0x0f;
  3841. $v[1] = $v[2] * 256 + $v[3]; # (always high byte first)
  3842. return "$v[0] $v[1]";
  3843. },
  3844. # just fill in the missing bits/bytes with zeros...
  3845. ValueConvInv => q{
  3846. my @v = split(' ',$val);
  3847. return undef unless @v == 2;
  3848. $v[2] = ($v[1] >> 8) & 0xff;
  3849. $v[3] = $v[1] & 0xff;
  3850. $v[1] = 0;
  3851. return "@v";
  3852. },
  3853. PrintConv => \%pentaxLensTypes,
  3854. SeparateTable => 1,
  3855. },
  3856. 13 => {
  3857. Name => 'LensData',
  3858. Format => 'undef[17]',
  3859. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensData' },
  3860. },
  3861. );
  3862. # lens information for K-5, K-r, etc (ref PH)
  3863. %Image::ExifTool::Pentax::LensInfo4 = (
  3864. %binaryDataAttrs,
  3865. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3866. IS_SUBDIR => [ 12 ],
  3867. NOTES => 'Pentax lens information structure for models such as the K-5 and K-r.',
  3868. 1 => {
  3869. Name => 'LensType',
  3870. Format => 'int8u[4]',
  3871. Priority => 0,
  3872. ValueConv => q{
  3873. my @v = split(' ',$val);
  3874. $v[0] &= 0x0f;
  3875. $v[1] = $v[2] * 256 + $v[3]; # (always high byte first)
  3876. return "$v[0] $v[1]";
  3877. },
  3878. # just fill in the missing bits/bytes with zeros...
  3879. ValueConvInv => q{
  3880. my @v = split(' ',$val);
  3881. return undef unless @v == 2;
  3882. $v[2] = ($v[1] >> 8) & 0xff;
  3883. $v[3] = $v[1] & 0xff;
  3884. $v[1] = 0;
  3885. return "@v";
  3886. },
  3887. PrintConv => \%pentaxLensTypes,
  3888. SeparateTable => 1,
  3889. },
  3890. 12 => {
  3891. Name => 'LensData',
  3892. Format => 'undef[18]',
  3893. Condition => '$$self{NewLensData} = 1', # not really a condition, just used to set flag
  3894. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensData' },
  3895. },
  3896. );
  3897. # lens information for K-01, K-30, K-50, K-500, K-3, K-3II (ref PH)
  3898. %Image::ExifTool::Pentax::LensInfo5 = (
  3899. %binaryDataAttrs,
  3900. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3901. IS_SUBDIR => [ 15 ],
  3902. NOTES => 'Pentax lens information structure for the K-01 and newer models.',
  3903. 1 => {
  3904. Name => 'LensType',
  3905. Format => 'int8u[5]',
  3906. Priority => 0,
  3907. ValueConv => q{
  3908. my @v = split(' ',$val);
  3909. $v[0] &= 0x0f;
  3910. $v[1] = $v[3] * 256 + $v[4]; # (always high byte first)
  3911. return "$v[0] $v[1]";
  3912. },
  3913. # just fill in the missing bits/bytes with zeros...
  3914. ValueConvInv => q{
  3915. my @v = split(' ',$val);
  3916. return undef unless @v == 2;
  3917. $v[3] = ($v[1] >> 8) & 0xff;
  3918. $v[4] = $v[1] & 0xff;
  3919. $v[1] = $v[2] = 0;
  3920. return "@v";
  3921. },
  3922. PrintConv => \%pentaxLensTypes,
  3923. SeparateTable => 1,
  3924. },
  3925. 15 => {
  3926. Name => 'LensData',
  3927. Format => 'undef[17]',
  3928. SubDirectory => { TagTable => 'Image::ExifTool::Pentax::LensData' },
  3929. },
  3930. );
  3931. # lens data information, including lens codes (ref PH)
  3932. %Image::ExifTool::Pentax::LensData = (
  3933. %binaryDataAttrs,
  3934. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3935. DATAMEMBER => [ 12.1 ],
  3936. NOTES => q{
  3937. Pentax lens data information. Some of these tags require interesting binary
  3938. gymnastics to decode them into useful values.
  3939. },
  3940. # this byte comes from the lens electrical contacts
  3941. # (see http://kmp.bdimitrov.de/technology/K-mount/Ka.html)
  3942. 0.1 => { #JD
  3943. Name => 'AutoAperture',
  3944. Condition => 'not $$self{NewLensData}',
  3945. Notes => 'not valid for the K-r, K-5 or K-5II', #29
  3946. Mask => 0x01,
  3947. PrintConv => {
  3948. 0 => 'On',
  3949. 1 => 'Off',
  3950. },
  3951. },
  3952. 0.2 => { #JD
  3953. Name => 'MinAperture',
  3954. Condition => 'not $$self{NewLensData}',
  3955. Notes => 'not valid for the K-r, K-5 or K-5II', #29
  3956. Mask => 0x06,
  3957. PrintConv => {
  3958. 0x00 => 22,
  3959. 0x02 => 32,
  3960. 0x04 => 45,
  3961. 0x06 => 16,
  3962. },
  3963. },
  3964. 0.3 => { #JD
  3965. Name => 'LensFStops',
  3966. Condition => 'not $$self{NewLensData}',
  3967. Notes => 'not valid for the K-r, K-5 or K-5II', #29
  3968. Mask => 0x70,
  3969. ValueConv => '5 + (($val >> 4) ^ 0x07) / 2',
  3970. ValueConvInv => '((($val - 5) * 2) ^ 0x07) << 4',
  3971. },
  3972. # 1-16 look like Lens Codes LC0-LC15, ref patent 5617173 and 5999753 [+notes by PH]
  3973. 1 => { # LC0 = lens kind + version data
  3974. Name => 'LensKind',
  3975. %lensCode,
  3976. },
  3977. 2 => { # LC1 = lens data (changes with AF setting)
  3978. Name => 'LC1',
  3979. %lensCode,
  3980. },
  3981. # LC2 = distance data
  3982. 3 => { #29
  3983. Name => 'MinFocusDistance',
  3984. Notes => 'minimum focus distance for the lens',
  3985. Mask => 0xf8,
  3986. PrintConv => {
  3987. 0x00 => '0.13-0.19 m', # (plus K or M lenses)
  3988. 0x08 => '0.20-0.24 m',
  3989. 0x10 => '0.25-0.28 m',
  3990. 0x18 => '0.28-0.30 m',
  3991. 0x20 => '0.35-0.38 m',
  3992. 0x28 => '0.40-0.45 m',
  3993. 0x30 => '0.49-0.50 m', # (plus many Sigma lenses)
  3994. 0x38 => '0.6 m', #PH (NC)
  3995. 0x40 => '0.7 m', # (plus Sigma 55-200)
  3996. 0x48 => '0.8-0.9 m', #PH (NC) Tokina 28-70/2.6-2.8
  3997. 0x50 => '1.0 m', # (plus Sigma 70 macro)
  3998. 0x58 => '1.1-1.2 m',
  3999. 0x60 => '1.4-1.5 m',
  4000. 0x68 => '1.5 m', # Sigma 70-300/4-5.6 macro
  4001. 0x70 => '2.0 m',
  4002. 0x78 => '2.0-2.1 m', #PH (NC)
  4003. 0x80 => '2.1 m', # Sigma 135-400 APO & DG: 2.0-2.2m
  4004. 0x88 => '2.2-2.9 m', #PH (NC)
  4005. 0x90 => '3.0 m', # Sigma 50-500 : 1.0-3.0m depending on the focal length
  4006. ## 50mm, 100mm => 1.0m
  4007. ## 200mm => 1.1m
  4008. ## 300mm => 1.5m
  4009. ## 400mm => 2.2m
  4010. ## 500mm => 3.0m
  4011. 0x98 => '4-5 m', #PH (NC)
  4012. 0xa0 => '5.6 m', # Pentax DA 560
  4013. # To check: Sigma 120-400 OS: MFD 1.5m
  4014. # To check: Sigma 150-500 OS: MFD 2.2m
  4015. # To check: Sigma 50-500 has MFD 50-180cm
  4016. # 0xd0 - seen for the Sigma 4.5mm F2.8 EX DC HSM Circular Fisheye (ref PH)
  4017. },
  4018. },
  4019. 3.1 => { #29
  4020. Name => 'FocusRangeIndex',
  4021. Mask => 0x07,
  4022. PrintConv => {
  4023. 7 => '0 (very close)',
  4024. 6 => '1 (close)',
  4025. 4 => '2',
  4026. 5 => '3',
  4027. 1 => '4',
  4028. 0 => '5',
  4029. 2 => '6 (far)',
  4030. 3 => '7 (very far)',
  4031. },
  4032. },
  4033. 4 => { # LC3 = K-value data (AF pulses to displace image by unit length)
  4034. Name => 'LC3',
  4035. %lensCode,
  4036. },
  4037. 5 => { # LC4 = abberation correction, near distance data
  4038. Name => 'LC4',
  4039. %lensCode,
  4040. },
  4041. 6 => { # LC5 = light color abberation correction data
  4042. Name => 'LC5',
  4043. %lensCode,
  4044. },
  4045. 7 => { # LC6 = open abberation data
  4046. Name => 'LC6',
  4047. %lensCode,
  4048. },
  4049. 8 => { # LC7 = AF minimum actuation condition
  4050. Name => 'LC7',
  4051. %lensCode,
  4052. },
  4053. 9 => [{ # LC8 = focal length data
  4054. Name => 'LensFocalLength',
  4055. Notes => 'focal length of lens alone, without adapter', #PH
  4056. Priority => 0,
  4057. Condition => '$$self{Model} !~ /645Z/', #PH (doesn't work for 645Z)
  4058. ValueConv => '10*($val>>2) * 4**(($val&0x03)-2)', #JD
  4059. ValueConvInv => q{
  4060. my $range = int(log($val/10)/(2*log(2)));
  4061. warn("Value out of range") and return undef if $range < 0 or $range > 3;
  4062. return $range + (int($val/(10*4**($range-2))+0.5) << 2);
  4063. },
  4064. PrintConv => 'sprintf("%.1f mm", $val)',
  4065. PrintConvInv => '$val=~s/\s*mm//; $val',
  4066. },{
  4067. Name => 'LC8',
  4068. %lensCode,
  4069. }],
  4070. # the following aperture values change with focal length
  4071. 10 => { # LC9 = nominal AVmin/AVmax data (open/closed aperture values)
  4072. Name => 'NominalMaxAperture',
  4073. Mask => 0xf0,
  4074. ValueConv => '2**(($val>>4)/4)', #JD
  4075. ValueConvInv => '4*log($val)/log(2) << 4',
  4076. PrintConv => 'sprintf("%.1f", $val)',
  4077. PrintConvInv => '$val',
  4078. },
  4079. 10.1 => { # LC9 = nominal AVmin/AVmax data (open/closed aperture values)
  4080. Name => 'NominalMinAperture',
  4081. Mask => 0x0f,
  4082. ValueConv => '2**(($val+10)/4)', #JD
  4083. ValueConvInv => '4*log($val)/log(2) - 10',
  4084. PrintConv => 'sprintf("%.0f", $val)',
  4085. PrintConvInv => '$val',
  4086. },
  4087. 11 => { # LC10 = mv'/nv' data (full-aperture metering error compensation/marginal lumination compensation)
  4088. Name => 'LC10',
  4089. %lensCode,
  4090. },
  4091. 12 => { # LC11 = AVC 1/EXP data
  4092. Name => 'LC11',
  4093. %lensCode,
  4094. },
  4095. 12.1 => {
  4096. Name => 'NewLensDataHook',
  4097. Hidden => 1,
  4098. Hook => '$varSize += 1 if $$self{NewLensData}',
  4099. RawConv => 'undef',
  4100. },
  4101. 13 => { # LC12 = mv1 AVminsif data
  4102. Name => 'LC12',
  4103. Notes => "ID's 13-16 are offset by 1 for the K-r, K-5 and K-5II", #29
  4104. %lensCode,
  4105. },
  4106. # 14 - related to live view for K-5 (normally 3, but 1 or 5 in LV mode)
  4107. 14.1 => { # LC13 = AVmin (open aperture value) [MaxAperture=(2**((AVmin-1)/32))]
  4108. Name => 'MaxAperture',
  4109. Condition => '$$self{Model} ne "K-5"',
  4110. Notes => 'effective wide open aperture for current focal length',
  4111. Mask => 0x7f, # (not sure what the high bit indicates)
  4112. # (a value of 1 seems to indicate 'n/a')
  4113. RawConv => '$val > 1 ? $val : undef',
  4114. ValueConv => '2**(($val-1)/32)',
  4115. ValueConvInv => '32*log($val)/log(2) + 1',
  4116. PrintConv => 'sprintf("%.1f", $val)',
  4117. PrintConvInv => '$val',
  4118. },
  4119. 15 => { # LC14 = UNT_12 UNT_6 data
  4120. Name => 'LC14',
  4121. %lensCode,
  4122. },
  4123. 16 => { # LC15 = incorporated flash suited END data
  4124. Name => 'LC15',
  4125. %lensCode,
  4126. },
  4127. );
  4128. # flash information (ref PH)
  4129. %Image::ExifTool::Pentax::FlashInfo = (
  4130. %binaryDataAttrs,
  4131. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4132. NOTES => 'Flash information tags for the K10D, K20D and K200D.',
  4133. 0 => {
  4134. Name => 'FlashStatus',
  4135. PrintHex => 1,
  4136. PrintConv => { #19
  4137. 0x00 => 'Off',
  4138. 0x01 => 'Off (1)', #PH (K-5)
  4139. 0x02 => 'External, Did not fire', # 0010
  4140. 0x06 => 'External, Fired', # 0110
  4141. 0x08 => 'Internal, Did not fire (0x08)',
  4142. 0x09 => 'Internal, Did not fire', # 1001
  4143. 0x0d => 'Internal, Fired', # 1101
  4144. },
  4145. },
  4146. 1 => {
  4147. Name => 'InternalFlashMode',
  4148. PrintHex => 1,
  4149. PrintConv => {
  4150. 0x00 => 'n/a - Off-Auto-Aperture', #19
  4151. 0x86 => 'Fired, Wireless (Control)', #19
  4152. 0x95 => 'Fired, Wireless (Master)', #19
  4153. 0xc0 => 'Fired', # K10D
  4154. 0xc1 => 'Fired, Red-eye reduction', # *istDS2, K10D
  4155. 0xc2 => 'Fired, Auto', # K100D, K110D
  4156. 0xc3 => 'Fired, Auto, Red-eye reduction', #PH
  4157. 0xc6 => 'Fired, Wireless (Control), Fired normally not as control', #19 (Remote 3s)
  4158. 0xc8 => 'Fired, Slow-sync', # K10D
  4159. 0xc9 => 'Fired, Slow-sync, Red-eye reduction', # K10D
  4160. 0xca => 'Fired, Trailing-curtain Sync', # K10D
  4161. 0xf0 => 'Did not fire, Normal', #19
  4162. 0xf1 => 'Did not fire, Red-eye reduction', #19
  4163. 0xf2 => 'Did not fire, Auto', #19
  4164. 0xf3 => 'Did not fire, Auto, Red-eye reduction', #19
  4165. 0xf4 => 'Did not fire, (Unknown 0xf4)', #19
  4166. 0xf5 => 'Did not fire, Wireless (Master)', #19
  4167. 0xf6 => 'Did not fire, Wireless (Control)', #19
  4168. 0xf8 => 'Did not fire, Slow-sync', #19
  4169. 0xf9 => 'Did not fire, Slow-sync, Red-eye reduction', #19
  4170. 0xfa => 'Did not fire, Trailing-curtain Sync', #19
  4171. },
  4172. },
  4173. 2 => {
  4174. Name => 'ExternalFlashMode',
  4175. PrintHex => 1,
  4176. PrintConv => { #19
  4177. 0x00 => 'n/a - Off-Auto-Aperture',
  4178. 0x3f => 'Off',
  4179. 0x40 => 'On, Auto',
  4180. 0xbf => 'On, Flash Problem', #JD
  4181. 0xc0 => 'On, Manual',
  4182. 0xc4 => 'On, P-TTL Auto',
  4183. 0xc5 => 'On, Contrast-control Sync', #JD
  4184. 0xc6 => 'On, High-speed Sync',
  4185. 0xcc => 'On, Wireless',
  4186. 0xcd => 'On, Wireless, High-speed Sync',
  4187. 0xf0 => 'Not Connected', #PH (K-5)
  4188. },
  4189. },
  4190. 3 => {
  4191. Name => 'InternalFlashStrength',
  4192. Notes => 'saved from the most recent flash picture, on a scale of about 0 to 100',
  4193. },
  4194. 4 => 'TTL_DA_AUp',
  4195. 5 => 'TTL_DA_ADown',
  4196. 6 => 'TTL_DA_BUp',
  4197. 7 => 'TTL_DA_BDown',
  4198. 24.1 => { #19/17
  4199. Name => 'ExternalFlashGuideNumber',
  4200. Mask => 0x1f,
  4201. Notes => 'val = 2**(raw/16 + 4), with a few exceptions',
  4202. ValueConv => q{
  4203. return 0 unless $val;
  4204. $val = -3 if $val == 29; # -3 is stored as 0x1d
  4205. return 2**($val/16 + 4);
  4206. },
  4207. ValueConvInv => q{
  4208. return 0 unless $val;
  4209. my $raw = int((log($val)/log(2)-4)*16+0.5);
  4210. $raw = 29 if $raw < 0; # guide number of 14 gives -3 which is stored as 0x1d
  4211. $raw = 31 if $raw > 31; # maximum value is 0x1f
  4212. return $raw;
  4213. },
  4214. PrintConv => '$val ? int($val + 0.5) : "n/a"',
  4215. PrintConvInv => '$val=~/^n/ ? 0 : $val',
  4216. # observed values for various flash focal lengths/guide numbers:
  4217. # AF-540FGZ (ref 19) AF-360FGZ (ref 17)
  4218. # 6 => 20mm/21 29 => 20mm/14 (wide angle panel used)
  4219. # 16 => 24mm/32 6 => 24mm/21
  4220. # 18 => 28mm/35 7 => 28mm/22
  4221. # 21 => 35mm/39 10 => 35mm/25
  4222. # 24 => 50mm/45 14 => 50mm/30
  4223. # 26 => 70mm/50 17 => 70mm/33
  4224. # 28 => 85mm/54 19 => 85mm/36
  4225. # (I have also seen a value of 31 when both flashes are used together
  4226. # in a wired configuration, but I don't know exactly what this means - PH)
  4227. },
  4228. # 24 - have seen bit 0x80 set when 2 external wired flashes are used - PH
  4229. # 24 - have seen bit 0x40 set when wireless high speed sync is used - ref 19
  4230. 25 => { #19
  4231. Name => 'ExternalFlashExposureComp',
  4232. PrintConv => {
  4233. 0 => 'n/a', # Off or Auto Modes
  4234. 144 => 'n/a (Manual Mode)', # Manual Flash Output
  4235. 164 => '-3.0',
  4236. 167 => '-2.5',
  4237. 168 => '-2.0',
  4238. 171 => '-1.5',
  4239. 172 => '-1.0',
  4240. 175 => '-0.5',
  4241. 176 => '0.0',
  4242. 179 => '0.5',
  4243. 180 => '1.0',
  4244. },
  4245. },
  4246. 26 => { #17
  4247. Name => 'ExternalFlashBounce',
  4248. Notes => 'saved from the most recent external flash picture', #19
  4249. PrintConv => {
  4250. 0 => 'n/a',
  4251. 16 => 'Direct',
  4252. 48 => 'Bounce',
  4253. },
  4254. },
  4255. # ? => 'ExternalFlashAOutput',
  4256. # ? => 'ExternalFlashBOutput',
  4257. );
  4258. %Image::ExifTool::Pentax::FlashInfoUnknown = (
  4259. %binaryDataAttrs,
  4260. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4261. # 4 - changes with FEC for K-5 - PH
  4262. );
  4263. # camera manufacture information (ref PH)
  4264. %Image::ExifTool::Pentax::CameraInfo = (
  4265. %binaryDataAttrs,
  4266. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4267. FORMAT => 'int32u',
  4268. 0 => {
  4269. Name => 'PentaxModelID',
  4270. Priority => 0, # (Optio SVi uses incorrect Optio SV ID here)
  4271. SeparateTable => 1,
  4272. PrintHex => 1,
  4273. PrintConv => \%pentaxModelID,
  4274. },
  4275. 1 => {
  4276. Name => 'ManufactureDate',
  4277. Groups => { 2 => 'Time' },
  4278. Notes => q{
  4279. this value, and the values of the tags below, may change if the camera is
  4280. serviced
  4281. },
  4282. ValueConv => q{
  4283. $val =~ /^(\d{4})(\d{2})(\d{2})$/ and return "$1:$2:$3";
  4284. # Optio A10 and A20 leave "200" off the year
  4285. $val =~ /^(\d)(\d{2})(\d{2})$/ and return "200$1:$2:$3";
  4286. return "Unknown ($val)";
  4287. },
  4288. ValueConvInv => '$val=~tr/0-9//dc; $val',
  4289. },
  4290. 2 => {
  4291. #(see http://www.pentaxforums.com/forums/pentax-dslr-discussion/25711-k10d-update-model-revision-8-1-yes-no-8.html)
  4292. Name => 'ProductionCode', #(previously ModelRevision)
  4293. Format => 'int32u[2]',
  4294. Note => 'values of 8.x indicate that the camera has been serviced',
  4295. ValueConv => '$val=~tr/ /./; $val',
  4296. ValueConvInv => '$val=~tr/./ /; $val',
  4297. PrintConv => '$val=~/^8\./ ? "$val (camera has been serviced)" : $val',
  4298. PrintConvInv => '$val=~s/\s+.*//s; $val',
  4299. },
  4300. 4 => 'InternalSerialNumber',
  4301. );
  4302. # battery information (ref PH)
  4303. %Image::ExifTool::Pentax::BatteryInfo = (
  4304. %binaryDataAttrs,
  4305. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4306. # size of data:
  4307. # 4 (K-m,K2000=4xAA), 6 (*istD,K10D,K100D,K110D=2xCR-V3/4xAA),
  4308. # 7 (K20D=D-LI50, K200D=4xAA), 8 (645D=D-LI90), 10 (K-r pre-production?),
  4309. # 14 (K-7=D-LI90, K-r=D-LI109/4xAA, K-x=4xAA), 26 (K-5=D-LI90)
  4310. # battery grips available for:
  4311. # BG1 (*istD), BG2 (K10D/K20D), BG3 (K200D), BG4 (K-7,K-5)
  4312. # no grip available: K-x
  4313. 0.1 => { #19
  4314. Name => 'PowerSource',
  4315. Mask => 0x0f,
  4316. # have seen the upper bit set (value of 0x82) for the
  4317. # *istDS and K100D, but I'm not sure what this means - PH
  4318. # I've also seen: 0x42 (K2000), 0xf2 (K-7,K-r,K-5), 0x12,0x22 (K-x) - PH
  4319. PrintConv => {
  4320. 2 => 'Body Battery',
  4321. 3 => 'Grip Battery',
  4322. 4 => 'External Power Supply', #PH
  4323. },
  4324. },
  4325. 1.1 => [
  4326. {
  4327. Name => 'BodyBatteryState',
  4328. Condition => '$$self{Model} =~ /(\*ist|K100D|K200D|K10D|GX10|K20D|GX20|GX-1[LS]?)\b/',
  4329. Notes => '*istD, K100D, K200D, K10D and K20D',
  4330. Mask => 0xf0,
  4331. PrintConv => { #19
  4332. 0x10 => 'Empty or Missing',
  4333. 0x20 => 'Almost Empty',
  4334. 0x30 => 'Running Low',
  4335. 0x40 => 'Full',
  4336. },
  4337. },{
  4338. Name => 'BodyBatteryState',
  4339. Condition => '$$self{Model} !~ /(K110D|K2000|K-m)\b/',
  4340. Notes => 'other models except the K110D, K2000 and K-m',
  4341. Mask => 0xf0,
  4342. PrintConv => {
  4343. 0x10 => 'Empty or Missing',
  4344. 0x20 => 'Almost Empty',
  4345. 0x30 => 'Running Low',
  4346. 0x40 => 'Close to Full',
  4347. 0x50 => 'Full',
  4348. },
  4349. },{
  4350. Name => 'BodyBatteryState',
  4351. Notes => 'decoding unknown for other models',
  4352. Mask => 0xf0,
  4353. ValueConv => '$val >> 4',
  4354. ValueConvInv => '$val << 4',
  4355. },
  4356. ],
  4357. 1.2 => [
  4358. {
  4359. Name => 'GripBatteryState',
  4360. Condition => '$$self{Model} =~ /(K10D|GX10|K20D|GX20)\b/',
  4361. Notes => 'K10D and K20D',
  4362. Mask => 0x0f,
  4363. PrintConv => { #19
  4364. 0x01 => 'Empty or Missing',
  4365. 0x02 => 'Almost Empty',
  4366. 0x03 => 'Running Low',
  4367. 0x04 => 'Full',
  4368. },
  4369. },{
  4370. Name => 'GripBatteryState',
  4371. Notes => 'decoding unknown for other models',
  4372. Unknown => 1, # (doesn't appear to be valid for the K-5)
  4373. Mask => 0x0f,
  4374. },
  4375. ],
  4376. # internal and grip battery voltage Analogue to Digital measurements,
  4377. # open circuit and under load
  4378. 2 => [
  4379. {
  4380. Name => 'BodyBatteryADNoLoad',
  4381. Description => 'Body Battery A/D No Load',
  4382. Condition => '$$self{Model} =~ /(K10D|GX10|K20D|GX20)\b/',
  4383. Notes => 'roughly calibrated for K10D with a new Pentax battery',
  4384. # rough linear calibration drops quickly below 30% - PH
  4385. # DVM readings: 8.18V=186, 8.42-8.40V=192 (full), 6.86V=155 (empty)
  4386. PrintConv => 'sprintf("%d (%.1fV, %d%%)",$val,$val*8.18/186,($val-155)*100/35)',
  4387. PrintConvInv => '$val=~s/ .*//; $val',
  4388. },
  4389. {
  4390. Name => 'BodyBatteryADNoLoad',
  4391. Description => 'Body Battery A/D No Load',
  4392. Condition => '$$self{Model} =~ /(\*ist|K100D|K200D|GX-1[LS]?)\b/',
  4393. },
  4394. {
  4395. Name => 'BodyBatteryVoltage1', # (static?)
  4396. Condition => '$$self{Model} !~ /(K100D|K110D|K2000|K-m|Q\d*)\b/',
  4397. Format => 'int16u',
  4398. ValueConv => '$val / 100',
  4399. ValueConvInv => '$val * 100',
  4400. PrintConv => 'sprintf("%.2f V", $val)',
  4401. PrintConvInv => '$val =~ s/\s*V$//',
  4402. # For my K-5: Min (0%) Max (100%) At Meas
  4403. # BodyBatteryVoltage1 6.24 V 7.75 V 7.66 V
  4404. # BodyBatteryVoltage2 5.98 V 7.43 V 7.34 V
  4405. # BodyBatteryVoltage3 6.41 V 7.93 V 7.84 V
  4406. # BodyBatteryVoltage4 6.10 V 7.55 V 7.45 V
  4407. # "Meas" open-circuit voltages with DVM: AB=0V, AC=+8.33V, BC=+8.22V
  4408. # (terminal "C" is closest to edge of battery)
  4409. },
  4410. ],
  4411. 3 => [
  4412. {
  4413. Name => 'BodyBatteryADLoad',
  4414. Description => 'Body Battery A/D Load',
  4415. Condition => '$$self{Model} =~ /(K10D|GX10|K20D|GX20)\b/',
  4416. Notes => 'roughly calibrated for K10D with a new Pentax battery',
  4417. # [have seen 187] - PH
  4418. PrintConv => 'sprintf("%d (%.1fV, %d%%)",$val,$val*8.18/186,($val-152)*100/34)',
  4419. PrintConvInv => '$val=~s/ .*//; $val',
  4420. },
  4421. {
  4422. Name => 'BodyBatteryADLoad',
  4423. Description => 'Body Battery A/D Load',
  4424. Condition => '$$self{Model} =~ /(\*ist|K100D|K200D)\b/',
  4425. },
  4426. ],
  4427. 4 => [
  4428. {
  4429. Name => 'GripBatteryADNoLoad',
  4430. Description => 'Grip Battery A/D No Load',
  4431. Condition => '$$self{Model} =~ /(\*ist|K10D|GX10|K20D|GX20|GX-1[LS]?)\b/',
  4432. },
  4433. {
  4434. Name => 'BodyBatteryVoltage2', # (less than BodyBatteryVoltage1 -- under load?)
  4435. Condition => '$$self{Model} !~ /(K100D|K110D|K2000|K-m|Q\d*)\b/',
  4436. Format => 'int16u',
  4437. ValueConv => '$val / 100',
  4438. ValueConvInv => '$val * 100',
  4439. PrintConv => 'sprintf("%.2f V", $val)',
  4440. PrintConvInv => '$val =~ s/\s*V$//',
  4441. },
  4442. ],
  4443. 5 => {
  4444. Name => 'GripBatteryADLoad',
  4445. Condition => '$$self{Model} =~ /(\*ist|K10D|GX10|K20D|GX20)\b/',
  4446. Description => 'Grip Battery A/D Load',
  4447. },
  4448. 6 => {
  4449. Name => 'BodyBatteryVoltage3', # (greater than BodyBatteryVoltage1)
  4450. Condition => '$$self{Model} =~ /(K-5|K-r|645D)\b/',
  4451. Format => 'int16u',
  4452. Notes => 'K-5, K-r and 645D only',
  4453. ValueConv => '$val / 100',
  4454. ValueConvInv => '$val * 100',
  4455. PrintConv => 'sprintf("%.2f V", $val)',
  4456. PrintConvInv => '$val =~ s/\s*V$//',
  4457. },
  4458. 8 => {
  4459. Name => 'BodyBatteryVoltage4', # (between BodyBatteryVoltage1 and BodyBatteryVoltage2)
  4460. Condition => '$$self{Model} =~ /(K-5|K-r)\b/',
  4461. Format => 'int16u',
  4462. Notes => 'K-5 and K-r only',
  4463. ValueConv => '$val / 100',
  4464. ValueConvInv => '$val * 100',
  4465. PrintConv => 'sprintf("%.2f V", $val)',
  4466. PrintConvInv => '$val =~ s/\s*V$//',
  4467. },
  4468. );
  4469. # auto focus information
  4470. %Image::ExifTool::Pentax::AFInfo = (
  4471. %binaryDataAttrs,
  4472. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4473. # AF Info tag names in K10D debugging output - PH:
  4474. # SelectArea, InFocusArea, Predictor, Defocus, IntegTime2msStep,
  4475. # CalFlag, ContrastFlag, PrecalFlag, SelectSensor
  4476. 0x00 => { #PH
  4477. Name => 'AFPointsUnknown1',
  4478. Unknown => 1,
  4479. Format => 'int16u',
  4480. ValueConv => '$self->Options("Unknown") ? $val : $val & 0x7ff',
  4481. ValueConvInv => '$val',
  4482. PrintConvColumns => 2,
  4483. PrintConv => {
  4484. 0 => '(none)',
  4485. 0x07ff => 'All',
  4486. 0x0777 => 'Central 9 points',
  4487. BITMASK => {
  4488. 0 => 'Upper-left',
  4489. 1 => 'Top',
  4490. 2 => 'Upper-right',
  4491. 3 => 'Left',
  4492. 4 => 'Mid-left',
  4493. 5 => 'Center',
  4494. 6 => 'Mid-right',
  4495. 7 => 'Right',
  4496. 8 => 'Lower-left',
  4497. 9 => 'Bottom',
  4498. 10 => 'Lower-right',
  4499. # (bits 12-15 are flags of some sort)
  4500. },
  4501. },
  4502. },
  4503. 0x02 => { #PH
  4504. Name => 'AFPointsUnknown2',
  4505. Unknown => 1,
  4506. Format => 'int16u',
  4507. ValueConv => '$self->Options("Unknown") ? $val : $val & 0x7ff',
  4508. ValueConvInv => '$val',
  4509. PrintConvColumns => 2,
  4510. PrintConv => {
  4511. 0 => 'Auto',
  4512. BITMASK => {
  4513. 0 => 'Upper-left',
  4514. 1 => 'Top',
  4515. 2 => 'Upper-right',
  4516. 3 => 'Left',
  4517. 4 => 'Mid-left',
  4518. 5 => 'Center',
  4519. 6 => 'Mid-right',
  4520. 7 => 'Right',
  4521. 8 => 'Lower-left',
  4522. 9 => 'Bottom',
  4523. 10 => 'Lower-right',
  4524. # (bits 12-15 are flags of some sort)
  4525. # bit 15 is set for center focus point only if it is vertical
  4526. },
  4527. },
  4528. },
  4529. 0x04 => { #PH (educated guess - predicted amount to drive lens)
  4530. Name => 'AFPredictor',
  4531. Format => 'int16s',
  4532. },
  4533. 0x06 => 'AFDefocus', #PH (educated guess - calculated distance from focused)
  4534. 0x07 => { #PH
  4535. # effective exposure time for AF sensors in 2 ms increments
  4536. Name => 'AFIntegrationTime',
  4537. Notes => 'times less than 2 ms give a value of 0',
  4538. ValueConv => '$val * 2',
  4539. ValueConvInv => 'int($val / 2)', # (don't round up)
  4540. PrintConv => '"$val ms"',
  4541. PrintConvInv => '$val=~tr/0-9//dc; $val',
  4542. },
  4543. # 0x0a - values: 00,05,0d,15,86,8e,a6,ae
  4544. 0x0b => { #JD
  4545. Name => 'AFPointsInFocus',
  4546. Condition => '$$self{Model} !~ /K-3\b/',
  4547. Notes => q{
  4548. models other than the K-3 only. May report two points in focus even though
  4549. a single AFPoint has been selected, in which case the selected AFPoint is
  4550. the first reported
  4551. },
  4552. PrintConvColumns => 2,
  4553. PrintConv => {
  4554. 0 => 'None',
  4555. 1 => 'Lower-left, Bottom',
  4556. 2 => 'Bottom',
  4557. 3 => 'Lower-right, Bottom',
  4558. 4 => 'Mid-left, Center',
  4559. 5 => 'Center (horizontal)', #PH
  4560. 6 => 'Mid-right, Center',
  4561. 7 => 'Upper-left, Top',
  4562. 8 => 'Top',
  4563. 9 => 'Upper-right, Top',
  4564. 10 => 'Right',
  4565. 11 => 'Lower-left, Mid-left',
  4566. 12 => 'Upper-left, Mid-left',
  4567. 13 => 'Bottom, Center',
  4568. 14 => 'Top, Center',
  4569. 15 => 'Lower-right, Mid-right',
  4570. 16 => 'Upper-right, Mid-right',
  4571. 17 => 'Left',
  4572. 18 => 'Mid-left',
  4573. 19 => 'Center (vertical)', #PH
  4574. 20 => 'Mid-right',
  4575. },
  4576. },
  4577. 0x1fd => {
  4578. Name => 'AFHold',
  4579. Notes => 'decoded only for the K-3 II',
  4580. Condition => '$$self{Model} eq "PENTAX K-3 II"',
  4581. PrintConv => { 0 => 'Off', 1 => 'Short', 2 => 'Medium', 3 => 'Long' },
  4582. },
  4583. );
  4584. # Kelvin white balance information (ref 28, topic 4834)
  4585. %Image::ExifTool::Pentax::KelvinWB = (
  4586. %binaryDataAttrs,
  4587. FORMAT => 'int16u',
  4588. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4589. NOTES => 'White balance Blue/Red gains as a function of color temperature.',
  4590. 1 => { Name => 'KelvinWB_Daylight', %kelvinWB },
  4591. 5 => { Name => 'KelvinWB_01', %kelvinWB },
  4592. 9 => { Name => 'KelvinWB_02', %kelvinWB },
  4593. 13 => { Name => 'KelvinWB_03', %kelvinWB },
  4594. 17 => { Name => 'KelvinWB_04', %kelvinWB },
  4595. 21 => { Name => 'KelvinWB_05', %kelvinWB },
  4596. 25 => { Name => 'KelvinWB_06', %kelvinWB },
  4597. 29 => { Name => 'KelvinWB_07', %kelvinWB },
  4598. 33 => { Name => 'KelvinWB_08', %kelvinWB },
  4599. 37 => { Name => 'KelvinWB_09', %kelvinWB },
  4600. 41 => { Name => 'KelvinWB_10', %kelvinWB },
  4601. 45 => { Name => 'KelvinWB_11', %kelvinWB },
  4602. 49 => { Name => 'KelvinWB_12', %kelvinWB },
  4603. 53 => { Name => 'KelvinWB_13', %kelvinWB },
  4604. 57 => { Name => 'KelvinWB_14', %kelvinWB },
  4605. 61 => { Name => 'KelvinWB_15', %kelvinWB },
  4606. 65 => { Name => 'KelvinWB_16', %kelvinWB },
  4607. );
  4608. # color information - PH
  4609. %Image::ExifTool::Pentax::ColorInfo = (
  4610. %binaryDataAttrs,
  4611. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  4612. FORMAT => 'int8s',
  4613. 16 => {
  4614. Name => 'WBShiftAB',
  4615. Notes => 'positive is a shift toward blue',
  4616. },
  4617. 17 => {
  4618. Name => 'WBShiftGM',
  4619. Notes => 'positive is a shift toward green',
  4620. },
  4621. );
  4622. # EV step size information - ref 19
  4623. %Image::ExifTool::Pentax::EVStepInfo = (
  4624. %binaryDataAttrs,
  4625. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4626. 0 => {
  4627. Name => 'EVSteps',
  4628. PrintConv => {
  4629. 0 => '1/2 EV Steps',
  4630. 1 => '1/3 EV Steps',
  4631. },
  4632. },
  4633. 1 => {
  4634. Name => 'SensitivitySteps',
  4635. PrintConv => {
  4636. 0 => '1 EV Steps',
  4637. 1 => 'As EV Steps',
  4638. },
  4639. },
  4640. );
  4641. # shot information? - ref PH (K-5)
  4642. %Image::ExifTool::Pentax::ShotInfo = (
  4643. %binaryDataAttrs,
  4644. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4645. # 0: 0xf2/0xf3 (HDR), 0xf0 (otherwise)
  4646. 1 => { # (presumably this is from an orientation sensor)
  4647. Name => 'CameraOrientation',
  4648. Condition => '$$self{Model} =~ /K-(5|7|r|x)\b/',
  4649. Notes => 'K-5, K-7, K-r and K-x',
  4650. PrintHex => 1,
  4651. PrintConv => {
  4652. 0x10 => 'Horizontal (normal)',
  4653. 0x20 => 'Rotate 180',
  4654. 0x30 => 'Rotate 90 CW',
  4655. 0x40 => 'Rotate 270 CW',
  4656. 0x50 => 'Upwards', # (to the sky)
  4657. 0x60 => 'Downwards', # (to the ground)
  4658. },
  4659. },
  4660. # 2: 0xd3 (live view), 0xdb (HDR), 0x7b (otherwise)
  4661. # 3: 0xff
  4662. # 4: 0x64, 0x6a, 0x6f, 0xa4, 0xaa, 0xab, 0xbf
  4663. # 5: 0xfe
  4664. # 6: 0x0e
  4665. # 7: 0x02 (live view), 0x06 (otherwise)
  4666. # 8-10: 0x00
  4667. );
  4668. # face detect positions - ref PH (Optio RZ10)
  4669. %Image::ExifTool::Pentax::FacePos = (
  4670. %binaryDataAttrs,
  4671. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  4672. FORMAT => 'int16u',
  4673. 0 => {
  4674. Name => 'Face1Position',
  4675. Format => 'int16u[2]',
  4676. RawConv => '$$self{FacesDetected} < 1 ? undef : $val',
  4677. Notes => 'X/Y coordinates of face center in full-sized image',
  4678. },
  4679. 2 => {
  4680. Name => 'Face2Position',
  4681. Format => 'int16u[2]',
  4682. RawConv => '$$self{FacesDetected} < 2 ? undef : $val',
  4683. },
  4684. 4 => {
  4685. Name => 'Face3Position',
  4686. Format => 'int16u[2]',
  4687. RawConv => '$$self{FacesDetected} < 3 ? undef : $val',
  4688. },
  4689. 6 => {
  4690. Name => 'Face4Position',
  4691. Format => 'int16u[2]',
  4692. RawConv => '$$self{FacesDetected} < 4 ? undef : $val',
  4693. },
  4694. 8 => {
  4695. Name => 'Face5Position',
  4696. Format => 'int16u[2]',
  4697. RawConv => '$$self{FacesDetected} < 5 ? undef : $val',
  4698. },
  4699. 10 => {
  4700. Name => 'Face6Position',
  4701. Format => 'int16u[2]',
  4702. RawConv => '$$self{FacesDetected} < 6 ? undef : $val',
  4703. },
  4704. 12 => {
  4705. Name => 'Face7Position',
  4706. Format => 'int16u[2]',
  4707. RawConv => '$$self{FacesDetected} < 7 ? undef : $val',
  4708. },
  4709. 14 => {
  4710. Name => 'Face8Position',
  4711. Format => 'int16u[2]',
  4712. RawConv => '$$self{FacesDetected} < 8 ? undef : $val',
  4713. },
  4714. 16 => {
  4715. Name => 'Face9Position',
  4716. Format => 'int16u[2]',
  4717. RawConv => '$$self{FacesDetected} < 9 ? undef : $val',
  4718. },
  4719. 18 => {
  4720. Name => 'Face10Position',
  4721. Format => 'int16u[2]',
  4722. RawConv => '$$self{FacesDetected} < 10 ? undef : $val',
  4723. },
  4724. 20 => {
  4725. Name => 'Face11Position',
  4726. Format => 'int16u[2]',
  4727. RawConv => '$$self{FacesDetected} < 11 ? undef : $val',
  4728. },
  4729. 22 => {
  4730. Name => 'Face12Position',
  4731. Format => 'int16u[2]',
  4732. RawConv => '$$self{FacesDetected} < 12 ? undef : $val',
  4733. },
  4734. 24 => {
  4735. Name => 'Face13Position',
  4736. Format => 'int16u[2]',
  4737. RawConv => '$$self{FacesDetected} < 13 ? undef : $val',
  4738. },
  4739. 26 => {
  4740. Name => 'Face14Position',
  4741. Format => 'int16u[2]',
  4742. RawConv => '$$self{FacesDetected} < 14 ? undef : $val',
  4743. },
  4744. 28 => {
  4745. Name => 'Face15Position',
  4746. Format => 'int16u[2]',
  4747. RawConv => '$$self{FacesDetected} < 15 ? undef : $val',
  4748. },
  4749. 30 => {
  4750. Name => 'Face16Position',
  4751. Format => 'int16u[2]',
  4752. RawConv => '$$self{FacesDetected} < 16 ? undef : $val',
  4753. },
  4754. 32 => {
  4755. Name => 'Face17Position',
  4756. Format => 'int16u[2]',
  4757. RawConv => '$$self{FacesDetected} < 17 ? undef : $val',
  4758. },
  4759. 34 => {
  4760. Name => 'Face18Position',
  4761. Format => 'int16u[2]',
  4762. RawConv => '$$self{FacesDetected} < 18 ? undef : $val',
  4763. },
  4764. 36 => {
  4765. Name => 'Face19Position',
  4766. Format => 'int16u[2]',
  4767. RawConv => '$$self{FacesDetected} < 19 ? undef : $val',
  4768. },
  4769. 38 => {
  4770. Name => 'Face20Position',
  4771. Format => 'int16u[2]',
  4772. RawConv => '$$self{FacesDetected} < 20 ? undef : $val',
  4773. },
  4774. 40 => {
  4775. Name => 'Face21Position',
  4776. Format => 'int16u[2]',
  4777. RawConv => '$$self{FacesDetected} < 21 ? undef : $val',
  4778. },
  4779. 42 => {
  4780. Name => 'Face22Position',
  4781. Format => 'int16u[2]',
  4782. RawConv => '$$self{FacesDetected} < 22 ? undef : $val',
  4783. },
  4784. 44 => {
  4785. Name => 'Face23Position',
  4786. Format => 'int16u[2]',
  4787. RawConv => '$$self{FacesDetected} < 23 ? undef : $val',
  4788. },
  4789. 46 => {
  4790. Name => 'Face24Position',
  4791. Format => 'int16u[2]',
  4792. RawConv => '$$self{FacesDetected} < 24 ? undef : $val',
  4793. },
  4794. 48 => {
  4795. Name => 'Face25Position',
  4796. Format => 'int16u[2]',
  4797. RawConv => '$$self{FacesDetected} < 25 ? undef : $val',
  4798. },
  4799. 50 => {
  4800. Name => 'Face26Position',
  4801. Format => 'int16u[2]',
  4802. RawConv => '$$self{FacesDetected} < 26 ? undef : $val',
  4803. },
  4804. 52 => {
  4805. Name => 'Face27Position',
  4806. Format => 'int16u[2]',
  4807. RawConv => '$$self{FacesDetected} < 27 ? undef : $val',
  4808. },
  4809. 54 => {
  4810. Name => 'Face28Position',
  4811. Format => 'int16u[2]',
  4812. RawConv => '$$self{FacesDetected} < 28 ? undef : $val',
  4813. },
  4814. 56 => {
  4815. Name => 'Face29Position',
  4816. Format => 'int16u[2]',
  4817. RawConv => '$$self{FacesDetected} < 29 ? undef : $val',
  4818. },
  4819. 58 => {
  4820. Name => 'Face30Position',
  4821. Format => 'int16u[2]',
  4822. RawConv => '$$self{FacesDetected} < 30 ? undef : $val',
  4823. },
  4824. 60 => {
  4825. Name => 'Face31Position',
  4826. Format => 'int16u[2]',
  4827. RawConv => '$$self{FacesDetected} < 31 ? undef : $val',
  4828. },
  4829. 62 => {
  4830. Name => 'Face32Position',
  4831. Format => 'int16u[2]',
  4832. RawConv => '$$self{FacesDetected} < 32 ? undef : $val',
  4833. },
  4834. );
  4835. # face detect sizes - ref PH (Optio RZ10)
  4836. %Image::ExifTool::Pentax::FaceSize = (
  4837. %binaryDataAttrs,
  4838. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  4839. FORMAT => 'int16u',
  4840. 0 => {
  4841. Name => 'Face1Size',
  4842. Format => 'int16u[2]',
  4843. RawConv => '$$self{FacesDetected} < 1 ? undef : $val',
  4844. },
  4845. 2 => {
  4846. Name => 'Face2Size',
  4847. Format => 'int16u[2]',
  4848. RawConv => '$$self{FacesDetected} < 2 ? undef : $val',
  4849. },
  4850. 4 => {
  4851. Name => 'Face3Size',
  4852. Format => 'int16u[2]',
  4853. RawConv => '$$self{FacesDetected} < 3 ? undef : $val',
  4854. },
  4855. 6 => {
  4856. Name => 'Face4Size',
  4857. Format => 'int16u[2]',
  4858. RawConv => '$$self{FacesDetected} < 4 ? undef : $val',
  4859. },
  4860. 8 => {
  4861. Name => 'Face5Size',
  4862. Format => 'int16u[2]',
  4863. RawConv => '$$self{FacesDetected} < 5 ? undef : $val',
  4864. },
  4865. 10 => {
  4866. Name => 'Face6Size',
  4867. Format => 'int16u[2]',
  4868. RawConv => '$$self{FacesDetected} < 6 ? undef : $val',
  4869. },
  4870. 12 => {
  4871. Name => 'Face7Size',
  4872. Format => 'int16u[2]',
  4873. RawConv => '$$self{FacesDetected} < 7 ? undef : $val',
  4874. },
  4875. 14 => {
  4876. Name => 'Face8Size',
  4877. Format => 'int16u[2]',
  4878. RawConv => '$$self{FacesDetected} < 8 ? undef : $val',
  4879. },
  4880. 16 => {
  4881. Name => 'Face9Size',
  4882. Format => 'int16u[2]',
  4883. RawConv => '$$self{FacesDetected} < 9 ? undef : $val',
  4884. },
  4885. 18 => {
  4886. Name => 'Face10Size',
  4887. Format => 'int16u[2]',
  4888. RawConv => '$$self{FacesDetected} < 10 ? undef : $val',
  4889. },
  4890. 20 => {
  4891. Name => 'Face11Size',
  4892. Format => 'int16u[2]',
  4893. RawConv => '$$self{FacesDetected} < 11 ? undef : $val',
  4894. },
  4895. 22 => {
  4896. Name => 'Face12Size',
  4897. Format => 'int16u[2]',
  4898. RawConv => '$$self{FacesDetected} < 12 ? undef : $val',
  4899. },
  4900. 24 => {
  4901. Name => 'Face13Size',
  4902. Format => 'int16u[2]',
  4903. RawConv => '$$self{FacesDetected} < 13 ? undef : $val',
  4904. },
  4905. 26 => {
  4906. Name => 'Face14Size',
  4907. Format => 'int16u[2]',
  4908. RawConv => '$$self{FacesDetected} < 14 ? undef : $val',
  4909. },
  4910. 28 => {
  4911. Name => 'Face15Size',
  4912. Format => 'int16u[2]',
  4913. RawConv => '$$self{FacesDetected} < 15 ? undef : $val',
  4914. },
  4915. 30 => {
  4916. Name => 'Face16Size',
  4917. Format => 'int16u[2]',
  4918. RawConv => '$$self{FacesDetected} < 16 ? undef : $val',
  4919. },
  4920. 32 => {
  4921. Name => 'Face17Size',
  4922. Format => 'int16u[2]',
  4923. RawConv => '$$self{FacesDetected} < 17 ? undef : $val',
  4924. },
  4925. 34 => {
  4926. Name => 'Face18Size',
  4927. Format => 'int16u[2]',
  4928. RawConv => '$$self{FacesDetected} < 18 ? undef : $val',
  4929. },
  4930. 36 => {
  4931. Name => 'Face19Size',
  4932. Format => 'int16u[2]',
  4933. RawConv => '$$self{FacesDetected} < 19 ? undef : $val',
  4934. },
  4935. 38 => {
  4936. Name => 'Face20Size',
  4937. Format => 'int16u[2]',
  4938. RawConv => '$$self{FacesDetected} < 20 ? undef : $val',
  4939. },
  4940. 40 => {
  4941. Name => 'Face21Size',
  4942. Format => 'int16u[2]',
  4943. RawConv => '$$self{FacesDetected} < 21 ? undef : $val',
  4944. },
  4945. 42 => {
  4946. Name => 'Face22Size',
  4947. Format => 'int16u[2]',
  4948. RawConv => '$$self{FacesDetected} < 22 ? undef : $val',
  4949. },
  4950. 44 => {
  4951. Name => 'Face23Size',
  4952. Format => 'int16u[2]',
  4953. RawConv => '$$self{FacesDetected} < 23 ? undef : $val',
  4954. },
  4955. 46 => {
  4956. Name => 'Face24Size',
  4957. Format => 'int16u[2]',
  4958. RawConv => '$$self{FacesDetected} < 24 ? undef : $val',
  4959. },
  4960. 48 => {
  4961. Name => 'Face25Size',
  4962. Format => 'int16u[2]',
  4963. RawConv => '$$self{FacesDetected} < 25 ? undef : $val',
  4964. },
  4965. 50 => {
  4966. Name => 'Face26Size',
  4967. Format => 'int16u[2]',
  4968. RawConv => '$$self{FacesDetected} < 26 ? undef : $val',
  4969. },
  4970. 52 => {
  4971. Name => 'Face27Size',
  4972. Format => 'int16u[2]',
  4973. RawConv => '$$self{FacesDetected} < 27 ? undef : $val',
  4974. },
  4975. 54 => {
  4976. Name => 'Face28Size',
  4977. Format => 'int16u[2]',
  4978. RawConv => '$$self{FacesDetected} < 28 ? undef : $val',
  4979. },
  4980. 56 => {
  4981. Name => 'Face29Size',
  4982. Format => 'int16u[2]',
  4983. RawConv => '$$self{FacesDetected} < 29 ? undef : $val',
  4984. },
  4985. 58 => {
  4986. Name => 'Face30Size',
  4987. Format => 'int16u[2]',
  4988. RawConv => '$$self{FacesDetected} < 30 ? undef : $val',
  4989. },
  4990. 60 => {
  4991. Name => 'Face31Size',
  4992. Format => 'int16u[2]',
  4993. RawConv => '$$self{FacesDetected} < 31 ? undef : $val',
  4994. },
  4995. 62 => {
  4996. Name => 'Face32Size',
  4997. Format => 'int16u[2]',
  4998. RawConv => '$$self{FacesDetected} < 32 ? undef : $val',
  4999. },
  5000. );
  5001. # digital filter information - ref PH (K-5)
  5002. %Image::ExifTool::Pentax::FilterInfo = (
  5003. %binaryDataAttrs,
  5004. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5005. FORMAT => 'int8u',
  5006. NOTES => q{
  5007. The parameters associated with each type of digital filter are unique, and
  5008. these settings are also extracted with the DigitalFilter tag. Information
  5009. is not extracted for filters that are "Off" unless the Unknown option is
  5010. used.
  5011. },
  5012. 0 => {
  5013. Name => 'SourceDirectoryIndex',
  5014. Format => 'int16u',
  5015. },
  5016. 2 => {
  5017. Name => 'SourceFileIndex',
  5018. Format => 'int16u',
  5019. },
  5020. 0x005 => { Name => 'DigitalFilter01', %digitalFilter },
  5021. 0x016 => { Name => 'DigitalFilter02', %digitalFilter },
  5022. 0x027 => { Name => 'DigitalFilter03', %digitalFilter },
  5023. 0x038 => { Name => 'DigitalFilter04', %digitalFilter },
  5024. 0x049 => { Name => 'DigitalFilter05', %digitalFilter },
  5025. 0x05a => { Name => 'DigitalFilter06', %digitalFilter },
  5026. 0x06b => { Name => 'DigitalFilter07', %digitalFilter },
  5027. 0x07c => { Name => 'DigitalFilter08', %digitalFilter },
  5028. 0x08d => { Name => 'DigitalFilter09', %digitalFilter },
  5029. 0x09e => { Name => 'DigitalFilter10', %digitalFilter },
  5030. 0x0af => { Name => 'DigitalFilter11', %digitalFilter },
  5031. 0x0c0 => { Name => 'DigitalFilter12', %digitalFilter },
  5032. 0x0d1 => { Name => 'DigitalFilter13', %digitalFilter },
  5033. 0x0e2 => { Name => 'DigitalFilter14', %digitalFilter },
  5034. 0x0f3 => { Name => 'DigitalFilter15', %digitalFilter },
  5035. 0x104 => { Name => 'DigitalFilter16', %digitalFilter },
  5036. 0x115 => { Name => 'DigitalFilter17', %digitalFilter },
  5037. 0x126 => { Name => 'DigitalFilter18', %digitalFilter },
  5038. 0x137 => { Name => 'DigitalFilter19', %digitalFilter },
  5039. 0x148 => { Name => 'DigitalFilter20', %digitalFilter },
  5040. );
  5041. # electronic level information - ref PH (K-5)
  5042. %Image::ExifTool::Pentax::LevelInfo = (
  5043. %binaryDataAttrs,
  5044. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5045. FORMAT => 'int8s',
  5046. NOTES => q{
  5047. Tags decoded from the electronic level information for the K-5. May not be
  5048. valid for other models.
  5049. },
  5050. 0 => {
  5051. Name => 'LevelOrientation',
  5052. Mask => 0x0f,
  5053. PrintHex => 0,
  5054. PrintConv => {
  5055. 1 => 'Horizontal (normal)',
  5056. 2 => 'Rotate 180',
  5057. 3 => 'Rotate 90 CW',
  5058. 4 => 'Rotate 270 CW',
  5059. 9 => 'Horizontal; Off Level',
  5060. 10 => 'Rotate 180; Off Level',
  5061. 11 => 'Rotate 90 CW; Off Level',
  5062. 12 => 'Rotate 270 CW; Off Level',
  5063. 13 => 'Upwards',
  5064. 14 => 'Downwards',
  5065. },
  5066. },
  5067. 0.1 => {
  5068. Name => 'CompositionAdjust',
  5069. Mask => 0xf0,
  5070. PrintConv => {
  5071. 0x00 => 'Off',
  5072. 0x20 => 'Composition Adjust',
  5073. 0xa0 => 'Composition Adjust + Horizon Correction',
  5074. 0xc0 => 'Horizon Correction',
  5075. },
  5076. },
  5077. 1 => {
  5078. Name => 'RollAngle',
  5079. Notes => 'converted to degrees of clockwise camera rotation',
  5080. ValueConv => '-$val / 2',
  5081. ValueConvInv => '-$val * 2',
  5082. },
  5083. 2 => {
  5084. Name => 'PitchAngle',
  5085. Notes => 'converted to degrees of upward camera tilt',
  5086. ValueConv => '-$val / 2',
  5087. ValueConvInv => '-$val * 2',
  5088. },
  5089. # 3,4 - related somehow to horizon correction and composition adjust
  5090. # 5,6,7 - (the notes below refer to how the image moves in the LCD monitor)
  5091. 5 => {
  5092. Name => 'CompositionAdjustX',
  5093. Notes => 'steps to the right, 1/16 mm per step',
  5094. ValueConv => '-$val',
  5095. ValueConvInv => '-$val',
  5096. },
  5097. 6 => {
  5098. Name => 'CompositionAdjustY',
  5099. Notes => 'steps up, 1/16 mm per step',
  5100. ValueConv => '-$val',
  5101. ValueConvInv => '-$val',
  5102. },
  5103. 7 => {
  5104. Name => 'CompositionAdjustRotation',
  5105. Notes => 'steps clockwise, 1/8 degree per step',
  5106. ValueConv => '-$val / 2',
  5107. ValueConvInv => '-$val * 2',
  5108. },
  5109. );
  5110. # white balance RGGB levels (ref 28)
  5111. %Image::ExifTool::Pentax::WBLevels = (
  5112. %binaryDataAttrs,
  5113. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5114. # 0 - 11 (number of entries in this table)
  5115. # 1 - 0
  5116. 2 => {
  5117. Name => 'WB_RGGBLevelsDaylight',
  5118. Format => 'int16u[4]',
  5119. },
  5120. # 10 - 1
  5121. 11 => {
  5122. Name => 'WB_RGGBLevelsShade',
  5123. Format => 'int16u[4]',
  5124. },
  5125. # 19 - 2
  5126. 20 => {
  5127. Name => 'WB_RGGBLevelsCloudy',
  5128. Format => 'int16u[4]',
  5129. },
  5130. # 28 - 3
  5131. 29 => {
  5132. Name => 'WB_RGGBLevelsTungsten',
  5133. Format => 'int16u[4]',
  5134. },
  5135. # 37 - 4
  5136. 38 => {
  5137. Name => 'WB_RGGBLevelsFluorescentD',
  5138. Format => 'int16u[4]',
  5139. },
  5140. # 46 - 5
  5141. 47 => {
  5142. Name => 'WB_RGGBLevelsFluorescentN',
  5143. Format => 'int16u[4]',
  5144. },
  5145. # 55 - 6
  5146. 56 => {
  5147. Name => 'WB_RGGBLevelsFluorescentW',
  5148. Format => 'int16u[4]',
  5149. },
  5150. # 64 - 7
  5151. 65 => {
  5152. Name => 'WB_RGGBLevelsFlash',
  5153. Format => 'int16u[4]',
  5154. },
  5155. # 73 - 8
  5156. 74 => {
  5157. Name => 'WB_RGGBLevelsFluorescentL',
  5158. Format => 'int16u[4]',
  5159. },
  5160. # 82 - 0xfe
  5161. 83 => {
  5162. Name => 'WB_RGGBLevelsUnknown',
  5163. Format => 'int16u[4]',
  5164. Unknown => 1,
  5165. },
  5166. # 91 - 0xff
  5167. 92 => {
  5168. Name => 'WB_RGGBLevelsUserSelected',
  5169. Format => 'int16u[4]',
  5170. },
  5171. );
  5172. # lens information for Penax Q (ref PH)
  5173. # (306 bytes long, I wonder if this contains vignetting information too?)
  5174. %Image::ExifTool::Pentax::LensInfoQ = (
  5175. %binaryDataAttrs,
  5176. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5177. NOTES => 'More lens information stored by the Pentax Q.',
  5178. 0x0c => {
  5179. Name => 'LensModel',
  5180. Format => 'string[30]',
  5181. },
  5182. 0x2a => {
  5183. Name => 'LensInfo',
  5184. Format => 'string[20]',
  5185. ValueConv => '$val=~s/mm/mm /; $val',
  5186. ValueConvInv => '$val=~tr/ //d; $val',
  5187. }
  5188. );
  5189. # Pixel shift information for the K-3II (ref PH)
  5190. %Image::ExifTool::Pentax::PixelShiftInfo = (
  5191. %binaryDataAttrs,
  5192. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5193. NOTES => 'Pixel shift information stored by the K-3 II.',
  5194. 0x00 => {
  5195. Name => 'PixelShiftResolution',
  5196. PrintConv => { 0 => 'Off', 1 => 'On' },
  5197. },
  5198. );
  5199. # temperature information for some models - PH
  5200. %Image::ExifTool::Pentax::TempInfo = (
  5201. %binaryDataAttrs,
  5202. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5203. NOTES => q{
  5204. A number of additional temperature readings are extracted from this 256-byte
  5205. binary-data block in images from models such as the K-01, K-3, K-5, K-50 and
  5206. K-500. It is currently not known where the corresponding temperature
  5207. sensors are located in the camera.
  5208. },
  5209. # (it would be nice to know where these temperature sensors are located,
  5210. # but since according to the manual the Slow Shutter Speed NR Auto mode
  5211. # is based on "internal temperature", my guess is that there must be
  5212. # at least one on the sensor itself. These temperatures seem to rise
  5213. # more quickly than CameraTemperature when shooting video.)
  5214. 0x0c => {
  5215. Name => 'SensorTemperature', #forum6677 (was CameraTemperature2)
  5216. Format => 'int16s',
  5217. ValueConv => '$val / 10',
  5218. ValueConvInv => '$val * 10',
  5219. PrintConv => 'sprintf("%.1f C", $val)',
  5220. PrintConvInv => '$val=~s/ ?c$//i; $val',
  5221. },
  5222. 0x0e => {
  5223. Name => 'SensorTemperature2', #forum6677 (was CameraTemperature3)
  5224. Format => 'int16s',
  5225. ValueConv => '$val / 10',
  5226. ValueConvInv => '$val * 10',
  5227. PrintConv => 'sprintf("%.1f C", $val)',
  5228. PrintConvInv => '$val=~s/ ?c$//i; $val',
  5229. },
  5230. 0x14 => {
  5231. Name => 'CameraTemperature4',
  5232. Condition => '$$self{Model} =~ /K-5\b/',
  5233. Format => 'int16s',
  5234. PrintConv => '"$val C"',
  5235. PrintConvInv => '$val=~s/ ?c$//i; $val',
  5236. },
  5237. 0x16 => { # usually the same as CameraTemperature4, but not always
  5238. Name => 'CameraTemperature5',
  5239. Condition => '$$self{Model} =~ /K-5\b/',
  5240. Format => 'int16s',
  5241. PrintConv => '"$val C"',
  5242. PrintConvInv => '$val=~s/ ?c$//i; $val',
  5243. },
  5244. # 0x18,0x1a,0x1c,0x1e = int16u[4] BlackPoint - PH
  5245. );
  5246. # currently unknown info
  5247. %Image::ExifTool::Pentax::UnknownInfo = (
  5248. %binaryDataAttrs,
  5249. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5250. # K10D: first 8 bytes seem to be short integers which change with ISO (value
  5251. # is usually close to ISO/100) possibly smoothing or gain parameters? - PH
  5252. # byte 0-1 - Higher for high color temperatures (red boost or red noise suppression?)
  5253. # byte 6-7 - Higher for low color temperatures (blue boost or blue noise suppression?)
  5254. # also changing are bytes 10,11,14,15
  5255. );
  5256. # Pentax type 2 (Casio-like) maker notes (ref 1)
  5257. %Image::ExifTool::Pentax::Type2 = (
  5258. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  5259. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  5260. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5261. WRITABLE => 'int16u',
  5262. NOTES => q{
  5263. These tags are used by the Pentax Optio 330 and 430, and are similar to the
  5264. tags used by Casio.
  5265. },
  5266. 0x0001 => {
  5267. Name => 'RecordingMode',
  5268. PrintConv => {
  5269. 0 => 'Auto',
  5270. 1 => 'Night Scene',
  5271. 2 => 'Manual',
  5272. },
  5273. },
  5274. 0x0002 => {
  5275. Name => 'Quality',
  5276. PrintConv => {
  5277. 0 => 'Good',
  5278. 1 => 'Better',
  5279. 2 => 'Best',
  5280. },
  5281. },
  5282. 0x0003 => {
  5283. Name => 'FocusMode',
  5284. PrintConv => {
  5285. 2 => 'Custom',
  5286. 3 => 'Auto',
  5287. },
  5288. },
  5289. 0x0004 => {
  5290. Name => 'FlashMode',
  5291. PrintConv => {
  5292. 1 => 'Auto',
  5293. 2 => 'On',
  5294. 4 => 'Off',
  5295. 6 => 'Red-eye reduction',
  5296. },
  5297. },
  5298. # Casio 0x0005 is FlashIntensity
  5299. # Casio 0x0006 is ObjectDistance
  5300. 0x0007 => {
  5301. Name => 'WhiteBalance',
  5302. PrintConv => {
  5303. 0 => 'Auto',
  5304. 1 => 'Daylight',
  5305. 2 => 'Shade',
  5306. 3 => 'Tungsten',
  5307. 4 => 'Fluorescent',
  5308. 5 => 'Manual',
  5309. },
  5310. },
  5311. 0x000a => {
  5312. Name => 'DigitalZoom',
  5313. Writable => 'int32u',
  5314. },
  5315. 0x000b => {
  5316. Name => 'Sharpness',
  5317. PrintConv => {
  5318. 0 => 'Normal',
  5319. 1 => 'Soft',
  5320. 2 => 'Hard',
  5321. },
  5322. },
  5323. 0x000c => {
  5324. Name => 'Contrast',
  5325. PrintConv => {
  5326. 0 => 'Normal',
  5327. 1 => 'Low',
  5328. 2 => 'High',
  5329. },
  5330. },
  5331. 0x000d => {
  5332. Name => 'Saturation',
  5333. PrintConv => {
  5334. 0 => 'Normal',
  5335. 1 => 'Low',
  5336. 2 => 'High',
  5337. },
  5338. },
  5339. 0x0014 => {
  5340. Name => 'ISO',
  5341. Priority => 0,
  5342. PrintConv => {
  5343. 10 => 100,
  5344. 16 => 200,
  5345. 50 => 50, #PH
  5346. 100 => 100, #PH
  5347. 200 => 200, #PH
  5348. 400 => 400, #PH
  5349. 800 => 800, #PH
  5350. 1600 => 1600, #PH
  5351. 3200 => 3200, #PH
  5352. # seen 65534 for Q-S1 MOV video - PH
  5353. # seen 65535 for K-S1 MOV video - PH
  5354. },
  5355. },
  5356. 0x0017 => {
  5357. Name => 'ColorFilter',
  5358. PrintConv => {
  5359. 1 => 'Full',
  5360. 2 => 'Black & White',
  5361. 3 => 'Sepia',
  5362. },
  5363. },
  5364. # Casio 0x0018 is AFPoint
  5365. # Casio 0x0019 is FlashIntensity
  5366. 0x0e00 => {
  5367. Name => 'PrintIM',
  5368. Description => 'Print Image Matching',
  5369. Writable => 0,
  5370. SubDirectory => {
  5371. TagTable => 'Image::ExifTool::PrintIM::Main',
  5372. },
  5373. },
  5374. 0x1000 => {
  5375. Name => 'HometownCityCode',
  5376. Writable => 'undef',
  5377. Count => 4,
  5378. },
  5379. 0x1001 => { #PH
  5380. Name => 'DestinationCityCode',
  5381. Writable => 'undef',
  5382. Count => 4,
  5383. },
  5384. );
  5385. # ASCII-based maker notes of Optio E20 and E25 - PH
  5386. %Image::ExifTool::Pentax::Type4 = (
  5387. PROCESS_PROC => \&Image::ExifTool::HP::ProcessHP,
  5388. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5389. NOTES => q{
  5390. The following few tags are extracted from the wealth of information
  5391. available in maker notes of the Optio E20 and E25. These maker notes are
  5392. stored as ASCII text in a format very similar to some HP models.
  5393. },
  5394. 'F/W Version' => 'FirmwareVersion',
  5395. );
  5396. # tags in Pentax QuickTime videos (PH - tests with Optio WP)
  5397. # (similar information in Kodak,Minolta,Nikon,Olympus,Pentax and Sanyo videos)
  5398. %Image::ExifTool::Pentax::MOV = (
  5399. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  5400. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5401. FIRST_ENTRY => 0,
  5402. NOTES => 'This information is found in MOV videos from cameras such as the Optio WP.',
  5403. 0x00 => {
  5404. Name => 'Make',
  5405. Format => 'string[24]',
  5406. },
  5407. # (01 00 at offset 0x20)
  5408. 0x26 => {
  5409. Name => 'ExposureTime',
  5410. Format => 'int32u',
  5411. ValueConv => '$val ? 10 / $val : 0',
  5412. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  5413. },
  5414. 0x2a => {
  5415. Name => 'FNumber',
  5416. Format => 'rational64u',
  5417. PrintConv => 'sprintf("%.1f",$val)',
  5418. },
  5419. 0x32 => {
  5420. Name => 'ExposureCompensation',
  5421. Format => 'rational64s',
  5422. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  5423. },
  5424. 0x44 => {
  5425. Name => 'WhiteBalance',
  5426. Format => 'int16u',
  5427. PrintConv => {
  5428. 0 => 'Auto',
  5429. 1 => 'Daylight',
  5430. 2 => 'Shade',
  5431. 3 => 'Fluorescent', #2
  5432. 4 => 'Tungsten',
  5433. 5 => 'Manual',
  5434. },
  5435. },
  5436. 0x48 => {
  5437. Name => 'FocalLength',
  5438. Format => 'rational64u',
  5439. PrintConv => 'sprintf("%.1f mm",$val)',
  5440. },
  5441. 0xaf => {
  5442. Name => 'ISO',
  5443. Format => 'int16u',
  5444. },
  5445. );
  5446. # Pentax metadata in AVI videos (PH)
  5447. %Image::ExifTool::Pentax::AVI = (
  5448. NOTES => 'Pentax-specific RIFF tags found in AVI videos.',
  5449. GROUPS => { 0 => 'MakerNotes', 2 => 'Video' },
  5450. hymn => {
  5451. Name => 'MakerNotes',
  5452. SubDirectory => {
  5453. TagTable => 'Image::ExifTool::Pentax::Main',
  5454. Start => 10,
  5455. Base => '$start',
  5456. ByteOrder => 'BigEndian',
  5457. },
  5458. },
  5459. );
  5460. # Pentax metadata in S1 AVI maker notes (PH)
  5461. %Image::ExifTool::Pentax::S1 = (
  5462. NOTES => 'Tags extracted from the maker notes of AVI videos from the Optio S1.',
  5463. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5464. 0x0000 => { #5
  5465. Name => 'MakerNoteVersion',
  5466. Writable => 'undef',
  5467. Count => 4,
  5468. },
  5469. );
  5470. # Pentax metadata in AVI videos from the RS1000 (PH)
  5471. %Image::ExifTool::Pentax::Junk = (
  5472. NOTES => 'Tags found in the JUNK chunk of AVI videos from the RS1000.',
  5473. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  5474. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5475. 0x0c => {
  5476. Name => 'Model',
  5477. Format => 'string[32]',
  5478. },
  5479. );
  5480. # PreviewImage information found in PXTH atom of K-01 MOV videos
  5481. %Image::ExifTool::Pentax::PXTH = (
  5482. NOTES => 'Tags found in the PXTH atom of MOV videos from the K-01.',
  5483. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  5484. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5485. 0x00 => {
  5486. Name => 'PreviewImageLength',
  5487. Format => 'int32u',
  5488. },
  5489. 0x04 => {
  5490. Name => 'PreviewImage',
  5491. Groups => { 2 => 'Preview' },
  5492. Format => 'undef[$val{0}]',
  5493. Notes => '640-pixel-wide JPEG preview', # (360 pixels high, may depend on aspect ratio)
  5494. RawConv => '$self->ValidateImage(\$val,$tag)',
  5495. },
  5496. );
  5497. # information in PENT atom of MOV videos from the Optio WG-2 GPS
  5498. %Image::ExifTool::Pentax::PENT = (
  5499. NOTES => 'Tags found in the PENT atom of MOV videos from the Optio WG-2 GPS.',
  5500. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  5501. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5502. 0 => {
  5503. Name => 'Make',
  5504. Format => 'string[24]',
  5505. },
  5506. 0x1a => {
  5507. Name => 'Model',
  5508. Description => 'Camera Model Name',
  5509. Format => 'string[24]',
  5510. },
  5511. 0x38 => { # (NC)
  5512. Name => 'ExposureTime',
  5513. Format => 'int32u',
  5514. ValueConv => '$val ? 10 / $val : 0',
  5515. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  5516. },
  5517. 0x3c => {
  5518. Name => 'FNumber',
  5519. Format => 'rational64u',
  5520. PrintConv => 'sprintf("%.1f",$val)',
  5521. },
  5522. 0x44 => { # (NC)
  5523. Name => 'ExposureCompensation',
  5524. Format => 'rational64s',
  5525. PrintConv => '$val ? sprintf("%+.1f", $val) : 0',
  5526. },
  5527. 0x54 => { # (NC)
  5528. Name => 'FocalLength',
  5529. Format => 'int32u',
  5530. PrintConv => '"$val mm"',
  5531. },
  5532. 0x71 => {
  5533. Name => 'DateTime1',
  5534. Format => 'string[24]',
  5535. Groups => { 2 => 'Time' },
  5536. },
  5537. 0x8b => {
  5538. Name => 'DateTime2',
  5539. Format => 'string[24]',
  5540. Groups => { 2 => 'Time' },
  5541. },
  5542. 0xa7 => { # (NC)
  5543. Name => 'ISO',
  5544. Format => 'int32u',
  5545. },
  5546. 0xc7 => {
  5547. Name => 'GPSVersionID',
  5548. Format => 'undef[8]',
  5549. Groups => { 1 => 'GPS', 2 => 'Location' },
  5550. DataMember => 'GPSVersionID',
  5551. RawConv => '$$self{GPSVersionID} = ($val=~s/GPS_// ? join(" ",unpack("C*",$val)) : undef)',
  5552. PrintConv => '$val =~ tr/ /./; $val',
  5553. },
  5554. 0xcf => {
  5555. Name => 'GPSLatitudeRef',
  5556. Condition => '$$self{GPSVersionID} and require Image::ExifTool::GPS',
  5557. Format => 'string[2]',
  5558. Groups => { 1 => 'GPS', 2 => 'Location' },
  5559. PrintConv => {
  5560. N => 'North',
  5561. S => 'South',
  5562. },
  5563. },
  5564. 0xd1 => {
  5565. Name => 'GPSLatitude',
  5566. Condition => '$$self{GPSVersionID}',
  5567. Format => 'rational64u[3]',
  5568. Groups => { 1 => 'GPS', 2 => 'Location' },
  5569. ValueConv => 'Image::ExifTool::GPS::ToDegrees($val)',
  5570. PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1)',
  5571. },
  5572. 0xe9 => {
  5573. Name => 'GPSLongitudeRef',
  5574. Condition => '$$self{GPSVersionID}',
  5575. Format => 'string[2]',
  5576. Groups => { 1 => 'GPS', 2 => 'Location' },
  5577. PrintConv => {
  5578. E => 'East',
  5579. W => 'West',
  5580. },
  5581. },
  5582. 0xeb => {
  5583. Name => 'GPSLongitude',
  5584. Condition => '$$self{GPSVersionID}',
  5585. Format => 'rational64u[3]',
  5586. Groups => { 1 => 'GPS', 2 => 'Location' },
  5587. ValueConv => 'Image::ExifTool::GPS::ToDegrees($val)',
  5588. PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1)',
  5589. },
  5590. 0x103 => {
  5591. Name => 'GPSAltitudeRef',
  5592. Condition => '$$self{GPSVersionID}',
  5593. Format => 'int8u',
  5594. Groups => { 1 => 'GPS', 2 => 'Location' },
  5595. PrintConv => {
  5596. 0 => 'Above Sea Level',
  5597. 1 => 'Below Sea Level',
  5598. },
  5599. },
  5600. 0x104 => {
  5601. Name => 'GPSAltitude',
  5602. Condition => '$$self{GPSVersionID}',
  5603. Format => 'rational64u',
  5604. Groups => { 1 => 'GPS', 2 => 'Location' },
  5605. PrintConv => '$val =~ /^(inf|undef)$/ ? $val : "$val m"',
  5606. },
  5607. 0x11c => {
  5608. Name => 'GPSTimeStamp',
  5609. Condition => '$$self{GPSVersionID}',
  5610. Groups => { 1 => 'GPS', 2 => 'Time' },
  5611. Format => 'rational64u[3]',
  5612. ValueConv => 'Image::ExifTool::GPS::ConvertTimeStamp($val)',
  5613. PrintConv => 'Image::ExifTool::GPS::PrintTimeStamp($val)',
  5614. },
  5615. 0x134 => {
  5616. Name => 'GPSSatellites',
  5617. Condition => '$$self{GPSVersionID}',
  5618. Format => 'string[3]',
  5619. Groups => { 1 => 'GPS', 2 => 'Location' },
  5620. },
  5621. 0x137 => {
  5622. Name => 'GPSStatus',
  5623. Condition => '$$self{GPSVersionID}',
  5624. Format => 'string[2]',
  5625. Groups => { 1 => 'GPS', 2 => 'Location' },
  5626. PrintConv => {
  5627. A => 'Measurement Active',
  5628. V => 'Measurement Void',
  5629. },
  5630. },
  5631. 0x139 => {
  5632. Name => 'GPSMeasureMode',
  5633. Condition => '$$self{GPSVersionID}',
  5634. Format => 'string[2]',
  5635. Groups => { 1 => 'GPS', 2 => 'Location' },
  5636. PrintConv => {
  5637. 2 => '2-Dimensional Measurement',
  5638. 3 => '3-Dimensional Measurement',
  5639. },
  5640. },
  5641. 0x13b => {
  5642. Name => 'GPSMapDatum',
  5643. Condition => '$$self{GPSVersionID}',
  5644. Format => 'string[7]',
  5645. Groups => { 1 => 'GPS', 2 => 'Location' },
  5646. },
  5647. 0x142 => {
  5648. Name => 'GPSDateStamp',
  5649. Condition => '$$self{GPSVersionID}',
  5650. Groups => { 1 => 'GPS', 2 => 'Time' },
  5651. Format => 'string[11]',
  5652. ValueConv => 'Image::ExifTool::Exif::ExifDate($val)',
  5653. },
  5654. 0x173 => { # (NC)
  5655. Name => 'AudioCodecID',
  5656. Format => 'string[4]',
  5657. },
  5658. 0x7d3 => {
  5659. Name => 'PreviewImage',
  5660. Groups => { 2 => 'Preview' },
  5661. Format => 'undef[$size-0x7d3]',
  5662. Notes => '640x480 JPEG preview image', # (black borders pad to 480 pixels high)
  5663. RawConv => '$self->ValidateImage(\$val,$tag)',
  5664. },
  5665. );
  5666. # tags in Pentax Optio RZ18 AVI videos (ref PH)
  5667. # (very similar to Olympus::AVI tags)
  5668. %Image::ExifTool::Pentax::Junk2 = (
  5669. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  5670. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5671. FIRST_ENTRY => 0,
  5672. NOTES => 'This information is found in AVI videos from the Optio RZ18.',
  5673. 0x12 => {
  5674. Name => 'Make',
  5675. Format => 'string[24]',
  5676. },
  5677. 0x2c => {
  5678. Name => 'Model',
  5679. Description => 'Camera Model Name',
  5680. Format => 'string[24]',
  5681. },
  5682. 0x5e => {
  5683. Name => 'FNumber',
  5684. Format => 'rational64u',
  5685. PrintConv => 'sprintf("%.1f",$val)',
  5686. },
  5687. 0x83 => {
  5688. Name => 'DateTime1',
  5689. Format => 'string[24]',
  5690. Groups => { 2 => 'Time' },
  5691. },
  5692. 0x9d => {
  5693. Name => 'DateTime2',
  5694. Format => 'string[24]',
  5695. Groups => { 2 => 'Time' },
  5696. },
  5697. 0x12b => {
  5698. Name => 'ThumbnailWidth',
  5699. Format => 'int16u',
  5700. },
  5701. 0x12d => {
  5702. Name => 'ThumbnailHeight',
  5703. Format => 'int16u',
  5704. },
  5705. 0x12f => {
  5706. Name => 'ThumbnailLength',
  5707. Format => 'int32u',
  5708. },
  5709. 0x133 => {
  5710. Name => 'ThumbnailImage',
  5711. Groups => { 2 => 'Preview' },
  5712. Format => 'undef[$val{0x12f}]',
  5713. Notes => '160x120 JPEG thumbnail image',
  5714. RawConv => '$self->ValidateImage(\$val,$tag)',
  5715. },
  5716. );
  5717. #------------------------------------------------------------------------------
  5718. # Convert filter settings (ref PH, K-5)
  5719. # Inputs: 0) value to convert, 1) flag for inverse conversion, 2) lookup table
  5720. # Returns: converted value
  5721. sub PrintFilter($$$)
  5722. {
  5723. my ($val, $inv, $conv) = @_;
  5724. my (@vals, @cval, $t, $v);
  5725. if (not $inv) {
  5726. # forward conversion (reading):
  5727. @vals = split ' ',$val;
  5728. $t = shift @vals;
  5729. push @cval, $$conv{$t} || "Unknown ($t)";
  5730. while (@vals) {
  5731. $t = shift @vals;
  5732. $v = shift @vals;
  5733. next unless $t;
  5734. last unless defined $v;
  5735. my $c = $filterSettings{$t};
  5736. if ($c) {
  5737. my $c1 = $$c[1];
  5738. if (ref $c1) {
  5739. $v = $$c1{$v} || "Unknown($v)";
  5740. } elsif ($v) {
  5741. $v = sprintf $c1, $v;
  5742. }
  5743. push @cval, "$$c[0]=$v";
  5744. } else {
  5745. push @cval, "Unknown($t)=$v";
  5746. }
  5747. }
  5748. return @cval ? \@cval : undef;
  5749. } else {
  5750. # reverse conversion (writing):
  5751. @vals = split /,\s*/, $val;
  5752. # convert filter name
  5753. delete $$conv{OTHER}; # avoid recursion
  5754. $v = Image::ExifTool::ReverseLookup(shift(@vals), $conv);
  5755. $$conv{OTHER} = \&PrintFilter;
  5756. return undef unless defined $v;
  5757. push @cval, $v;
  5758. # generate a lookup table for the filter setting name
  5759. my %settingNames;
  5760. $settingNames{$_} = $filterSettings{$_}[0] foreach keys %filterSettings;
  5761. # convert filter settings
  5762. foreach $v (@vals) {
  5763. $v =~ /^(.*)=(.*)$/ or return undef;
  5764. ($t, $v) = ($1, $2);
  5765. # look up settings name
  5766. $t = Image::ExifTool::ReverseLookup($t, \%settingNames);
  5767. return undef unless defined $t;
  5768. if (ref $filterSettings{$t}[1]) {
  5769. # look up settings value
  5770. $v = Image::ExifTool::ReverseLookup($v, $filterSettings{$t}[1]);
  5771. return undef unless defined $v;
  5772. } else {
  5773. return undef unless Image::ExifTool::IsInt($v);
  5774. }
  5775. push @cval, $t, $v;
  5776. }
  5777. push @cval, (0) x (17 - @cval) if @cval < 17; # pad with zeros if necessary
  5778. return join(' ', @cval);
  5779. }
  5780. }
  5781. #------------------------------------------------------------------------------
  5782. # Convert Pentax hex-based EV (modulo 8) to real number
  5783. # Inputs: 0) value to convert
  5784. # eg) 0x00 -> 0
  5785. # 0x03 -> 0.33333
  5786. # 0x04 -> 0.5
  5787. # 0x05 -> 0.66666
  5788. # 0x08 -> 1 ... etc
  5789. sub PentaxEv($)
  5790. {
  5791. my $val = shift;
  5792. if ($val & 0x01) {
  5793. my $sign = $val < 0 ? -1 : 1;
  5794. my $frac = ($val * $sign) & 0x07;
  5795. if ($frac == 0x03) {
  5796. $val += $sign * ( 8 / 3 - $frac);
  5797. } elsif ($frac == 0x05) {
  5798. $val += $sign * (16 / 3 - $frac);
  5799. }
  5800. }
  5801. return $val / 8;
  5802. }
  5803. #------------------------------------------------------------------------------
  5804. # Convert number to Pentax hex-based EV (modulo 8)
  5805. # Inputs: 0) number
  5806. # Returns: Pentax EV code
  5807. sub PentaxEvInv($)
  5808. {
  5809. my $num = shift;
  5810. my $val = $num * 8;
  5811. # extra fudging makes sure 0.3 and 0.33333 both round up to 3, etc
  5812. my $sign = $num < 0 ? -1 : 1;
  5813. my $inum = $num * $sign - int($num * $sign);
  5814. if ($inum > 0.29 and $inum < 0.4) {
  5815. $val += $sign / 3;
  5816. } elsif ($inum > 0.6 and $inum < .71) {
  5817. $val -= $sign / 3;
  5818. }
  5819. return int($val + 0.5 * $sign);
  5820. }
  5821. #------------------------------------------------------------------------------
  5822. # Encrypt or decrypt Pentax ShutterCount (symmetrical encryption) - PH
  5823. # Inputs: 0) shutter count value, 1) ExifTool object ref
  5824. # Returns: Encrypted or decrypted ShutterCount
  5825. sub CryptShutterCount($$)
  5826. {
  5827. my ($val, $et) = @_;
  5828. # Pentax Date and Time values are used in the encryption
  5829. return undef unless $$et{PentaxDate} and $$et{PentaxTime} and
  5830. length($$et{PentaxDate})==4 and length($$et{PentaxTime})>=3;
  5831. # get Date and Time as integers (after padding Time with a null byte)
  5832. my $date = unpack('N', $$et{PentaxDate});
  5833. my $time = unpack('N', $$et{PentaxTime} . "\0");
  5834. return $val ^ $date ^ (0xffffffff - $time);
  5835. }
  5836. 1; # end
  5837. __END__
  5838. =head1 NAME
  5839. Image::ExifTool::Pentax - Pentax/Asahi maker notes tags
  5840. =head1 SYNOPSIS
  5841. This module is loaded automatically by Image::ExifTool when required.
  5842. =head1 DESCRIPTION
  5843. This module contains definitions required by Image::ExifTool to interpret
  5844. Pentax and Asahi maker notes in EXIF information.
  5845. =head1 NOTES
  5846. I couldn't find a good source for Pentax maker notes information, but I've
  5847. managed to discover a fair bit of information by analyzing sample images
  5848. downloaded from the internet, and through tests with my own Optio WP,
  5849. K10D, and K-5, and with help provided by other ExifTool users (see
  5850. L</ACKNOWLEDGEMENTS>).
  5851. The Pentax maker notes are stored in standard EXIF format, but the offsets
  5852. used for some of their cameras are wacky. The Optio 330 gives the offset
  5853. relative to the offset of the tag in the directory, the Optio WP uses a base
  5854. offset in the middle of nowhere, and the Optio 550 uses different (and
  5855. totally illogical) bases for different menu entries. Very weird. (It
  5856. wouldn't surprise me if Pentax can't read their own maker notes!) Luckily,
  5857. there are only a few entries in the maker notes which are large enough to
  5858. require offsets, so this doesn't affect much useful information. ExifTool
  5859. attempts to make sense of this fiasco by making an assumption about where
  5860. the information should be stored to deduce the correct offsets.
  5861. =head1 REFERENCES
  5862. =over 4
  5863. =item L<Image::MakerNotes::Pentax|Image::MakerNotes::Pentax>
  5864. =item L<http://johnst.org/sw/exiftags/> (Asahi models)
  5865. =item L<http://kobe1995.jp/~kaz/astro/istD.html>
  5866. =item L<http://www.cybercom.net/~dcoffin/dcraw/>
  5867. =item (...plus lots of testing with my Optio WP, K10D and K-5!)
  5868. =back
  5869. =head1 ACKNOWLEDGEMENTS
  5870. Thanks to Wayne Smith, John Francis, Douglas O'Brien Cvetan Ivanov, Jens
  5871. Duttke and Dave Nicholson for help figuring out some Pentax tags, Ger
  5872. Vermeulen and Niels Kristian Bech Jensen for contributing print conversion
  5873. values for some tags, and everyone who helped contribute to the LensType
  5874. values.
  5875. =head1 AUTHOR
  5876. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  5877. This library is free software; you can redistribute it and/or modify it
  5878. under the same terms as Perl itself.
  5879. =head1 SEE ALSO
  5880. L<Image::ExifTool::TagNames/Pentax Tags>,
  5881. L<Image::ExifTool(3pm)|Image::ExifTool>,
  5882. L<Image::Info(3pm)|Image::Info>
  5883. =cut