Sony.pm 360 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465
  1. #------------------------------------------------------------------------------
  2. # File: Sony.pm
  3. #
  4. # Description: Sony EXIF Maker Notes tags
  5. #
  6. # Revisions: 04/06/2004 - P. Harvey Created
  7. #
  8. # References: 1) http://www.cybercom.net/~dcoffin/dcraw/
  9. # 2) http://homepage3.nifty.com/kamisaka/makernote/makernote_sony.htm (2006/08/06)
  10. # 3) Thomas Bodenmann private communication
  11. # 4) Philippe Devaux private communication (A700)
  12. # 5) Marcus Holland-Moritz private communication (A700)
  13. # 6) Andrey Tverdokhleb private communication
  14. # 7) Rudiger Lange private communication (A700)
  15. # 8) Igal Milchtaich private communication
  16. # 9) Michael Reitinger private communication (DSC-TX7,RX100)
  17. # 10) http://www.klingebiel.com/tempest/hd/pmp.html
  18. # 11) Mike Battilana private communication
  19. # 13) http://www.mi-fo.de/forum/index.php?showtopic=33239
  20. # http://www.dyxum.com/dforum/the-alpha-shutter-count-tool_topic97489_page4.html
  21. # 14) Iliah Borg private communication (LibRaw)
  22. # JD) Jens Duttke private communication
  23. # JR) Jos Roost private communication
  24. #------------------------------------------------------------------------------
  25. package Image::ExifTool::Sony;
  26. use strict;
  27. use vars qw($VERSION %sonyLensTypes);
  28. use Image::ExifTool qw(:DataAccess :Utils);
  29. use Image::ExifTool::Exif;
  30. use Image::ExifTool::Minolta;
  31. $VERSION = '2.29';
  32. sub ProcessSRF($$$);
  33. sub ProcessSR2($$$);
  34. sub ProcessSonyPIC($$$);
  35. sub ProcessMoreInfo($$$);
  36. sub Decipher($;$);
  37. sub ProcessEnciphered($$$);
  38. sub WriteEnciphered($$$);
  39. sub WriteSR2($$$);
  40. sub ConvLensSpec($);
  41. sub ConvInvLensSpec($);
  42. sub PrintLensSpec($);
  43. sub PrintInvLensSpec($;$$);
  44. sub MakeTiffHeader($$$$;$);
  45. # (%sonyLensTypes is filled in based on Minolta LensType's)
  46. # Sony E-mount lenses
  47. # (NOTE: these should be kept in sync with the 65535 entries in %minoltaLensTypes)
  48. my %sonyLensTypes2 = (
  49. Notes => 'Lens type numbers for Sony E-mount lenses used by NEX models.',
  50. 0 => 'Unknown E-mount lens or other lens',
  51. 1 => 'Sony LA-EA1 Adapter',
  52. 2 => 'Sony LA-EA2 Adapter',
  53. 3 => 'Sony LA-EA3 Adapter', #(NC) ILCE-7 image with A-mount lens, but also has 0x940e 2nd byte=2
  54. 6 => 'Sony LA-EA4 Adapter', #(NC) ILCE-7R image with A-mount lens and having phase-detect info blocks in 0x940e AFInfo
  55. 44 => 'Metabones Canon EF Smart Adapter', #JR
  56. 78 => 'Metabones Canon EF Smart Adapter Mark III or Other Adapter', #PH/JR (also Mark IV, Fotodiox and Viltrox)
  57. 234 => 'Metabones Canon EF Smart Adapter Mark IV', #JR
  58. 239 => 'Metabones Canon EF Speed Booster', #JR
  59. # Sony VX product code: (http://www.mi-fo.de/forum/index.php?s=7df1c8d3b1cd675f2abf4f4442e19cf2&showtopic=35035&view=findpost&p=303746)
  60. 32784 => 'Sony E 16mm F2.8', # VX9100
  61. 32785 => 'Sony E 18-55mm F3.5-5.6 OSS', # VX9101
  62. 32786 => 'Sony E 55-210mm F4.5-6.3 OSS', # VX9102
  63. 32787 => 'Sony E 18-200mm F3.5-6.3 OSS', # VX9103
  64. 32788 => 'Sony E 30mm F3.5 Macro', # VX9104
  65. 32789 => 'Sony E 24mm F1.8 ZA', # VX9105
  66. 32790 => 'Sony E 50mm F1.8 OSS', # VX9106
  67. 32791 => 'Sony E 16-70mm F4 ZA OSS', # VX9107
  68. 32792 => 'Sony E 10-18mm F4 OSS', # VX9108
  69. 32793 => 'Sony E PZ 16-50mm F3.5-5.6 OSS', # VX9109
  70. 32794 => 'Sony FE 35mm F2.8 ZA', # VX9110
  71. 32795 => 'Sony FE 24-70mm F4 ZA OSS', # VX9111
  72. 32797 => 'Sony E 18-200mm F3.5-6.3 OSS LE', # VX9113
  73. 32798 => 'Sony E 20mm F2.8', # VX9114
  74. 32799 => 'Sony E 35mm F1.8 OSS', # VX9115
  75. 32800 => 'Sony E PZ 18-105mm F4 G OSS', #JR # VX9116
  76. 32802 => 'Sony FE 90mm F2.8 Macro G OSS', # VX?
  77. 32803 => 'Sony E 18-50mm F4-5.6',
  78. 32807 => 'Sony E PZ 18-200mm F3.5-6.3 OSS', # VX9123
  79. 32808 => 'Sony FE 55mm F1.8 ZA', # VX9124
  80. 32810 => 'Sony FE 70-200mm F4 G OSS', #JR # VX9126
  81. 32811 => 'Sony FE 16-35mm F4 ZA OSS', #JR # VX9127
  82. 32813 => 'Sony FE 28-70mm F3.5-5.6 OSS', # VX9129
  83. 32814 => 'Sony FE 35mm F1.4 ZA', # VX?
  84. 32815 => 'Sony FE 24-240mm F3.5-6.3 OSS', # VX?
  85. 32816 => 'Sony FE 28mm F2', #JR # VX?
  86. 32817 => 'Sony FE PZ 28-135mm F4 G OSS',#JR # VX?
  87. 32826 => 'Sony FE 21mm F2.8 (SEL28F20 + SEL075UWC)', #JR # (+ Ultra-wide converter)
  88. 32827 => 'Sony FE 16mm F3.5 Fisheye (SEL28F20 + SEL057FEC)', #JR # (+ Fisheye converter)
  89. 49216 => 'Zeiss Batis 25mm F2', #JR
  90. 49217 => 'Zeiss Batis 85mm F1.8', #JR
  91. 49234 => 'Zeiss Loxia 21mm F2.8', #PH
  92. );
  93. # ExposureProgram values (ref PH, mainly decoded from A200)
  94. my %sonyExposureProgram = (
  95. 0 => 'Auto', # (same as 'Program AE'?)
  96. 1 => 'Manual',
  97. 2 => 'Program AE',
  98. 3 => 'Aperture-priority AE',
  99. 4 => 'Shutter speed priority AE',
  100. 8 => 'Program Shift A', #7
  101. 9 => 'Program Shift S', #7
  102. 16 => 'Portrait', # (A330)
  103. 17 => 'Sports', # (A330)
  104. 18 => 'Sunset', # (A330)
  105. 19 => 'Night Portrait', # (A330)
  106. 20 => 'Landscape', # (A330)
  107. 21 => 'Macro', # (A330)
  108. 35 => 'Auto No Flash', # (A330)
  109. );
  110. # ExposureProgram values in CameraSettings3 (ref JR)
  111. my %sonyExposureProgram2 = ( # A580 Mode Dial setting:
  112. 1 => 'Program AE', # P
  113. 2 => 'Aperture-priority AE', # A
  114. 3 => 'Shutter speed priority AE', # S
  115. 4 => 'Manual', # M
  116. 5 => 'Cont. Priority AE', # (A35)
  117. 16 => 'Auto', # AUTO
  118. 17 => 'Auto (no flash)', # "flash strike-out" symbol
  119. 18 => 'Auto+', #PH (A33)
  120. 49 => 'Portrait', # SCN
  121. 50 => 'Landscape', # SCN
  122. 51 => 'Macro', # SCN
  123. 52 => 'Sports', # SCN
  124. 53 => 'Sunset', # SCN
  125. 54 => 'Night view', # SCN
  126. 55 => 'Night view/portrait', # SCN
  127. 56 => 'Handheld Night Shot', # SCN (also called "Hand-held Twilight")
  128. 57 => '3D Sweep Panorama', # "Panorama" symbol
  129. 64 => 'Auto 2', #PH (A33 AUTO)
  130. 65 => 'Auto 2 (no flash)', #JR (NC, A35)
  131. 80 => 'Sweep Panorama', # "Panorama" symbol
  132. 96 => 'Anti Motion Blur', #PH (NEX-5)
  133. # 128-138 are A35 picture effects (combined SCN/Picture effect mode dial position)
  134. 128 => 'Toy Camera',
  135. 129 => 'Pop Color',
  136. 130 => 'Posterization',
  137. 131 => 'Posterization B/W',
  138. 132 => 'Retro Photo',
  139. 133 => 'High-key',
  140. 134 => 'Partial Color Red',
  141. 135 => 'Partial Color Green',
  142. 136 => 'Partial Color Blue',
  143. 137 => 'Partial Color Yellow',
  144. 138 => 'High Contrast Monochrome',
  145. );
  146. # ExposureProgram values in Tags 2010 and 94xx (ref JR)
  147. my %sonyExposureProgram3 = (
  148. 0 => 'Program AE',
  149. 1 => 'Aperture-priority AE',
  150. 2 => 'Shutter speed priority AE',
  151. 3 => 'Manual',
  152. 4 => 'Auto',
  153. 5 => 'iAuto',
  154. 6 => 'Superior Auto',
  155. 7 => 'iAuto+',
  156. 8 => 'Portrait',
  157. 9 => 'Landscape',
  158. 10 => 'Twilight',
  159. 11 => 'Twilight Portrait',
  160. 12 => 'Sunset',
  161. 14 => 'Action (High speed)', #PH (RX100)
  162. 16 => 'Sports',
  163. 17 => 'Handheld Night Shot',
  164. 18 => 'Anti Motion Blur',
  165. 19 => 'High Sensitivity',
  166. 21 => 'Beach',
  167. 22 => 'Snow',
  168. 23 => 'Fireworks',
  169. 26 => 'Underwater',
  170. 27 => 'Gourmet',
  171. 28 => 'Pet',
  172. 29 => 'Macro',
  173. 30 => 'Backlight Correction HDR',
  174. # 32 => 'Night ... ???', # seen for HDR-CX360E
  175. 33 => 'Sweep Panorama',
  176. 36 => 'Background Defocus',
  177. 37 => 'Soft Skin',
  178. 42 => '3D Image',
  179. 43 => 'Cont. Priority AE',
  180. );
  181. # WhiteBalanceSetting values (ref JR)
  182. my %whiteBalanceSetting = (
  183. 0x10 => 'Auto (-3)', #(NC)
  184. 0x11 => 'Auto (-2)', #(NC)
  185. 0x12 => 'Auto (-1)', #(NC)
  186. 0x13 => 'Auto (0)',
  187. 0x14 => 'Auto (+1)', #(NC)
  188. 0x15 => 'Auto (+2)', #(NC)
  189. 0x16 => 'Auto (+3)', #(NC)
  190. 0x20 => 'Daylight (-3)',
  191. 0x21 => 'Daylight (-2)', #(NC)
  192. 0x22 => 'Daylight (-1)', #(NC)
  193. 0x23 => 'Daylight (0)',
  194. 0x24 => 'Daylight (+1)',
  195. 0x25 => 'Daylight (+2)',
  196. 0x26 => 'Daylight (+3)',
  197. 0x30 => 'Shade (-3)', #(NC)
  198. 0x31 => 'Shade (-2)', #(NC)
  199. 0x32 => 'Shade (-1)', #(NC)
  200. 0x33 => 'Shade (0)',
  201. 0x34 => 'Shade (+1)', #(NC)
  202. 0x35 => 'Shade (+2)', #(NC)
  203. 0x36 => 'Shade (+3)',
  204. 0x40 => 'Cloudy (-3)', #(NC)
  205. 0x41 => 'Cloudy (-2)', #(NC)
  206. 0x42 => 'Cloudy (-1)', #(NC)
  207. 0x43 => 'Cloudy (0)',
  208. 0x44 => 'Cloudy (+1)', #(NC)
  209. 0x45 => 'Cloudy (+2)', #(NC)
  210. 0x46 => 'Cloudy (+3)', #(NC)
  211. 0x50 => 'Tungsten (-3)', #(NC)
  212. 0x51 => 'Tungsten (-2)', #(NC)
  213. 0x52 => 'Tungsten (-1)', #(NC)
  214. 0x53 => 'Tungsten (0)',
  215. 0x54 => 'Tungsten (+1)', #(NC)
  216. 0x55 => 'Tungsten (+2)', #(NC)
  217. 0x56 => 'Tungsten (+3)', #(NC)
  218. 0x60 => 'Fluorescent (-3)', #(NC)
  219. 0x61 => 'Fluorescent (-2)', #(NC)
  220. 0x62 => 'Fluorescent (-1)', #(NC)
  221. 0x63 => 'Fluorescent (0)',
  222. 0x64 => 'Fluorescent (+1)', #(NC)
  223. 0x65 => 'Fluorescent (+2)', #(NC)
  224. 0x66 => 'Fluorescent (+3)', #(NC)
  225. 0x70 => 'Flash (-3)', #(NC)
  226. 0x71 => 'Flash (-2)', #(NC)
  227. 0x72 => 'Flash (-1)', #(NC)
  228. 0x73 => 'Flash (0)',
  229. 0x74 => 'Flash (+1)', #(NC)
  230. 0x75 => 'Flash (+2)', #(NC)
  231. 0x76 => 'Flash (+3)', #(NC)
  232. 0xa3 => 'Custom',
  233. 0xf3 => 'Color Temperature/Color Filter',
  234. );
  235. # AF points for cameras with 15-point AF (ref JR)
  236. my %afPoint15 = (
  237. 0 => 'Upper-left',
  238. 1 => 'Left',
  239. 2 => 'Lower-left',
  240. 3 => 'Far Left',
  241. 4 => 'Top (horizontal)',
  242. 5 => 'Near Right',
  243. 6 => 'Center (horizontal)',
  244. 7 => 'Near Left',
  245. 8 => 'Bottom (horizontal)',
  246. 9 => 'Top (vertical)',
  247. 10 => 'Center (vertical)',
  248. 11 => 'Bottom (vertical)',
  249. 12 => 'Far Right',
  250. 13 => 'Upper-right',
  251. 14 => 'Right',
  252. 15 => 'Lower-right',
  253. 16 => 'Upper-middle',
  254. 17 => 'Lower-middle',
  255. );
  256. # AF points for cameras with 19-point AF (ref PH)
  257. # (verified for A77 firmware 1.07)
  258. my %afPoint19 = (
  259. 0 => 'Upper Far Left',
  260. 1 => 'Upper-left (horizontal)',
  261. 2 => 'Far Left (horizontal)',
  262. 3 => 'Left (horizontal)',
  263. 4 => 'Lower Far Left',
  264. 5 => 'Lower-left (horizontal)',
  265. 6 => 'Upper-left (vertical)',
  266. 7 => 'Left (vertical)',
  267. 8 => 'Lower-left (vertical)',
  268. 9 => 'Far Left (vertical)',
  269. 10 => 'Top (horizontal)',
  270. 11 => 'Near Right',
  271. 12 => 'Center (horizontal)',
  272. 13 => 'Near Left',
  273. 14 => 'Bottom (horizontal)',
  274. 15 => 'Top (vertical)',
  275. 16 => 'Upper-middle',
  276. 17 => 'Center (vertical)',
  277. 18 => 'Lower-middle',
  278. 19 => 'Bottom (vertical)',
  279. 20 => 'Upper Far Right',
  280. 21 => 'Upper-right (horizontal)',
  281. 22 => 'Far Right (horizontal)',
  282. 23 => 'Right (horizontal)',
  283. 24 => 'Lower Far Right',
  284. 25 => 'Lower-right (horizontal)',
  285. 26 => 'Far Right (vertical)',
  286. 27 => 'Upper-right (vertical)',
  287. 28 => 'Right (vertical)',
  288. 29 => 'Lower-right (vertical)',
  289. );
  290. # 79 AF point layout and indices for ILCA-77M2, numbered 0-78 for direct look-up from BITMASK in 0x2020,
  291. # E6 = Center (ref JR)
  292. my %afPoints79 = (
  293. 0=>'A5', 1=>'A6', 2=>'A7',
  294. 3=>'B2', 4=>'B3', 5=>'B4', 6=>'B5', 7=>'B6', 8=>'B7', 9=>'B8', 10=>'B9', 11=>'B10',
  295. 12=>'C1', 13=>'C2', 14=>'C3', 15=>'C4', 16=>'C5', 17=>'C6', 18=>'C7', 19=>'C8', 20=>'C9', 21=>'C10', 22=>'C11',
  296. 23=>'D1', 24=>'D2', 25=>'D3', 26=>'D4', 27=>'D5', 28=>'D6', 29=>'D7', 30=>'D8', 31=>'D9', 32=>'D10', 33=>'D11',
  297. 34=>'E1', 35=>'E2', 36=>'E3', 37=>'E4', 38=>'E5', 39=>'E6', 40=>'E7', 41=>'E8', 42=>'E9', 43=>'E10', 44=>'E11',
  298. 45=>'F1', 46=>'F2', 47=>'F3', 48=>'F4', 49=>'F5', 50=>'F6', 51=>'F7', 52=>'F8', 53=>'F9', 54=>'F10', 55=>'F11',
  299. 56=>'G1', 57=>'G2', 58=>'G3', 59=>'G4', 60=>'G5', 61=>'G6', 62=>'G7', 63=>'G8', 64=>'G9', 65=>'G10', 66=>'G11',
  300. 67=>'H2', 68=>'H3', 69=>'H4', 70=>'H5', 71=>'H6', 72=>'H7', 73=>'H8', 74=>'H9', 75=>'H10',
  301. 76=>'I5', 77=>'I6', 78=>'I7',
  302. );
  303. # AFPoint and AFStatus tags in AFInfo(Tag940e) use numbers 0 to 94 for the 79 positions + 15 cross + 1 F2.8
  304. my %afPoints79_940e = (
  305. 59=>'A5', 50=>'A6', 41=>'A7',
  306. 14=>'B2', 7=>'B3', 0=>'B4', 60=>'B5', 51=>'B6', 42=>'B7', 87=>'B8', 80=>'B9', 73=>'B10',
  307. 21=>'C1', 15=>'C2', 8=>'C3', 1=>'C4', 61=>'C5', 52=>'C6', 43=>'C7', 88=>'C8', 81=>'C9', 74=>'C10', 68=>'C11',
  308. 22=>'D1', 16=>'D2', 9=>'D3', 2=>'D4', 62=>'D5', 53=>'D6', 44=>'D7', 89=>'D8', 82=>'D9', 75=>'D10', 69=>'D11',
  309. 23=>'E1', 17=>'E2', 10=>'E3', 3=>'E4', 63=>'E5', 54=>'E6 Center', 45=>'E7', 90=>'E8', 83=>'E9', 76=>'E10', 70=>'E11',
  310. 24=>'F1', 18=>'F2', 11=>'F3', 4=>'F4', 64=>'F5', 55=>'F6', 46=>'F7', 91=>'F8', 84=>'F9', 77=>'F10', 71=>'F11',
  311. 25=>'G1', 19=>'G2', 12=>'G3', 5=>'G4', 65=>'G5', 56=>'G6', 47=>'G7', 92=>'G8', 85=>'G9', 78=>'G10', 72=>'G11',
  312. 20=>'H2', 13=>'H3', 6=>'H4', 66=>'H5', 57=>'H6', 48=>'H7', 93=>'H8', 86=>'H9', 79=>'H10',
  313. 67=>'I5', 58=>'I6', 49=>'I7',
  314. 28=>'A5 Vertical', 27=>'A6 Vertical', 26=>'A7 Vertical',
  315. 31=>'C5 Vertical', 30=>'C6 Vertical', 29=>'C7 Vertical',
  316. 34=>'E5 Vertical', 33=>'E6 Center Vertical', 32=>'E7 Vertical',
  317. 37=>'G5 Vertical', 36=>'G6 Vertical', 35=>'G7 Vertical',
  318. 40=>'I5 Vertical', 39=>'I6 Vertical', 38=>'I7 Vertical',
  319. 94=>'E6 Center F2.8',
  320. );
  321. my %binaryDataAttrs = (
  322. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  323. WRITE_PROC => \&Image::ExifTool::WriteBinaryData,
  324. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  325. WRITABLE => 1,
  326. FIRST_ENTRY => 0,
  327. );
  328. # tagInfo attributes for unknown cipher block tags
  329. my %unknownCipherData = (
  330. Unknown => 1, # require Unknown option
  331. Hidden => 1, # doesn't appear in Tag Name documentation
  332. RawConv => sub { Decipher(\$_[0]); return $_[0] },
  333. ValueConv => 'PrintHex($val)', # print as hex
  334. PrintConv => 'length($val) > 65 ? substr($val,0,60) . "[...]" : $val', # limit length
  335. );
  336. my %meterInfo1 = (
  337. Format => 'int32u[27]',
  338. PrintConv => 'sprintf("%19d %4d %6d" . " %3d %4d %6d" x 8, split(" ",$val))',
  339. PrintConvInv => '$val',
  340. );
  341. my %meterInfo2 = (
  342. Format => 'int32u[33]',
  343. PrintConv => 'sprintf("%3d %4d %6d" . " %3d %4d %6d" x 10, split(" ",$val))',
  344. PrintConvInv => '$val',
  345. );
  346. # Sony maker notes tags (some elements in common with %Image::ExifTool::Minolta::Main)
  347. %Image::ExifTool::Sony::Main = (
  348. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  349. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  350. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  351. NOTES => q{
  352. The following information has been decoded from the MakerNotes of Sony
  353. cameras. Some of these tags have been inherited from the Minolta
  354. MakerNotes.
  355. },
  356. 0x0010 => [ #PH
  357. # appears to contain mostly AF related information;
  358. # for SLT-A77V and newer, similar info is found in 0x940e AFInfo" (ref JR)
  359. {
  360. Name => 'CameraInfo',
  361. # count: A700=368, A850/A900=5478
  362. Condition => '$count == 368 or $count == 5478',
  363. SubDirectory => {
  364. TagTable => 'Image::ExifTool::Sony::CameraInfo',
  365. ByteOrder => 'BigEndian',
  366. },
  367. },{
  368. Name => 'CameraInfo2',
  369. # count: A200/A300/A350=5506, A230/A290/A330/A380/A390=6118
  370. Condition => '$count == 5506 or $count == 6118',
  371. SubDirectory => {
  372. TagTable => 'Image::ExifTool::Sony::CameraInfo2',
  373. ByteOrder => 'LittleEndian',
  374. },
  375. },{
  376. Name => 'CameraInfo3',
  377. # count: A33/A35/A55V/A450/A500/A550/A560/A580/NEX3/5/5C/C3/VG10E=15360
  378. Condition => '$count == 15360',
  379. SubDirectory => {
  380. TagTable => 'Image::ExifTool::Sony::CameraInfo3',
  381. ByteOrder => 'LittleEndian',
  382. },
  383. },{
  384. Name => 'CameraInfoUnknown',
  385. SubDirectory => { TagTable => 'Image::ExifTool::Sony::CameraInfoUnknown' },
  386. },
  387. ],
  388. # 0x0018 - starts with "GYRO" for sweep panorama images (ref JR)
  389. # - contains ImageStabilization information for Minolta
  390. 0x0020 => [
  391. # similar to WBInfoA100 in Minolta.pm.
  392. # appears to contain various types of information, as in MoreInfo. (ref JR)
  393. {
  394. Name => 'FocusInfo', #PH
  395. # count: A200/A230/A290/A300/A330/A350/A380/A390==19154, A700/A850/A900=19148
  396. Condition => '$count == 19154 or $count == 19148',
  397. SubDirectory => {
  398. TagTable => 'Image::ExifTool::Sony::FocusInfo',
  399. ByteOrder => 'LittleEndian',
  400. },
  401. },{
  402. Name => 'MoreInfo', #JR
  403. # count: A450/A500/A550/A560/A580/A33/A35/A55/NEX-3/5/C3/VG10E==20480
  404. SubDirectory => {
  405. TagTable => 'Image::ExifTool::Sony::MoreInfo',
  406. ByteOrder => 'LittleEndian',
  407. },
  408. },
  409. ],
  410. 0x0102 => { #5/JD
  411. Name => 'Quality',
  412. Writable => 'int32u',
  413. PrintConv => {
  414. 0 => 'RAW',
  415. 1 => 'Super Fine',
  416. 2 => 'Fine',
  417. 3 => 'Standard',
  418. 4 => 'Economy',
  419. 5 => 'Extra Fine',
  420. 6 => 'RAW + JPEG',
  421. 7 => 'Compressed RAW',
  422. 8 => 'Compressed RAW + JPEG',
  423. 0xffffffff => 'n/a', #PH (SLT-A57 panorama)
  424. },
  425. },
  426. 0x0104 => { #5/JD
  427. Name => 'FlashExposureComp',
  428. Description => 'Flash Exposure Compensation',
  429. Writable => 'rational64s',
  430. },
  431. 0x0105 => { #5/JD (models since mid-2014, ILCA-77M2, ILCE-7M2/7RM2/7SM2, do not report this tag anymore, ref JR)
  432. Name => 'Teleconverter',
  433. Writable => 'int32u',
  434. PrintHex => 1,
  435. PrintConv => \%Image::ExifTool::Minolta::minoltaTeleconverters,
  436. },
  437. 0x0112 => { #JD
  438. Name => 'WhiteBalanceFineTune',
  439. Format => 'int32s',
  440. Writable => 'int32u',
  441. },
  442. 0x0114 => [ #PH
  443. {
  444. Name => 'CameraSettings',
  445. # count: A200/A300/A350/A700=280, A850/A900=364
  446. Condition => '$count == 280 or $count == 364',
  447. SubDirectory => {
  448. TagTable => 'Image::ExifTool::Sony::CameraSettings',
  449. ByteOrder => 'BigEndian',
  450. },
  451. },{
  452. Name => 'CameraSettings2',
  453. # count: A230/A290/A330/A380/A390=332
  454. Condition => '$count == 332',
  455. SubDirectory => {
  456. TagTable => 'Image::ExifTool::Sony::CameraSettings2',
  457. ByteOrder => 'BigEndian',
  458. },
  459. },{
  460. Name => 'CameraSettings3',
  461. # count: A560/A580/A33/A35/A55/NEX3/5/5C/C3/VG10E=1536, A450/A500/A550=2048
  462. Condition => '$count == 1536 || $count == 2048',
  463. SubDirectory => {
  464. TagTable => 'Image::ExifTool::Sony::CameraSettings3',
  465. ByteOrder => 'LittleEndian',
  466. },
  467. },{
  468. Name => 'CameraSettingsUnknown',
  469. SubDirectory => {
  470. TagTable => 'Image::ExifTool::Sony::CameraSettingsUnknown',
  471. ByteOrder => 'BigEndian',
  472. },
  473. },
  474. ],
  475. 0x0115 => { #JD
  476. Name => 'WhiteBalance',
  477. Writable => 'int32u',
  478. PrintHex => 1,
  479. PrintConv => {
  480. 0x00 => 'Auto',
  481. 0x01 => 'Color Temperature/Color Filter',
  482. 0x10 => 'Daylight',
  483. 0x20 => 'Cloudy',
  484. 0x30 => 'Shade',
  485. 0x40 => 'Tungsten',
  486. 0x50 => 'Flash',
  487. 0x60 => 'Fluorescent',
  488. 0x70 => 'Custom',
  489. 0x80 => 'Underwater',
  490. },
  491. },
  492. # Tag 0x0116: extra hardware info (ref JR)
  493. # (tag not present for A100, A200, A300, A350, A700, nor for A37, A57, A65, A77)
  494. 0x0116 => [ #JR
  495. {
  496. Name => 'ExtraInfo',
  497. Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
  498. SubDirectory => {
  499. TagTable => 'Image::ExifTool::Sony::ExtraInfo',
  500. ByteOrder => 'BigEndian',
  501. },
  502. },{
  503. Name => 'ExtraInfo2',
  504. Condition => '$$self{Model} =~ /^DSLR-A(230|290|330|380|390)\b/',
  505. SubDirectory => { TagTable => 'Image::ExifTool::Sony::ExtraInfo2' },
  506. },{
  507. Name => 'ExtraInfo3',
  508. # for DSLR-A450/500/550/560/580, SLT-A33/35/55 and NEX-3/5/5C.
  509. SubDirectory => { TagTable => 'Image::ExifTool::Sony::ExtraInfo3' },
  510. }
  511. ],
  512. 0x0e00 => {
  513. Name => 'PrintIM',
  514. Description => 'Print Image Matching',
  515. SubDirectory => { TagTable => 'Image::ExifTool::PrintIM::Main' },
  516. },
  517. # the next 3 tags have a different meaning for some models (with format int32u)
  518. 0x1000 => { #9 (F88, multi burst mode only)
  519. Name => 'MultiBurstMode',
  520. Condition => '$format eq "undef"',
  521. Notes => 'MultiBurst tags valid only for models with this feature, like the F88',
  522. Writable => 'undef',
  523. Format => 'int8u',
  524. PrintConv => { 0 => 'Off', 1 => 'On' },
  525. },
  526. 0x1001 => { #9 (F88, multi burst mode only)
  527. Name => 'MultiBurstImageWidth',
  528. Condition => '$format eq "int16u"',
  529. Writable => 'int16u',
  530. },
  531. 0x1002 => { #9 (F88, multi burst mode only)
  532. Name => 'MultiBurstImageHeight',
  533. Condition => '$format eq "int16u"',
  534. Writable => 'int16u',
  535. },
  536. 0x1003 => { #9 (64 bytes, contains Panorama info for various DSC, NEX, SLT and DSLR models)
  537. Name => 'Panorama',
  538. # panorama: first 4 bytes '1 1 0 0' (little-endian) or '0 0 1 1' (big-endian)
  539. # non-panorama: all bytes are '0' (ref JR)
  540. Condition => '$$self{Panorama} = ($$valPt =~ /^(\0\0)?\x01\x01/)', # (little- or big-endian int32u = 257)
  541. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Panorama' },
  542. },
  543. # 0x2000 - undef[1]
  544. 0x2001 => { #PH (JPEG images from all DSLR's except the A100)
  545. Name => 'PreviewImage',
  546. Groups => { 2 => 'Preview' },
  547. Writable => 'undef',
  548. DataTag => 'PreviewImage',
  549. Notes => 'HD-size preview in JPEG images from almost all DSLR/SLT/ILCA/NEX/ILCE.',
  550. # Note: the preview data starts with a 32-byte proprietary Sony header
  551. # first 8 bytes after 32-byte header:
  552. # \x00\xd8\xff\xe1\x00\x27\xff\xff for JPEG files from A33/35/55V/450/500/550/560/580, NEX-3/5/5C/C3/VG10
  553. # \x00\xd8\xff\xdb\x00\x84\x00\x01 for JPEG files from all other models
  554. # ( \xff\xd8\xff\xdb\x00\x84\x00\x01 corresponding bytes for all ARW files )
  555. #
  556. # DSLR-A700/A850/A900 and DSLR-A200/A300/A350:
  557. # - no MPImage2
  558. # DSLR-A230/A290/A330/A380/A390:
  559. # - PreviewImage start-offset is at 110 bytes inside MPImage2
  560. # DSLR-A450/A500/A550/A560/A580, SLT-A33/A35/A55V, NEX-3/5/5C/C3/VG10/VG10E:
  561. # - PreviewImage start-offset is at 106 bytes inside MPImage2
  562. # - different first bytes after 32-byte header
  563. # SLT-A37/A57/A58/A65V/A77V/A99V, ILCA-77M2, NEX-3N/5N/5R/5T/6/7/F3, ILCE-3000/3500/5000/6000/7/7R/7S:
  564. # - PreviewImage start-offset is at 130 bytes inside MPImage2
  565. # NEX-VG20E/VG30E/VG900, ILCE-QX1: 0x2001 not present
  566. # ILCE-5100/ILCE-7M2/7RM2/7SM2 : 0x2001 present but Size 0 and Offset 0
  567. #
  568. WriteCheck => 'return $val=~/^(none|.{32}\xff\xd8\xff)/s ? undef : "Not a valid image"',
  569. RawConv => q{
  570. return \$val if $val =~ /^Binary/;
  571. $val = substr($val,0x20) if length($val) > 0x20;
  572. # return \$val if $val =~ s/^.(\xd8\xff\xdb)/\xff$1/s;
  573. return \$val if $val =~ s/^.(\xd8\xff[\xdb\xe1])/\xff$1/s;
  574. $$self{PreviewError} = 1 unless $val eq 'none';
  575. return undef;
  576. },
  577. # must construct 0x20-byte header which contains length, width and height
  578. ValueConvInv => q{
  579. return 'none' unless $val;
  580. my $e = new Image::ExifTool;
  581. my $info = $e->ImageInfo(\$val,'ImageWidth','ImageHeight');
  582. return undef unless $$info{ImageWidth} and $$info{ImageHeight};
  583. my $size = Set32u($$info{ImageWidth}) . Set32u($$info{ImageHeight});
  584. return Set32u(length $val) . $size . ("\0" x 8) . $size . ("\0" x 4) . $val;
  585. },
  586. },
  587. 0x2002 => { #JR (written by Sony IDC)
  588. Name => 'Rating',
  589. Writable => 'int32u', # (0-5 stars) (4294967295 for an HX9V iSweep Panorama, ref JR)
  590. },
  591. # 0x2003 - string[256]: all 0 for DSLR, SLT, NEX; data for DSC-HX9V
  592. 0x2004 => { #PH (NEX-5)
  593. Name => 'Contrast',
  594. Writable => 'int32s',
  595. PrintConv => '$val > 0 ? "+$val" : $val',
  596. PrintConvInv => '$val',
  597. },
  598. 0x2005 => { #PH (NEX-5)
  599. Name => 'Saturation',
  600. Writable => 'int32s',
  601. PrintConv => '$val > 0 ? "+$val" : $val',
  602. PrintConvInv => '$val',
  603. },
  604. 0x2006 => { #PH
  605. Name => 'Sharpness',
  606. Writable => 'int32s',
  607. PrintConv => '$val > 0 ? "+$val" : $val',
  608. PrintConvInv => '$val',
  609. },
  610. 0x2007 => { #PH
  611. Name => 'Brightness',
  612. Writable => 'int32s',
  613. PrintConv => '$val > 0 ? "+$val" : $val',
  614. PrintConvInv => '$val',
  615. },
  616. 0x2008 => { #PH
  617. Name => 'LongExposureNoiseReduction',
  618. Writable => 'int32u',
  619. PrintHex => 1,
  620. PrintConv => {
  621. 0 => 'Off',
  622. 1 => 'On (unused)',
  623. 0x10001 => 'On (dark subtracted)', # (NEX-C3)
  624. 0xffff0000 => 'Off (65535)',
  625. 0xffff0001 => 'On (65535)',
  626. 0xffffffff => 'n/a',
  627. },
  628. },
  629. 0x2009 => { #PH
  630. Name => 'HighISONoiseReduction',
  631. Writable => 'int16u',
  632. PrintConv => {
  633. 0 => 'Off',
  634. 1 => 'Low',
  635. 2 => 'Normal',
  636. 3 => 'High',
  637. 256 => 'Auto',
  638. # it seems that all DSC models except DSC-RX models give n/a here (ref JR)
  639. 65535 => 'n/a',
  640. },
  641. },
  642. 0x200a => { #PH (A550)
  643. Name => 'HDR',
  644. Writable => 'int32u',
  645. Format => 'int16u',
  646. Count => 2,
  647. Notes => 'stored as a 32-bit integer, but read as two 16-bit integers',
  648. PrintHex => 1,
  649. PrintConv => [{
  650. 0x0 => 'Off',
  651. 0x01 => 'Auto',
  652. 0x10 => '1.0 EV',
  653. 0x11 => '1.5 EV',
  654. 0x12 => '2.0 EV',
  655. 0x13 => '2.5 EV',
  656. 0x14 => '3.0 EV',
  657. 0x15 => '3.5 EV',
  658. 0x16 => '4.0 EV',
  659. 0x17 => '4.5 EV',
  660. 0x18 => '5.0 EV',
  661. 0x19 => '5.5 EV',
  662. 0x1a => '6.0 EV',
  663. },{ #JR (A580)
  664. 0 => 'Uncorrected image', # A580 stores 2 images: uncorrected and HDR
  665. 1 => 'HDR image (good)',
  666. 2 => 'HDR image (fail 1)', # alignment problem?
  667. 3 => 'HDR image (fail 2)', # contrast problem?
  668. }],
  669. },
  670. 0x200b => { #PH
  671. Name => 'MultiFrameNoiseReduction',
  672. Writable => 'int32u',
  673. Notes => 'may not be valid for RS100', # (RS100 sample was 0 when this feature was turned on)
  674. PrintConv => {
  675. 0 => 'Off',
  676. 1 => 'On',
  677. 255 => 'n/a',
  678. },
  679. },
  680. # 0x200c - int32u[3]: '0 0 0'; seen '2 1 0' for HX9V 3D-Image (in both JPG and MPO image)
  681. # 0x200d - rational64u: 10/10, seen 2.5 for DSC-TX300V, 8 for DSC-HX100V/RX10
  682. 0x200e => { #PH (HX20V)
  683. Name => 'PictureEffect',
  684. Writable => 'int16u',
  685. PrintConv => {
  686. 0 => 'Off',
  687. 1 => 'Toy Camera', #JR (A35)
  688. 2 => 'Pop Color', # (also A35/NEX-C3, ref JR)
  689. 3 => 'Posterization', #JR (A35)
  690. 4 => 'Posterization B/W', #JR (A35)
  691. 5 => 'Retro Photo', #JR (A35, NEX-5)
  692. 6 => 'Soft High Key', # (also A65V, A35/NEX-C3 call this "High-key", ref JR)
  693. 7 => 'Partial Color (red)', #JR (A35)
  694. 8 => 'Partial Color (green)', #JR (A35, NEX-5)
  695. 9 => 'Partial Color (blue)', #JR (A35)
  696. 10 => 'Partial Color (yellow)', #JR (A35, NEX-5)
  697. 13 => 'High Contrast Monochrome', #JR (A35)
  698. 16 => 'Toy Camera (normal)', # (also A65, ref JR)
  699. 17 => 'Toy Camera (cool)', # (RX100)
  700. 18 => 'Toy Camera (warm)', # (RX100)
  701. 19 => 'Toy Camera (green)', # (RX100)
  702. 20 => 'Toy Camera (magenta)', # (RX100)
  703. 32 => 'Soft Focus (low)', #JR (RX100)
  704. 33 => 'Soft Focus', #JR (A65V)
  705. 34 => 'Soft Focus (high)', # (RX100)
  706. 48 => 'Miniature (auto)', #JR (A65V/NEX-7, horizontal)
  707. 49 => 'Miniature (top)', # (RX100)
  708. 50 => 'Miniature (middle horizontal)', # (WX100/HX20V, horizontal)
  709. 51 => 'Miniature (bottom)', # (WX100, rotate 90 CW)
  710. 52 => 'Miniature (left)', # (RX100)
  711. 53 => 'Miniature (middle vertical)', # (RX100)
  712. 54 => 'Miniature (right)', # (RX100)
  713. 64 => 'HDR Painting (low)', # (RX100)
  714. 65 => 'HDR Painting', # (also A65V, ref JR)
  715. 66 => 'HDR Painting (high)', # (RX100)
  716. 80 => 'Rich-tone Monochrome', # (also A65V, ref JR)
  717. 97 => 'Water Color', # (HX200V)
  718. 98 => 'Water Color 2',
  719. 112 => 'Illustration (low)', # (RX100)
  720. 113 => 'Illustration', # (RX100)
  721. 114 => 'Illustration (high)', # (RX100)
  722. },
  723. },
  724. 0x200f => { #PH (RX100)
  725. Name => 'SoftSkinEffect',
  726. Writable => 'int32u',
  727. PrintConv => {
  728. 0 => 'Off',
  729. 1 => 'Low',
  730. 2 => 'Mid',
  731. 3 => 'High',
  732. # 0x10001 - seen (ref JR)
  733. # 0x10002 - seen for landscape and portrait flash (ref JR)
  734. 0xffffffff => 'n/a', # (A35)
  735. },
  736. },
  737. 0x2010 => [ #JR
  738. # different camera models have similar content but at different offsets, appears to correlate with:
  739. # 0x1206 - 0x1207 deciphered (0x1205 changes with firmware version):
  740. # ad c3 - NEX-5N
  741. # 0x0192 - 0x0193 deciphered (0x0191 changes with firmware version):
  742. # 91 c3 - NEX-VG20E
  743. # 93 c3 - NEX-7, SLT-A65V/A77V
  744. # 94 c3 - Hasselblad Lunar
  745. # 0x0012 - 0x0013 deciphered (0x0011 changes with firmware version):
  746. # 94 c3 - SLT-A37/A57, NEX-F3
  747. # 95 d3 - DSC-WX50, WX70
  748. # 98 c3 - DSC-HX200V, HX20V, HX30V, TX200V, TX300V
  749. # 98 d3 - DSC-HX10V, TX66, WX100, WX150
  750. # 9a c3 - DSC-RX1, RX1R
  751. # 9b c3 - SLT-A99V, Hasselblad HV
  752. # 9c c3 - NEX-VG30E
  753. # 9d c3 - DSC-RX100, Hasselblad Stellar
  754. # 9e c3 - NEX-VG900, SLT-A58
  755. # a1 d3 - DSC-TX30
  756. # a2 d3 - DSC-WX60, WX80, WX200, WX300
  757. # a3 c3 - NEX-6, DSC-HX300, HX50V
  758. # a4 c3 - NEX-3N/5R/5T, ILCE-3000/3500
  759. # unknown offsets or values for DSC-TX20/TX55/WX30
  760. # unknown offsets or values for DSC-HX60V/HX400V/QX10/QX30/QX100/RX10/RX100M2/RX100M3/WX220/WX350,
  761. # ILCA-77M2, ILCE-5000/5100/6000/7/7M2/7R/7S/QX1
  762. # unknown offsets or values for DSC-HX90V/RX1RM2/RX10M2/RX100M4/WX500, ILCE-7RM2/7SM2
  763. {
  764. Name => 'Tag2010a', # ad
  765. Condition => '$$self{Model} =~ /^NEX-5N$/',
  766. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010a' },
  767. },{
  768. Name => 'Tag2010b', # 91, 93
  769. Condition => '$$self{Model} =~ /^(SLT-A(65|77)V?|NEX-(7|VG20E)|Lunar)$/',
  770. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010b' },
  771. },{
  772. Name => 'Tag2010c', # 94
  773. Condition => '$$self{Model} =~ /^(SLT-A(37|57)|NEX-F3)$/',
  774. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010c' },
  775. },{
  776. Name => 'Tag2010d', # 95, 98
  777. Condition => q{
  778. $$self{Model} =~ /^(DSC-(HX10V|HX20V|HX30V|HX200V|TX66|TX200V|TX300V|WX50|WX70|WX100|WX150))$/ and
  779. not $$self{Panorama}
  780. },
  781. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010d' },
  782. },{
  783. Name => 'Tag2010e', # 9a, 9b, 9c, 9d, 9e, a1, a2, a3, a4
  784. Condition => q{
  785. $$self{Model} =~ /^(SLT-A99V?|HV|SLT-A58|ILCE-(3000|3500)|NEX-(3N|5R|5T|6|VG900|VG30E)|DSC-(RX100|RX1|RX1R)|Stellar)$/ or
  786. ($$self{Model} =~ /^(DSC-(HX300|HX50V|TX30|WX60|WX80|WX200|WX300))$/ and not $$self{Panorama})
  787. },
  788. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010e' },
  789. },{
  790. Name => 'Tag2010f', # ?
  791. Condition => '$$self{Model} =~ /^(DSC-(RX100M2|QX10|QX100))$/',
  792. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010f' },
  793. },{
  794. Name => 'Tag2010g', # ?
  795. Condition => '$$self{Model} =~ /^(DSC-(QX30|RX10|RX100M3|HX60V|HX400V|WX220|WX350)|ILCE-(7(R|S|M2)?|[56]000|5100|QX1)|ILCA-77M2)\b/',
  796. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010g' },
  797. },{
  798. Name => 'Tag2010h', # ?
  799. Condition => '$$self{Model} =~ /^(DSC-(RX1RM2|RX10M2|RX100M4|HX90V|WX500)|ILCE-7RM2|ILCE-7SM2)\b/',
  800. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag2010h' },
  801. },{
  802. Name => 'Tag_0x2010',
  803. %unknownCipherData,
  804. }],
  805. 0x2011 => { #PH (A77, NEX-5N)
  806. Name => 'VignettingCorrection',
  807. Writable => 'int32u',
  808. PrintConv => {
  809. 0 => 'Off',
  810. 2 => 'Auto',
  811. 0xffffffff => 'n/a', # (RX100)
  812. },
  813. },
  814. 0x2012 => { #PH (A77, NEX-5N)
  815. Name => 'LateralChromaticAberration',
  816. Writable => 'int32u',
  817. PrintConv => {
  818. 0 => 'Off',
  819. 2 => 'Auto',
  820. 0xffffffff => 'n/a', # (RX100)
  821. },
  822. },
  823. 0x2013 => { #PH (A77, NEX-5N) ("Setting"; application of such correction is indicated in Tag9405 - ref JR)
  824. Name => 'DistortionCorrectionSetting',
  825. Writable => 'int32u',
  826. PrintConv => {
  827. 0 => 'Off',
  828. 2 => 'Auto',
  829. 0xffffffff => 'n/a', # (RX100)
  830. },
  831. },
  832. 0x2014 => { #JR/9
  833. Name => 'WBShiftAB_GM',
  834. Writable => 'int32s',
  835. Count => 2,
  836. Notes => q{
  837. 2 numbers: 1. positive is a shift toward amber, 2. positive is a shift
  838. toward magenta
  839. },
  840. },
  841. # 0x2015 - int16u: 65535, also for 'normal' HDR images; 0 for HDR-paint and high-contrast-BW effect images
  842. 0x2016 => { #PH (RX100)
  843. Name => 'AutoPortraitFramed',
  844. Writable => 'int16u',
  845. Notes => '"Yes" if this image was created by the Auto Portrait Framing feature',
  846. PrintConv => { 0 => 'No', 1 => 'Yes' },
  847. },
  848. # 0x2017 - int32u: flash mode. 0=off, 1=fired, 2=red-eye (PH, NEX-6) (also in A99, RX1, NEX-5R)
  849. 0x2017 => { #JR
  850. Name => 'FlashAction',
  851. Writable => 'int32u',
  852. PrintConv => {
  853. 0 => 'Did not fire',
  854. 1 => 'Flash Fired',
  855. 2 => 'External Flash Fired',
  856. },
  857. },
  858. # 0x2018 - something with external flash: seen 1 only when 0x2017 = 2
  859. # 0x2019 - 0, also seen 1 for ILCE-7M2
  860. # 0x201a - 0 or 1
  861. 0x201b => { #PH
  862. # FocusMode for SLT/HV/ILCA and NEX/ILCE; doesn't seem to apply to DSC models (always 0)
  863. Name => 'FocusMode',
  864. Condition => '$$self{Model} !~ /^DSC-/',
  865. Writable => 'int8u',
  866. Priority => 0,
  867. PrintConv => {
  868. 0 => 'Manual',
  869. 2 => 'AF-S',
  870. 3 => 'AF-C',
  871. 4 => 'AF-A',
  872. 6 => 'DMF', # "Direct Manual Focus"
  873. 7 => 'AF-D', # "Depth Map Assist Continuous AF"
  874. },
  875. },
  876. 0x201c => [ #JR
  877. # AFAreaModeSetting for SLT/HV/ILCA and NEX/ILCE; doesn't seem to apply to DSC models (always 0)
  878. # all DSLR/SLT/HV Wide Zone Spot Local
  879. # all NEX and ILCE-3000 Multi Center FlexibleSpot
  880. # ILCE-7 and newer Wide Zone Center FlexibleSpot
  881. # ILCA-77M2 and newer Wide Zone Center FlexibleSpot
  882. # (actual AFAreaMode used may be different as camera can override this under certain conditions)
  883. {
  884. Name => 'AFAreaModeSetting',
  885. Condition => '$$self{Model} =~ /^(SLT-|HV)/',
  886. Notes => 'SLT models',
  887. Writable => 'int8u',
  888. PrintConv => {
  889. 0 => 'Wide',
  890. 4 => 'Local',
  891. 8 => 'Zone', #PH
  892. 9 => 'Spot',
  893. },
  894. },{
  895. Name => 'AFAreaModeSetting',
  896. Condition => '$$self{Model} =~ /^(NEX-|ILCE-)/',
  897. Notes => 'NEX and ILCE models',
  898. Writable => 'int8u',
  899. PrintConv => {
  900. 0 => 'Multi', # all NEX and ILCE-3000/3500; all other ILCE use the name 'Wide'
  901. 1 => 'Center',
  902. 3 => 'Flexible Spot',
  903. 11 => 'Zone', # (NC)
  904. },
  905. },{
  906. Name => 'AFAreaModeSetting',
  907. Condition => '$$self{Model} =~ /^ILCA-/',
  908. Notes => 'ILCA models',
  909. Writable => 'int8u',
  910. PrintConv => {
  911. 0 => 'Wide',
  912. 4 => 'Flexible Spot',
  913. 8 => 'Zone',
  914. 9 => 'Center',
  915. 12 => 'Expanded Flexible Spot', # (NC, new mode in ILCA-77M2)
  916. },
  917. },
  918. ],
  919. 0x201d => { #JR
  920. # Flexible Spot position for NEX/ILCE, non-zero only when AFAreaMode='Flexible Spot'
  921. # observed values in range (0 0) to (640 480), with center (320 240) often seen
  922. # for NEX-5R/6, positions appear to be in an 11x9 grid
  923. Name => 'FlexibleSpotPosition',
  924. Condition => '$$self{Model} =~ /^(NEX-|ILCE-)/',
  925. Writable => 'int16u',
  926. Count => 2,
  927. Notes => q{
  928. X and Y coordinages of the AF point. Valid only when AFAreaMode is Flexible
  929. Spot
  930. },
  931. },
  932. 0x201e => [{ #PH (A99)
  933. # AFPointSelected for SLT/HV/ILCA, non-zero only when AFAreaMode = 'Local' or 'Zone'
  934. # (NC) AFZoneSelected for NEX/ILCE, non-zero only when AFAreaMode = 'Zone'
  935. # doesn't seem to apply to DSC models (always 0)
  936. Name => 'AFPointSelected',
  937. Condition => '$$self{Model} =~ /^(SLT-|HV)/',
  938. Notes => 'SLT models',
  939. Writable => 'int8u',
  940. PrintConvColumns => 2,
  941. PrintConv => {
  942. 0 => 'Auto', # (NC)
  943. 1 => 'Center',
  944. 2 => 'Top',
  945. 3 => 'Upper-right',
  946. 4 => 'Right',
  947. 5 => 'Lower-right',
  948. 6 => 'Bottom',
  949. 7 => 'Lower-left',
  950. 8 => 'Left',
  951. 9 => 'Upper-left',
  952. 10 => 'Far Right',
  953. 11 => 'Far Left',
  954. 12 => 'Upper-middle',
  955. 13 => 'Near Right',
  956. 14 => 'Lower-middle',
  957. 15 => 'Near Left',
  958. 16 => 'Upper Far Right',
  959. 17 => 'Lower Far Right',
  960. 18 => 'Lower Far Left',
  961. 19 => 'Upper Far Left',
  962. },
  963. },{
  964. Name => 'AFPointSelected',
  965. Condition => '$$self{Model} =~ /^ILCA-/',
  966. Notes => 'ILCA models',
  967. Writable => 'int8u',
  968. ValueConv => '$val - 1', # to get the same numbers as from the BITMASK in 0x2020
  969. ValueConvInv => '$val + 1',
  970. PrintConvColumns => 3,
  971. PrintConv => {
  972. -1 => 'Auto',
  973. %afPoints79,
  974. 39 => 'E6 (Center)', # (add " (Center)" to central point)
  975. },
  976. },{
  977. Name => 'AFZoneSelected',
  978. Condition => '$$self{Model} =~ /^(NEX-|ILCE-)/',
  979. Notes => 'NEX and ILCE models',
  980. Writable => 'int8u',
  981. PrintConv => { # ILCE-6000 allows to select 9 Zones, seen values 1, 4, 5, decoding not yet known
  982. 0 => 'n/a',
  983. 1 => 'Zone 1',
  984. 4 => 'Zone 4',
  985. 5 => 'Zone 5',
  986. },
  987. }],
  988. # 0x201f - 0 0 0 0 for SLT and DSC; 4 values for NEX/ILCE with 4th value always 0:
  989. # possibly bits relating to the 25 AF-Contrast-areas ???
  990. # 0x2020 - 10 values; for SLT/ILCA and NEX/ILCE with A-mount lens: relates to (phase-detect) AFPoints
  991. 0x2020 => [{
  992. Name => 'AFPointsUsed',
  993. Condition => '$$self{Model} !~ /^(ILCA-|DSC-)/', # (doesn't seem to apply to DSC-models)
  994. Notes => 'SLT models, or NEX/ILCE with A-mount lenses',
  995. BitsPerWord => 8,
  996. BitsTotal => 80,
  997. Notes => 'SLT models only',
  998. PrintConvColumns => 2,
  999. PrintConv => {
  1000. 0 => '(none)',
  1001. BITMASK => {
  1002. 0 => 'Center',
  1003. 1 => 'Top',
  1004. 2 => 'Upper-right',
  1005. 3 => 'Right',
  1006. 4 => 'Lower-right',
  1007. 5 => 'Bottom',
  1008. 6 => 'Lower-left',
  1009. 7 => 'Left',
  1010. 8 => 'Upper-left',
  1011. 9 => 'Far Right',
  1012. 10 => 'Far Left',
  1013. 11 => 'Upper-middle',
  1014. 12 => 'Near Right',
  1015. 13 => 'Lower-middle',
  1016. 14 => 'Near Left',
  1017. 15 => 'Upper Far Right',
  1018. 16 => 'Lower Far Right',
  1019. 17 => 'Lower Far Left',
  1020. 18 => 'Upper Far Left',
  1021. },
  1022. },
  1023. },{
  1024. Name => 'AFPointsUsed',
  1025. Condition => '$$self{Model} =~ /^ILCA-/',
  1026. Notes => 'ILCA models',
  1027. BitsPerWord => 8,
  1028. BitsTotal => 80,
  1029. PrintConv => {
  1030. 0 => '(none)',
  1031. BITMASK => { %afPoints79 },
  1032. },
  1033. }],
  1034. # 0x2021 - 0 for DSC; 0, 1 or 2 for SLT/ILCA and NEX/ILCE: 1=Face, 2=object-tracking ?
  1035. # 0x2022 - 13 bytes (104 bits) for SLT-A58/A99V, NEX-3N/5R/5T/6/VG30E/VG900, ILCE-3000/3500/5000/7/7R
  1036. # 26 bytes (208 bits) for ILCA-77M2, ILCE-5100/6000/7M2/7S/QX1 (7M2 has 117, 5100/6000 have 179 PhaseAFPoints)
  1037. # 52 bytes (416 bits) for ILCE-7RM2 (which has 399 PhaseAFPoints) and ILCE-7SM2
  1038. # Only seen non-zero values for ILCE-5100/6000/7M2/7RM2 in AF-C mode: maybe FocalPlaneAFPointsUsed ???
  1039. # (Similar number of bytes for contemporary DSC models, but mostly all non-zero values.)
  1040. 0x2022 => [{
  1041. Name => 'FocalPlaneAFPointsUsed',
  1042. Condition => '$$self{Model} =~ /^(ILCE-(5100|6000|7M2))/',
  1043. Notes => 'On-sensor/focal-plane phase AF points for ILCE with hybrid AF',
  1044. BitsPerWord => 8,
  1045. BitsTotal => 208, # 26 words
  1046. PrintConv => {
  1047. 0 => '(none)',
  1048. BITMASK => { },
  1049. },
  1050. },{
  1051. Name => 'FocalPlaneAFPointsUsed',
  1052. Condition => '$$self{Model} =~ /^ILCE-7RM2/',
  1053. BitsPerWord => 8,
  1054. BitsTotal => 416, # 52 words
  1055. PrintConv => {
  1056. 0 => '(none)',
  1057. BITMASK => { },
  1058. },
  1059. }],
  1060. # 0x2023 - 0
  1061. # 0x2025 - n1 n2 0 0 DSC-RX100M3/RX100M4/RX10M2/HX90V/WX500, ILCA-77M2, ILCE-5100/7M2/7RM2/7S/QX1
  1062. # seen n1=0,2,4,5,7 and n2=0,1,3, very often: 7 3 0 0
  1063. # 0x2026 - seen from ILCE-7RM2 onwards, 2 values corresonding to 0x2014 WBShiftAB_GM
  1064. # e.g. (0 4000), (2000 2000), (0 -1000) corresponding to 0x2014 values of (0 4), (2 2), (0 -1)
  1065. # probably related to more precise WB setting option of ILCE-7RM2.
  1066. 0x2026 => { #JR
  1067. Name => 'WBShiftAB_GM_Precise',
  1068. Writable => 'int32s',
  1069. Count => 2,
  1070. Notes => q{
  1071. 2 numbers: 1. positive is a shift toward amber, 2. positive is a shift
  1072. toward magenta (tbc)
  1073. },
  1074. # t.b.d. apply scaling to same values as 0x2014 ???
  1075. # PrintConv => 'my @v=split(" ",$val); $_/=1000 foreach @v; sprintf("%.3f %.3f",$v[0],$v[1])',
  1076. },
  1077. # 0x2027 - W H W/2 H/2 DSC-HX90V/RX1RM2/RX10M2/RX100M4/WX500, ILCE-7RM2/7SM2
  1078. # or W H val1 val2
  1079. # or 0 0 0 0
  1080. # 0x2028 - 0 0 for DSC-RX100M4/RX10M2, ILCE-7RM2/7SM2; seen non-zero values only for DSC-RX1RM2
  1081. 0x2028 => { #JR
  1082. Name => 'VariableLowPassFilter',
  1083. Format => 'int32u',
  1084. PrintConv => {
  1085. 0x00000 => 'n/a',
  1086. 0x00001 => 'Off',
  1087. 0x10001 => 'Standard',
  1088. 0x20001 => 'High',
  1089. },
  1090. },
  1091. 0x3000 => {
  1092. Name => 'ShotInfo',
  1093. SubDirectory => { TagTable => 'Image::ExifTool::Sony::ShotInfo' },
  1094. },
  1095. # 0x3000: data block that includes DateTimeOriginal string
  1096. #
  1097. # at least some data for tags 0x2010, 0x9050 and 0x94xx is encrypted - PH
  1098. # (This is certainly true for at least parts of 0x2010, 0x9050, 0x9400, 0x9402 and 0x9403,
  1099. # but hasn't been verified for other tags -- just to be thorough, decipher all of them)
  1100. # Note: "(e)" in a comment indicates an enciphered value, all other values are deciphered
  1101. #
  1102. # 0x900b - 1st byte 0xae: face detection info for A450/500/550/560/580, A33/35/55, NEX-3/5/5C/C3/VG10
  1103. # - other 1st byte values for some DSC-models
  1104. # - seen many 1,8,27,64... values: assume encrypted like other 9xxx tags
  1105. 0x900b => {
  1106. Name => 'Tag900b',
  1107. Condition => '$$valPt =~ /^\xae/',
  1108. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag900b' },
  1109. },
  1110. 0x9050 => {
  1111. Name => 'Tag9050',
  1112. # 944 bytes for A37, A57, A99, NEX-F3, NEX-5R, NEX-6, DSC-RX1, DSC-RX100
  1113. # 3072 bytes for A65, A77, NEX-5N, NEX-7, NEX-VG20 (ref JR)
  1114. SubDirectory => {
  1115. TagTable => 'Image::ExifTool::Sony::Tag9050',
  1116. ByteOrder => 'LittleEndian',
  1117. },
  1118. },
  1119. 0x9400 => [
  1120. # first byte:
  1121. # 0x07 (e) for DSC-HX7V/HX9V/HX100V/TX10/TX100/TX100V/WX7/WX9/WX10, HDR-CX../PJ..
  1122. # 0x09 (e) for DSC-TX20/TX55/WX30
  1123. # 0x0a (e) for SLT-A37/A57/A65V/A77V/A99V, NEX-F3/5N/5R/5T/6/7/VG20E, DSC-RX100/RX1/RX1R/HX10V/HX20V/HX30V/HX200V/TX200V/TX300V/TX66/WX50/WX100/WX150, Lunar/Stellar/HV
  1124. # 0x0c (e) for ILCE-3000/3500, NEX-3N, SLT-A58, DSC-HX50V/HX300/RX100M2/TX30/WX60/WX80/WX200/WX300, DSC-QX10/QX100
  1125. # 0xd0 (e) H90, W650, W690: tag9400 decoding appears not valid/different
  1126. # 0x23 (e) for DSC-RX10/HX60V/HX400V/WX220/WX350, ILCE-7/7R/5000/6000, ILCA-77M2
  1127. # 0x24 (e) for ILCE-5100/7M2/7RM2/7S/7SM2/QX1, DSC-HX90V/QX30/RX100M3/RX100M4/RX10M2/RX1RM2/WX500
  1128. # first byte decoded: 40, 204, 202, 27, 58, 62, 48 respectively
  1129. {
  1130. Name => 'Tag9400a',
  1131. Condition => q{
  1132. $$valPt =~ /^[\x07\x09\x0a]/ or
  1133. ($$valPt =~ /^[\x5e\xe7\x04]/ and $$self{DoubleCipher} = 1)
  1134. },
  1135. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9400a' },
  1136. },{
  1137. Name => 'Tag9400b',
  1138. Condition => '$$valPt =~ /^\x0c/',
  1139. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9400b' },
  1140. },{
  1141. Name => 'Tag9400c',
  1142. Condition => '$$valPt =~ /^[\x23\x24]/',
  1143. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9400c' },
  1144. },{
  1145. Name => 'Sony_0x9400',
  1146. %unknownCipherData,
  1147. }],
  1148. 0x9401 => {
  1149. Name => 'Sony_0x9401',
  1150. %unknownCipherData,
  1151. # notes for data in this block (ref PH/JR):
  1152. # 0x02-0x03 appear to have some relation to start-offset of data...
  1153. # 0x00 - 0x03 Metering
  1154. # Mode
  1155. # f4 00 00 03 - - DSC-H90/W650/W690
  1156. # cf 0b 9f 0f 0x09bc (a) DSC-WX9
  1157. # 1c 00 ac 0f 0x09c9 (b) HDR-CX130E/CX160E/CX360E/CX560E/CX700E/PJ10E/PJ30E
  1158. # b7 0f f7 0f 0x09dd (c) DSC-HX7V/TX10/WX7/WX10
  1159. # b7 0f fa 0f 0x09e0 (d) DSC-HX9V/HX100V/TX100/TX100V
  1160. # 27 00 fd 0f 0x09e7 (e) DSC-TX20/TX55/WX30
  1161. # 69 1f ff 0f 0x09e9 (f) NEX-5N
  1162. # 21 2b cf 0f 0x09e9 (f) NEX-7/VG20E, SLT-A65V/A77V, Lunar
  1163. # 2d 00 d5 0d 0x09a2 (g) DSC-HX10V/HX20V/HX30V/HX200V/TX66/TX200V/TX300V/WX50/WX70/WX100/WX150
  1164. # 2f 00 d6 0d 0x09a3 (h) NEX-F3, SLT-A37/A57
  1165. # 30 00 d8 0d 0x09a5 (i) HDR-AS15
  1166. # 32 00 e2 0d 0x09ac (j) DSC-RX100, Stellar
  1167. # 33 00 e2 0d 0x09ac (j) NEX-5R/5T/6, NEX-VG900/VG30E
  1168. # 33 50 e2 0d 0x09ac (j) SLT-A99V, HV
  1169. # 33 40 0d 0e 0x09d7 (k) DSC-RX1 v0.01
  1170. # 33 41 0d 0e 0x09d7 (k) DSC-RX1, DSC-RX1R
  1171. # 38 00 32 0e 0x09fc (l) SLT-A58, ILCE-3000/3500, NEX-3N, DSC-HX300/HX50V/WX200/WX300/WX60/WX80/TX30
  1172. # 3a 10 3a 0e 0x0a01 (m) DSC-QX10/QX100
  1173. # 3a 20 47 0e 0x0a01 (m) DSC-RX100M2
  1174. # 43 00 66 0e 0x0a1b (n) ILCE-7/7R v0.xx/v1.00/v1.01, ILCE-5000, DSC-RX10
  1175. # 43 10 66 0e 0x0a1b (n) ILCE-7/7R v1.02/v1.10
  1176. # 43 30 6c 0e 0x0a1b (n) ILCE-7/7R v1.20/v2.00
  1177. # 44 00 9c 0e 0x0a39 (o) ILCE-6000 v1.00/v1.10, DSC-HX60V/HX400V/WX220/WX350 (also DSC-QX30 samples from sony.net)
  1178. # 49 00 b0 0e 0x0a3b (p) ILCA-77M2 V1.00/v1.01/v2.00 (also DSC-RX100M3 samples from sony.net)
  1179. # 4a 00 b3 0e 0x0a3d (q) ILCE-7S v1.00, ILCE-5100 v1.00/v1.10, ILCE-QX1, DSC-QX30/RX100M3
  1180. # 4a 20 b9 0e 0x0a3d (q) ILCE-7S v1.20/v2.00
  1181. # 4e 10 d0 0e 0x0a5a (r) ILCE-7M2 v1.00/v1.10
  1182. # 4e 30 d6 0e 0x0a5a (r) ILCE-7M2 v1.20/v1.21/v2.00
  1183. # 5a 00 14 0f 0x0a85 (s) DSC-HX90V/WX500
  1184. # 5d 00 56 0f 0x0ac7 (t) DSC-RX10M2/RX100M4, ILCE-7RM2/7SM2 v1.00/v1.10/v2.00 (also DSC-RX1RM2 samples from Sony)
  1185. # 5d 1d 58 0f 0x0ac7 (t) ILCE-7RM2 v3.00
  1186. # 5d 1e 57 0f 0x0ac7 (t) DSC-RX1RM2 v1.00
  1187. #
  1188. # 0x0004 - (RX100: 0 or 1. subsequent data valid only if 1 - PH)
  1189. # 0x0007 => {
  1190. # Name => 'DynamicRangeOptimizer_9401',
  1191. # PrintConv => {
  1192. # 0 => 'Disabled', # seen for Panorama images
  1193. # 1 => 'Auto',
  1194. # 3 => 'Lv1', #NC
  1195. # 4 => 'Lv2', #NC
  1196. # 5 => 'Lv3',
  1197. # 6 => 'Lv4',
  1198. # 7 => 'Lv5',
  1199. # # 8 - seen for VG20E and some other models - PH
  1200. # 255 => 'Off',
  1201. # },
  1202. # },
  1203. },
  1204. 0x9402 => [{
  1205. Name => 'Tag9402',
  1206. # first 2 bytes deciphered:
  1207. # 0x00 0x00 SLT-A37/A57/A65/A77
  1208. # 0x0e 0x00 DSC-H90/HX7V/HX9V/HX100V/TX10/TX100/TX100V/TX20/TX55/W650/W690/W730/WX10/WX30/WX7/WX9, but also seen:
  1209. # 0x0e 0x01 for a few DSC-W650/W690 samples ...
  1210. # 0x0f 0x01 NEX-5N/7/VG20, Lunar
  1211. # 0x10 0x01 DSC-HX10V/HX200V/HX20V/HX300/HX30V/HX50V/TX200V/TX30/TX300V/TX66/RX100/RX1/RX1R/WX100/WX150/WX200/WX300/WX50/WX60/WX70/WX80, Stellar,
  1212. # ILCE-3000/3500, NEX-F3/3N/5R/5T/6/VG30/VG900
  1213. # 0x11 0x01 DSC-RX100M2/QX10/QX100
  1214. # 0x13 0x01 ILCE-5000/7/7R, DSC-RX10, but also seen:
  1215. # 0x12 0x01 for ILCE-7/7R and DSC-RX10 samples from Sony.net ...
  1216. # 0x15 0x01 for a few ILCE-7/7R ...
  1217. # 0x14 0x01 ILCE-6000, DSC-HX60V/HX400V/WX220/WX350
  1218. # 0x17 0x01 ILCE-7S/7M2/5100/QX1, DSC-QX30/RX100M3
  1219. # 0x19 0x01 DSC-HX90V/RX1RM2/RX10M2/RX100M4/WX500, ILCE-7RM2/7SM2
  1220. # var var SLT-A58/A99V, HV, ILCA-77M2
  1221. # only valid when first byte 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x17, 0x19 (enciphered 0x8a, 0x70, 0xb6, 0x69, 0x88, 0x20, 0x30, 0xd7, 0xbb)
  1222. Condition => '$$self{DoubleCipher} ? $$valPt =~ /^[\x7e\x46\x1d\x18\x3a\x95\x24\x26\xd6]\x01/ : $$valPt =~ /^[\x8a\x70\xb6\x69\x88\x20\x30\xd7\xbb]\x01/',
  1223. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9402' },
  1224. },{
  1225. Name => 'Sony_0x9402',
  1226. %unknownCipherData,
  1227. }],
  1228. 0x9403 => {
  1229. Name => 'Tag9403',
  1230. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9403' },
  1231. },
  1232. # 0x9404 first 5 bytes (deciphered):
  1233. # 4 0 163 1 2 SLT-A65V/A77V, NEX-5N/7, Lunar, DSC-HX7V/HX9V/HX100V/TX10/TX20/TX55/TX100/TX100V/WX9/WX10/WX30...
  1234. # 5 0 172 1 2 DSC-HX10V/HX200V/HX20V/HX30V/TX66/TX200V/TX300V/WX50/WX70/WX100/WX150...
  1235. # 9 0 38 2 2 SLT-A37/A57/A99V, NEX-5R/5T/6/F3/VG30E/VG900, DSC-RX1/RX1R/RX100, Stellar
  1236. # 12 0 8 2 2 SLT-A58, NEX-3N, ILCE-3000/3500, DSC-HX300/HX50V/WX60/WX80/WX300/TX30...
  1237. # 13 0 9 2 2 DSC-QX10/QX100/RX100M2
  1238. # 15 0 35 2 2 ILCA-77M2, ILCE-5000/5100/6000/7/7R/7S/7M2/QX1, DSC-HX400V/HX60V/QX30/RX10/RX100M3/WX220/WX350
  1239. # 16 0 85 2 2 DSC-HX90V/WX500
  1240. # 17 0 232 1 2 DSC-RX1RM2/RX10M2/RX100M4, ILCE-7RM2/7SM2
  1241. # other values for Panorama images and several other models
  1242. 0x9404 => [{
  1243. Name => 'Tag9404a',
  1244. # first byte must be 4 or 5 and 4th byte must be 1 (deciphered)
  1245. Condition => '$$valPt =~ /^[\x40\x7d]..\x01/',
  1246. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9404a' },
  1247. },{
  1248. Name => 'Tag9404b',
  1249. # first byte must be 9 or 12 or 13 or 15 or 16 and 4th byte must be 2 (deciphered)
  1250. Condition => '$$valPt =~ /^[\xe7\xea\xcd\x8a\x70]..\x08/',
  1251. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9404b' },
  1252. },{
  1253. Name => 'Sony_0x9404',
  1254. %unknownCipherData,
  1255. }],
  1256. # 0x9405 first 2 bytes:
  1257. # 0 0 (0x00 = 0 0 enc.) DSC-H90
  1258. # 2 0 (0x08 = 8 0 enc.) DSC and HDR of HX9V generation
  1259. # 3 0 (0x1b = 27 0 enc.) SLT, NEX, ILCE-3000/3500, DSC-RX100/RX1 + other DSC of same generation, also QX10 and QX100
  1260. # 4 0 (0x40 = 64 0 enc.) DSC-RX1R
  1261. # 5 0 (0x7d = 125 0 enc.) DSC-RX100M2
  1262. # 136 var (0x3a = 58 var enc.) ILCE-7/7R/5000/6000, DSC-HX400V/HX60V/RX10/WX220/WX350
  1263. # 137 var (0xb3 = 179 var enc.) ILCA-77M2, DSC-RX100M3 - appears to go with 136
  1264. # 138 var (0x7e = 126 var enc.) ILCE-7S/5100/QX1, DSC-QX30 - appears to go with 136
  1265. # 139 var (0x9a = 154 var enc.) ILCE-7M2
  1266. # 142 var (0x25 = 37 var enc.) DSC-HX90V/RX1RM2/RX10M2/RX100M4/WX500, ILCE-7RM2/7SM2
  1267. 0x9405 => [{
  1268. Name => 'Tag9405a',
  1269. # first byte must be 0x1b or 0x40 or 0x7d
  1270. Condition => '$$valPt =~ /^[\x1b\x40\x7d]/',
  1271. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9405a' },
  1272. },{
  1273. Name => 'Tag9405b',
  1274. # first byte must be 0x3a, 0xb3, 0x7e, 0x9a or 0x25
  1275. Condition => '$$valPt =~ /^[\x3a\xb3\x7e\x9a\x25]/',
  1276. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9405b' },
  1277. },{
  1278. Name => 'Sony_0x9405',
  1279. %unknownCipherData,
  1280. }],
  1281. 0x9406 => [{
  1282. Name => 'Tag9406',
  1283. # - first byte must be 0x01 or 0x02 (enciphered 0x01 or 0x08), or 0x03 (enc. 0x1b) for ILCE-7RM2/7SM2, and
  1284. # third byte must be 0x02 or 0x03 (enciphered 0x08 or 0x1b) - ref JR
  1285. # (applies to most SLT and NEX models, but no DSC models)
  1286. Condition => '$$valPt =~ /^[\x01\x08\x1b].[\x08\x1b]/s',
  1287. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag9406' },
  1288. },{
  1289. Name => 'Sony_0x9406',
  1290. %unknownCipherData,
  1291. }],
  1292. 0x9407 => {
  1293. Name => 'Sony_0x9407',
  1294. %unknownCipherData,
  1295. },
  1296. 0x9408 => {
  1297. Name => 'Sony_0x9408',
  1298. %unknownCipherData,
  1299. },
  1300. 0x9409 => {
  1301. Name => 'Sony_0x9409',
  1302. %unknownCipherData,
  1303. },
  1304. 0x940a => [{
  1305. Name => 'Tag940a',
  1306. Condition => '$$self{Model} =~ /^(SLT-|HV)/', # but appears not valid for ILCA-77M2 ...
  1307. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag940a' },
  1308. },{
  1309. Name => 'Sony_0x940a',
  1310. %unknownCipherData,
  1311. }],
  1312. 0x940b => {
  1313. Name => 'Sony_0x940b',
  1314. %unknownCipherData,
  1315. },
  1316. 0x940c => [{
  1317. Name => 'Tag940c',
  1318. Condition => '$$self{Model} =~ /^(NEX-|ILCE-|Lunar)\b/',
  1319. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag940c' },
  1320. },{
  1321. Name => 'Sony_0x940c',
  1322. %unknownCipherData,
  1323. }],
  1324. 0x940d => {
  1325. Name => 'Sony_0x940d',
  1326. %unknownCipherData,
  1327. },
  1328. # 0x940e: 2nd byte = 0: no AFInfo, default for NEX/ILCE
  1329. # 2nd byte = 1: AFInfo for SLT/ILCA models (but also seen 1 for DSC-HX20W/HX300/WX70 ...)
  1330. # 2nd byte = 2: AFInfo for NEX/ILCE with LA-EA2/EA4 Phase-detect AF Adapter
  1331. 0x940e => [{
  1332. Name => 'AFInfo',
  1333. Condition => '$$self{Model} =~ /^(SLT-|HV|ILCA-77M2)/',
  1334. SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFInfo' },
  1335. },{
  1336. Name => 'Tag940e',
  1337. Condition => '$$self{Model} =~ /^(NEX-|ILCE-|Lunar)/',
  1338. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Tag940e' },
  1339. },{
  1340. Name => 'Sony_0x940e',
  1341. %unknownCipherData,
  1342. }],
  1343. 0x940f => {
  1344. Name => 'Sony_0x940f',
  1345. %unknownCipherData,
  1346. },
  1347. 0x9411 => {
  1348. Name => 'Sony_0x9411',
  1349. %unknownCipherData,
  1350. # 0x02 - int32u?: 1,3,5,7,9 (A77)
  1351. },
  1352. 0xb000 => { #8
  1353. Name => 'FileFormat',
  1354. Writable => 'int8u',
  1355. Count => 4,
  1356. # dynamically set the file type to SR2 because we could have assumed ARW up till now
  1357. RawConv => q{
  1358. $self->OverrideFileType($$self{TIFF_TYPE} = 'SR2') if $val eq '1 0 0 0';
  1359. return $val;
  1360. },
  1361. PrintConvColumns => 2,
  1362. PrintConv => {
  1363. '0 0 0 2' => 'JPEG',
  1364. '1 0 0 0' => 'SR2',
  1365. '2 0 0 0' => 'ARW 1.0',
  1366. '3 0 0 0' => 'ARW 2.0',
  1367. '3 1 0 0' => 'ARW 2.1',
  1368. '3 2 0 0' => 'ARW 2.2', #PH (NEX-5)
  1369. '3 3 0 0' => 'ARW 2.3', #PH (SLT-A65,SLT-A77)
  1370. '3 3 1 0' => 'ARW 2.3.1', #PH/JR (DSC-RX1R/RX100M2)
  1371. '3 3 2 0' => 'ARW 2.3.2', #JR (DSC-RX1RM2,ILCE-7SM2 - support for uncompressed 14-bit RAW)
  1372. # what about cRAW images?
  1373. },
  1374. },
  1375. 0xb001 => { # ref http://forums.dpreview.com/forums/read.asp?forum=1037&message=33609644
  1376. # (ARW and SR2 images only until the SLT-A65V started writing them to JPEG too)
  1377. Name => 'SonyModelID',
  1378. Writable => 'int16u',
  1379. PrintConvColumns => 2,
  1380. PrintConv => {
  1381. 2 => 'DSC-R1',
  1382. 256 => 'DSLR-A100',
  1383. 257 => 'DSLR-A900',
  1384. 258 => 'DSLR-A700',
  1385. 259 => 'DSLR-A200',
  1386. 260 => 'DSLR-A350',
  1387. 261 => 'DSLR-A300',
  1388. 262 => 'DSLR-A900 (APS-C mode)', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3994.0.html
  1389. 263 => 'DSLR-A380/A390', #PH (A390)
  1390. 264 => 'DSLR-A330',
  1391. 265 => 'DSLR-A230',
  1392. 266 => 'DSLR-A290', #PH
  1393. 269 => 'DSLR-A850',
  1394. 270 => 'DSLR-A850 (APS-C mode)', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3994.0.html
  1395. 273 => 'DSLR-A550',
  1396. 274 => 'DSLR-A500', #PH
  1397. 275 => 'DSLR-A450', #http://dev.exiv2.org/issues/show/0000611
  1398. 278 => 'NEX-5', #PH
  1399. 279 => 'NEX-3', #PH
  1400. 280 => 'SLT-A33', #PH
  1401. 281 => 'SLT-A55 / SLT-A55V', #PH (A55 NC)
  1402. 282 => 'DSLR-A560', #PH
  1403. 283 => 'DSLR-A580', #http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,2881.0.html
  1404. 284 => 'NEX-C3', #PH
  1405. 285 => 'SLT-A35', #JR
  1406. 286 => 'SLT-A65 / SLT-A65V', #PH
  1407. 287 => 'SLT-A77 / SLT-A77V', #PH
  1408. 288 => 'NEX-5N', #PH
  1409. 289 => 'NEX-7', #PH (also Hasselblad Lunar, ref JR)
  1410. 290 => 'NEX-VG20E', #JR
  1411. 291 => 'SLT-A37', #JR
  1412. 292 => 'SLT-A57', #JR
  1413. 293 => 'NEX-F3', #PH
  1414. 294 => 'SLT-A99 / SLT-A99V', #JR (also Hasselblad HV)
  1415. 295 => 'NEX-6', #JR
  1416. 296 => 'NEX-5R', #JR
  1417. 297 => 'DSC-RX100', #PH (also Hasselblad Stellar, ref JR)
  1418. 298 => 'DSC-RX1', #JR
  1419. 299 => 'NEX-VG900', #JR
  1420. 300 => 'NEX-VG30E', #JR
  1421. 302 => 'ILCE-3000 / ILCE-3500', #JR
  1422. 303 => 'SLT-A58', #JR
  1423. 305 => 'NEX-3N', #PH
  1424. 306 => 'ILCE-7', #JR
  1425. 307 => 'NEX-5T', #JR
  1426. 308 => 'DSC-RX100M2', #JR
  1427. 309 => 'DSC-RX10', #JR
  1428. 310 => 'DSC-RX1R', #JR
  1429. 311 => 'ILCE-7R', #JR
  1430. 312 => 'ILCE-6000', #JR
  1431. 313 => 'ILCE-5000', #JR
  1432. 317 => 'DSC-RX100M3', #JR
  1433. 318 => 'ILCE-7S', #JR
  1434. 319 => 'ILCA-77M2', #14
  1435. 339 => 'ILCE-5100', #JR
  1436. 340 => 'ILCE-7M2', #JR
  1437. 341 => 'DSC-RX100M4', #PH
  1438. 342 => 'DSC-RX10M2', #JR
  1439. 344 => 'DSC-RX1RM2', #JR
  1440. 346 => 'ILCE-QX1', #14
  1441. 347 => 'ILCE-7RM2', #JR
  1442. 350 => 'ILCE-7SM2', #JR
  1443. },
  1444. },
  1445. 0xb020 => { #2
  1446. Name => 'CreativeStyle',
  1447. Writable => 'string',
  1448. # (all of these values have been observed, ref JR and PH)
  1449. # - this PrintConv is included to make these strings consistent with
  1450. # other CreativeStyle tags, and to facilitate the language translations
  1451. # - these values are always English, regardless of the camera language settings
  1452. PrintConv => {
  1453. OTHER => sub { shift }, # pass other values straight through
  1454. None => 'None',
  1455. AdobeRGB => 'Adobe RGB',
  1456. Real => 'Real',
  1457. Standard => 'Standard',
  1458. Vivid => 'Vivid',
  1459. Portrait => 'Portrait',
  1460. Landscape => 'Landscape',
  1461. Sunset => 'Sunset',
  1462. Nightview => 'Night View/Portrait',
  1463. BW => 'B&W',
  1464. Neutral => 'Neutral',
  1465. Clear => 'Clear',
  1466. Deep => 'Deep',
  1467. Light => 'Light',
  1468. Autumnleaves=> 'Autumn Leaves',
  1469. Sepia => 'Sepia',
  1470. },
  1471. },
  1472. 0xb021 => { #2
  1473. Name => 'ColorTemperature',
  1474. Writable => 'int32u',
  1475. PrintConv => '$val ? ($val==0xffffffff ? "n/a" : $val) : "Auto"',
  1476. PrintConvInv => '$val=~/Auto/i ? 0 : ($val eq "n/a" ? 0xffffffff : $val)',
  1477. },
  1478. 0xb022 => { #7
  1479. Name => 'ColorCompensationFilter',
  1480. Format => 'int32s',
  1481. Writable => 'int32u', # (written incorrectly as unsigned by Sony)
  1482. Notes => 'negative is green, positive is magenta',
  1483. },
  1484. 0xb023 => { #PH (A100) - (set by mode dial)
  1485. Name => 'SceneMode',
  1486. Writable => 'int32u',
  1487. PrintConvColumns => 2,
  1488. PrintConv => \%Image::ExifTool::Minolta::minoltaSceneMode,
  1489. },
  1490. 0xb024 => { #PH (A100)
  1491. Name => 'ZoneMatching',
  1492. Writable => 'int32u',
  1493. PrintConv => {
  1494. 0 => 'ISO Setting Used',
  1495. 1 => 'High Key',
  1496. 2 => 'Low Key',
  1497. },
  1498. },
  1499. 0xb025 => { #PH (A100)
  1500. Name => 'DynamicRangeOptimizer',
  1501. Writable => 'int32u',
  1502. PrintConvColumns => 2,
  1503. PrintConv => {
  1504. 0 => 'Off',
  1505. 1 => 'Standard',
  1506. 2 => 'Advanced Auto',
  1507. 3 => 'Auto', # (A550)
  1508. 8 => 'Advanced Lv1', #JD
  1509. 9 => 'Advanced Lv2', #JD
  1510. 10 => 'Advanced Lv3', #JD
  1511. 11 => 'Advanced Lv4', #JD
  1512. 12 => 'Advanced Lv5', #JD
  1513. 16 => 'Lv1', # (NEX-5)
  1514. 17 => 'Lv2',
  1515. 18 => 'Lv3',
  1516. 19 => 'Lv4',
  1517. 20 => 'Lv5',
  1518. },
  1519. },
  1520. 0xb026 => { #PH (A100)
  1521. Name => 'ImageStabilization',
  1522. Writable => 'int32u',
  1523. PrintConv => {
  1524. 0 => 'Off',
  1525. 1 => 'On',
  1526. 0xffffffff => 'n/a', # (HX9V sweep panorama, ref JR)
  1527. },
  1528. },
  1529. 0xb027 => { #2
  1530. Name => 'LensType',
  1531. Writable => 'int32u',
  1532. SeparateTable => 1,
  1533. # set to 65535 for E-mount lenses (values 0x80xx)
  1534. ValueConvInv => '($val & 0xff00) == 0x8000 ? 65535 : int($val)',
  1535. PrintConv => \%sonyLensTypes,
  1536. },
  1537. 0xb028 => { #2
  1538. # (used by the DSLR-A100)
  1539. Name => 'MinoltaMakerNote',
  1540. # must check for zero since apparently a value of zero indicates the IFD doesn't exist
  1541. # (dumb Sony -- they shouldn't write this tag if the IFD is missing!)
  1542. Condition => '$$valPt ne "\0\0\0\0"',
  1543. Flags => 'SubIFD',
  1544. SubDirectory => {
  1545. TagTable => 'Image::ExifTool::Minolta::Main',
  1546. Start => '$val',
  1547. },
  1548. },
  1549. 0xb029 => { #2 (set by creative style menu)
  1550. Name => 'ColorMode',
  1551. Writable => 'int32u',
  1552. PrintConvColumns => 2,
  1553. PrintConv => \%Image::ExifTool::Minolta::sonyColorMode,
  1554. },
  1555. 0xb02a => {
  1556. Name => 'LensSpec',
  1557. Format => 'undef',
  1558. Writable => 'int8u',
  1559. Count => 8,
  1560. Notes => q{
  1561. like LensInfo, but also specifies lens features: DT, E, ZA, G, SSM, SAM,
  1562. OSS, STF, Reflex, Macro and Fisheye
  1563. },
  1564. ValueConv => \&ConvLensSpec,
  1565. ValueConvInv => \&ConvInvLensSpec,
  1566. PrintConv => \&PrintLensSpec,
  1567. PrintConvInv => \&PrintInvLensSpec,
  1568. },
  1569. 0xb02b => { #PH (A550 JPEG and A200, A230, A300, A350, A380, A700 and A900 ARW)
  1570. Name => 'FullImageSize',
  1571. Writable => 'int32u',
  1572. Count => 2,
  1573. # values stored height first, so swap to get "width height"
  1574. ValueConv => 'join(" ", reverse split(" ", $val))',
  1575. ValueConvInv => 'join(" ", reverse split(" ", $val))',
  1576. PrintConv => '$val =~ tr/ /x/; $val',
  1577. PrintConvInv => '$val =~ tr/x/ /; $val',
  1578. },
  1579. 0xb02c => { #PH (A550 JPEG and A200, A230, A300, A350, A380, A700 and A900 ARW)
  1580. Name => 'PreviewImageSize',
  1581. Writable => 'int32u',
  1582. Count => 2,
  1583. ValueConv => 'join(" ", reverse split(" ", $val))',
  1584. ValueConvInv => 'join(" ", reverse split(" ", $val))',
  1585. PrintConv => '$val =~ tr/ /x/; $val',
  1586. PrintConvInv => '$val =~ tr/x/ /; $val',
  1587. },
  1588. 0xb040 => { #2
  1589. Name => 'Macro',
  1590. Writable => 'int16u',
  1591. RawConv => '$val == 65535 ? undef : $val',
  1592. PrintConv => {
  1593. 0 => 'Off',
  1594. 1 => 'On',
  1595. 2 => 'Close Focus', #9
  1596. 65535 => 'n/a', #PH (A100)
  1597. },
  1598. },
  1599. 0xb041 => { #2
  1600. Name => 'ExposureMode',
  1601. Writable => 'int16u',
  1602. RawConv => '$val == 65535 ? undef : $val',
  1603. PrintConvColumns => 2,
  1604. PrintConv => {
  1605. 0 => 'Program AE', # (RX100 'Program','Sunset' - PH)
  1606. 1 => 'Portrait', #PH (HX1)
  1607. 2 => 'Beach', #9
  1608. 3 => 'Sports', #9
  1609. 4 => 'Snow', #9
  1610. 5 => 'Landscape',
  1611. 6 => 'Auto', # (RX100 'Intelligent Auto' - PH)
  1612. 7 => 'Aperture-priority AE',
  1613. 8 => 'Shutter speed priority AE',
  1614. 9 => 'Night Scene / Twilight',#2/9
  1615. 10 => 'Hi-Speed Shutter', #9
  1616. 11 => 'Twilight Portrait', #9 (RX100 'Night Portrait' - PH)
  1617. 12 => 'Soft Snap/Portrait', #9 (TX7 'Soft Snap'; RX100/A37 'Portrait' but manuals say "reproduces soft skin tone" - PH)
  1618. 13 => 'Fireworks', #9
  1619. 14 => 'Smile Shutter', #9 (T200)
  1620. 15 => 'Manual',
  1621. 18 => 'High Sensitivity', #9
  1622. 19 => 'Macro', #JR
  1623. 20 => 'Advanced Sports Shooting', #9
  1624. 29 => 'Underwater', #9
  1625. # 30 seen for DSC-W110 and W390, maybe something with Face or Portrait ??
  1626. 33 => 'Food', #9
  1627. 34 => 'Sweep Panorama', #PH (HX1)
  1628. 35 => 'Handheld Night Shot', #PH (HX1/TX1, also called "Hand-held Twilight")
  1629. 36 => 'Anti Motion Blur', #PH (TX1)
  1630. 37 => 'Pet', #9
  1631. 38 => 'Backlight Correction HDR', #9
  1632. 39 => 'Superior Auto', #9
  1633. 40 => 'Background Defocus', #PH (HX20V)
  1634. 41 => 'Soft Skin', #JR (HX9V) (HX200V Portrait - PH)
  1635. 42 => '3D Image', #JR (HX9V)
  1636. # 50 seen for DSC-W530
  1637. 65535 => 'n/a', #PH (A100)
  1638. },
  1639. },
  1640. 0xb042 => { #9
  1641. Name => 'FocusMode',
  1642. # Only FocusMode for older DSC models;
  1643. # Newest DSC models give only 0, many models of 'HX9V generation' give only 4 -
  1644. # these models give FocusMode in tag 0xb04e, and are excluded here.
  1645. Condition => q{
  1646. ($$self{TagB042} = Get16u($valPt, 0)) and
  1647. (not $$self{MetaVersion} or $$self{MetaVersion} ne 'DC7303320222000')
  1648. },
  1649. Notes => 'not valid for all models',
  1650. Writable => 'int16u',
  1651. RawConv => '$val == 65535 ? undef : $val',
  1652. PrintConv => {
  1653. # 0 - seen this for panorama shot
  1654. 1 => 'AF-S', # (called Single-AF by Sony)
  1655. 2 => 'AF-C', # (called Monitor-AF by Sony)
  1656. 4 => 'Permanent-AF', # (TX7,HX9V?)
  1657. 65535 => 'n/a', #PH (A100), also for DSC-W690 panorama shots
  1658. },
  1659. },
  1660. 0xb043 => [{ #9
  1661. Name => 'AFAreaMode',
  1662. # AFAreaMode only for older models;
  1663. # exclude newest DSC models, which give AFAreaMode in Tag9402 0x0017 (eg. RX100 - PH)
  1664. Writable => 'int16u',
  1665. Condition => 'not $$self{MetaVersion} or $$self{MetaVersion} ne "DC7303320222000"', #JR
  1666. RawConv => '$val == 65535 ? undef : $val',
  1667. Notes => 'older models',
  1668. PrintConv => {
  1669. # 0 - (takes this value after camera reset, but can't be set back once changed)
  1670. 0 => 'Default',
  1671. 1 => 'Multi',
  1672. 2 => 'Center',
  1673. 3 => 'Spot',
  1674. 4 => 'Flexible Spot', # (T200)
  1675. 6 => 'Touch',
  1676. 14 => 'Tracking', #JR (HX9V) ("Manual" for the T200?, ref 9)
  1677. 15 => 'Face Tracking', # (not set when in face detect mode and no faces detected)
  1678. 65535 => 'n/a', #PH (A100)
  1679. },
  1680. },{ #JR
  1681. Name => 'AFAreaMode',
  1682. # AFAreaMode for DSC-HX9V generation, having values that appear to be different from older models.
  1683. Writable => 'int16u',
  1684. Condition => '$$self{TagB042} and $$self{TagB042} != 0',
  1685. Notes => 'DSC-HX9V generation cameras',
  1686. PrintConv => {
  1687. 0 => 'Multi',
  1688. 1 => 'Center',
  1689. 2 => 'Spot', # (NC) seen for DSC-WX9
  1690. 3 => 'Flexible Spot',
  1691. 10 => 'Selective (for Miniature effect)', # seen for Miniature effect of DSC-WX30
  1692. 14 => 'Tracking',
  1693. 15 => 'Face Tracking',
  1694. 255 => 'Manual',
  1695. },
  1696. }],
  1697. 0xb044 => { #9
  1698. Name => 'AFIlluminator',
  1699. Writable => 'int16u',
  1700. RawConv => '$val == 65535 ? undef : $val',
  1701. PrintConv => {
  1702. 0 => 'Off',
  1703. 1 => 'Auto',
  1704. 65535 => 'n/a', #PH (A100)
  1705. },
  1706. },
  1707. # 0xb045 - int16u: 0
  1708. # 0xb046 - int16u: 0
  1709. 0xb047 => { #2
  1710. Name => 'JPEGQuality',
  1711. Writable => 'int16u',
  1712. RawConv => '$val == 65535 ? undef : $val',
  1713. PrintConv => {
  1714. 0 => 'Standard',
  1715. 1 => 'Fine',
  1716. 2 => 'Extra Fine', #JR
  1717. 65535 => 'n/a', #PH (A100)
  1718. },
  1719. },
  1720. 0xb048 => { #9
  1721. Name => 'FlashLevel', #JR other name, but values -9 to 9 match FlashExposureCompensation
  1722. Writable => 'int16s',
  1723. RawConv => '($val == -1 and $$self{Model} =~ /DSLR-A100\b/) ? undef : $val',
  1724. PrintConv => {
  1725. -32768 => 'Low',
  1726. -9 => '-9/3', #JR
  1727. -6 => '-6/3', #JR
  1728. -5 => '-5/3', #JR
  1729. -4 => '-4/3', #JR
  1730. -3 => '-3/3',
  1731. -2 => '-2/3',
  1732. -1 => '-1/3', # (for the A100, -1 is effectively 'n/a' - PH)
  1733. 0 => 'Normal',
  1734. 1 => '+1/3',
  1735. 2 => '+2/3',
  1736. 3 => '+3/3',
  1737. 4 => '+4/3', #JR (NC)
  1738. 5 => '+5/3', #JR (NC)
  1739. 6 => '+6/3', #JR
  1740. 128 => 'n/a', #JR (HX9V)
  1741. 32767 => 'High',
  1742. },
  1743. },
  1744. 0xb049 => { #9
  1745. Name => 'ReleaseMode',
  1746. Writable => 'int16u',
  1747. RawConv => '$val == 65535 ? undef : $val',
  1748. PrintConv => {
  1749. 0 => 'Normal', # (ie. shutter button)
  1750. 2 => 'Continuous',
  1751. 5 => 'Exposure Bracketing',
  1752. 6 => 'White Balance Bracketing', # (HX5)
  1753. 65535 => 'n/a', #PH (A100)
  1754. },
  1755. },
  1756. 0xb04a => { #9
  1757. Name => 'SequenceNumber',
  1758. Notes => 'shot number in continuous burst',
  1759. Writable => 'int16u',
  1760. RawConv => '$val == 65535 ? undef : $val',
  1761. PrintConv => {
  1762. 0 => 'Single',
  1763. 65535 => 'n/a', #PH (A100)
  1764. OTHER => sub { shift }, # pass all other numbers straight through
  1765. },
  1766. },
  1767. 0xb04b => { #2/PH
  1768. Name => 'Anti-Blur',
  1769. Writable => 'int16u',
  1770. RawConv => '$val == 65535 ? undef : $val',
  1771. PrintConv => {
  1772. 0 => 'Off',
  1773. 1 => 'On (Continuous)', #PH (NC)
  1774. 2 => 'On (Shooting)', #PH (NC)
  1775. 65535 => 'n/a',
  1776. },
  1777. },
  1778. # 0xb04c - rational64u: 10/10 (seen 5 for HX9V Manual-exposure images, ref JR)
  1779. # 0xb04d - int16u: 0
  1780. # (the Kamisaka decoding of 0xb04e seems wrong - ref JR)
  1781. # 0xb04e => { #2
  1782. # Name => 'LongExposureNoiseReduction',
  1783. # Notes => 'LongExposureNoiseReduction for other models',
  1784. # Writable => 'int16u',
  1785. # RawConv => '$val == 65535 ? undef : $val',
  1786. # PrintConv => {
  1787. # 0 => 'Off',
  1788. # 1 => 'On',
  1789. # 2 => 'On 2', #PH (TX10, TX100, WX9, WX10, etc)
  1790. # # 4 - seen this (CX360E, CX700E)
  1791. # 65535 => 'n/a', #PH (A100)
  1792. # },
  1793. # },
  1794. 0xb04e => { #PH (RX100) - but not in RX100M3 anymore (ref JR)
  1795. Name => 'FocusMode',
  1796. Condition => '$$self{MetaVersion} and $$self{MetaVersion} eq "DC7303320222000"', #JR
  1797. Notes => 'valid for DSC-HX9V generation and newer',
  1798. Writable => 'int16u',
  1799. PrintConv => {
  1800. 0 => 'Manual',
  1801. # 1 - seen for DSC-WX7 burst, HDR-CX130E/CX560E
  1802. 2 => 'AF-S',
  1803. 3 => 'AF-C',
  1804. # 4 - seen for HDR-CX360E/CX700E
  1805. 5 => 'Semi-manual', #JR (HX9V)
  1806. 6 => 'DMF', # "Direct Manual Focus"
  1807. },
  1808. },
  1809. 0xb04f => { #PH (TX1)
  1810. Name => 'DynamicRangeOptimizer',
  1811. Writable => 'int16u',
  1812. Priority => 0, # (unreliable for the A77)
  1813. PrintConv => {
  1814. 0 => 'Off',
  1815. 1 => 'Standard',
  1816. 2 => 'Plus',
  1817. # 8 for HDR models - what does this mean?
  1818. },
  1819. },
  1820. 0xb050 => { #PH (RX100)
  1821. Name => 'HighISONoiseReduction2',
  1822. Condition => '$$self{Model} =~ /^(DSC-|Stellar)/',
  1823. Notes => 'DSC models only',
  1824. Writable => 'int16u',
  1825. PrintConv => {
  1826. 0 => 'Normal',
  1827. 1 => 'High',
  1828. 2 => 'Low',
  1829. 3 => 'Off', #JR
  1830. # it seems that all SLT and NEX models give n/a here (ref JR)
  1831. 65535 => 'n/a',
  1832. },
  1833. },
  1834. # 0xb051 - int16u: 0
  1835. 0xb052 => { #PH (TX1)
  1836. Name => 'IntelligentAuto',
  1837. Writable => 'int16u',
  1838. PrintConv => {
  1839. 0 => 'Off',
  1840. 1 => 'On',
  1841. 2 => 'Advanced', #9
  1842. },
  1843. },
  1844. # 0xb053 - int16u: normally 0, but got 1 for a superior auto backlight picture (RX100)
  1845. 0xb054 => { #PH/9/JR (TX1,TX7,RX100,HX9V)
  1846. Name => 'WhiteBalance',
  1847. Writable => 'int16u',
  1848. Notes => q{
  1849. decoding of the Fluorescent settings matches the EXIF standard, which is
  1850. different than the names used by Sony for some models
  1851. },
  1852. PrintConv => {
  1853. 0 => 'Auto',
  1854. 4 => 'Custom', # (manual)
  1855. 5 => 'Daylight',
  1856. 6 => 'Cloudy',
  1857. # PrintConv names matching Exif Fluorescent LightSource names (ref JR)
  1858. # (Sony uses conflicting names for some models)
  1859. 7 => 'Cool White Fluorescent', # (RX100) (TX7/HX9V "Fluorescent 1 (White)", ref 9/JR)
  1860. 8 => 'Day White Fluorescent', # (RX100) (TX7/HX9V "Fluorescent 2 (Natural White)", ref 9/JR)
  1861. 9 => 'Daylight Fluorescent', # (RX100) (TX7/HX9V "Fluorescent 3 (Day White)", ref 9/JR)
  1862. 10 => 'Incandescent2', #JR (HX9V)
  1863. 11 => 'Warm White Fluorescent',
  1864. 14 => 'Incandescent',
  1865. 15 => 'Flash',
  1866. 17 => 'Underwater 1 (Blue Water)', #9
  1867. 18 => 'Underwater 2 (Green Water)', #9
  1868. 19 => 'Underwater Auto', #JR
  1869. },
  1870. },
  1871. );
  1872. # "SEMC MS" maker notes
  1873. %Image::ExifTool::Sony::Ericsson = (
  1874. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  1875. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  1876. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  1877. NOTES => 'Maker notes found in images from some Sony Ericsson phones.',
  1878. 0x2000 => {
  1879. Name => 'MakerNoteVersion',
  1880. Writable => 'undef',
  1881. Count => 4,
  1882. },
  1883. 0x201 => {
  1884. Name => 'PreviewImageStart',
  1885. IsOffset => 1,
  1886. MakerPreview => 1, # force preview inside maker notes
  1887. OffsetPair => 0x202,
  1888. DataTag => 'PreviewImage',
  1889. Writable => 'int32u',
  1890. Protected => 2,
  1891. Notes => 'a small 320x200 preview image',
  1892. },
  1893. 0x202 => {
  1894. Name => 'PreviewImageLength',
  1895. OffsetPair => 0x201,
  1896. DataTag => 'PreviewImage',
  1897. Writable => 'int32u',
  1898. Protected => 2,
  1899. },
  1900. );
  1901. # camera information for the A700/A850/A900 (ref JR)
  1902. %Image::ExifTool::Sony::CameraInfo = (
  1903. %binaryDataAttrs,
  1904. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  1905. NOTES => 'Camera information for the A700, A850 and A900.',
  1906. 0x00 => {
  1907. Name => 'LensSpec',
  1908. # the A700/A850/A900 use a different int16 byte ordering! - PH
  1909. Format => 'undef[8]',
  1910. ValueConv => sub {
  1911. my $val = shift;;
  1912. return ConvLensSpec(pack('v*', unpack('n*', $val)));
  1913. },
  1914. ValueConvInv => sub {
  1915. my $val = shift;
  1916. return pack('v*', unpack('n*', ConvInvLensSpec($val)));
  1917. },
  1918. PrintConv => \&PrintLensSpec,
  1919. PrintConvInv => \&PrintInvLensSpec,
  1920. },
  1921. 0x0014 => {
  1922. Name => 'FocusModeSetting',
  1923. Notes => 'FocusModeSetting for the A700, A850 and A900',
  1924. PrintConv => {
  1925. 0 => 'Manual',
  1926. 1 => 'AF-S',
  1927. 2 => 'AF-C',
  1928. 3 => 'AF-A',
  1929. 4 => 'DMF',
  1930. },
  1931. },
  1932. 0x0015 => { # the AF Point selected in AFAreaMode=Local or Spot; always '0' for AFAreaMode=Wide
  1933. Name => 'AFPointSelected',
  1934. PrintConvColumns => 2,
  1935. PrintConv => {
  1936. 0 => 'Auto',
  1937. 1 => 'Center',
  1938. 2 => 'Top',
  1939. 3 => 'Upper-right',
  1940. 4 => 'Right',
  1941. 5 => 'Lower-right',
  1942. 6 => 'Bottom',
  1943. 7 => 'Lower-left',
  1944. 8 => 'Left',
  1945. 9 => 'Upper-left',
  1946. 10 => 'Far Right', # only given by A700
  1947. 11 => 'Far Left', # only given by A700
  1948. },
  1949. },
  1950. # 0x0019 - AF sensor used for focusing for A700/A850/A900:
  1951. #
  1952. # A700 AF sensor layout: A850/A900 AF sensor layout:
  1953. #
  1954. # - *-* - = AF sensor
  1955. # | | | | * = assist sensor
  1956. # - *-* o = F2.8 sensor
  1957. # | | |o| | | | * |o| * | A700 center: double-cross + F2.8
  1958. # - *-* A850 center: double-cross + F2.8 + 4 assist
  1959. # | | | |
  1960. # - *-*
  1961. #
  1962. # Following values seen for A700/A850 in AFAreaMode=Local or Spot: (other values only seen in "Wide")
  1963. #
  1964. # 16
  1965. # 0 19
  1966. # 13
  1967. # 3 1 22 20 18
  1968. # 8
  1969. # 2 21
  1970. # 5
  1971. #
  1972. # Note 1: A850/A900 AFPoint Selected 'Left'/'Right' (in 0x0015) corresponds in position (see diagram)
  1973. # to A700 Local AFPoint 'Far Left'/'Far Right', and gives 'Far Left'/'Far Right' in 0x0019.
  1974. # Note 2: A700 in "Wide" also gives all 23 values in 0x0019, although it doesn't have assist-points ...
  1975. 0x0019 => { # the AF sensor used for focusing
  1976. Name => 'AFPoint',
  1977. PrintConv => {
  1978. 0 => 'Upper-left',
  1979. 1 => 'Left',
  1980. 2 => 'Lower-left',
  1981. 3 => 'Far Left',
  1982. 4 => 'Bottom Assist-left', #NC
  1983. 5 => 'Bottom',
  1984. 6 => 'Bottom Assist-right', #NC
  1985. # values 7-14: 8 center points: 4 from double-cross + 4 assist; 7-10 appear horizontal, 11-14 vertical
  1986. 7 => 'Center (7)', #NC
  1987. 8 => 'Center (horizontal)',
  1988. 9 => 'Center (9)', #NC
  1989. 10 => 'Center (10)', #NC
  1990. 11 => 'Center (11)', #NC
  1991. 12 => 'Center (12)', #NC
  1992. 13 => 'Center (vertical)',
  1993. 14 => 'Center (14)', #NC
  1994. 15 => 'Top Assist-left', #NC
  1995. 16 => 'Top',
  1996. 17 => 'Top Assist-right', #NC
  1997. 18 => 'Far Right',
  1998. 19 => 'Upper-right',
  1999. 20 => 'Right',
  2000. 21 => 'Lower-right',
  2001. 22 => 'Center F2.8',
  2002. },
  2003. },
  2004. # AF Status for A700/A850/A900, which have different sensor layout
  2005. # and different int16 byte ordering
  2006. 0x001e => { Name => 'AFStatusActiveSensor', %Image::ExifTool::Minolta::afStatusInfo },
  2007. 0x0020 => { Name => 'AFStatusUpper-left', %Image::ExifTool::Minolta::afStatusInfo },
  2008. 0x0022 => { Name => 'AFStatusLeft', %Image::ExifTool::Minolta::afStatusInfo },
  2009. 0x0024 => { Name => 'AFStatusLower-left', %Image::ExifTool::Minolta::afStatusInfo },
  2010. 0x0026 => { Name => 'AFStatusFarLeft', %Image::ExifTool::Minolta::afStatusInfo },
  2011. 0x0028 => { Name => 'AFStatusBottomAssist-left', %Image::ExifTool::Minolta::afStatusInfo },
  2012. 0x002a => { Name => 'AFStatusBottom', %Image::ExifTool::Minolta::afStatusInfo },
  2013. 0x002c => { Name => 'AFStatusBottomAssist-right', %Image::ExifTool::Minolta::afStatusInfo },
  2014. 0x002e => { Name => 'AFStatusCenter-7', %Image::ExifTool::Minolta::afStatusInfo },
  2015. 0x0030 => { Name => 'AFStatusCenter-horizontal', %Image::ExifTool::Minolta::afStatusInfo },
  2016. 0x0032 => { Name => 'AFStatusCenter-9', %Image::ExifTool::Minolta::afStatusInfo },
  2017. 0x0034 => { Name => 'AFStatusCenter-10', %Image::ExifTool::Minolta::afStatusInfo },
  2018. 0x0036 => { Name => 'AFStatusCenter-11', %Image::ExifTool::Minolta::afStatusInfo },
  2019. 0x0038 => { Name => 'AFStatusCenter-12', %Image::ExifTool::Minolta::afStatusInfo },
  2020. 0x003a => { Name => 'AFStatusCenter-vertical', %Image::ExifTool::Minolta::afStatusInfo },
  2021. 0x003c => { Name => 'AFStatusCenter-14', %Image::ExifTool::Minolta::afStatusInfo },
  2022. 0x003e => { Name => 'AFStatusTopAssist-left', %Image::ExifTool::Minolta::afStatusInfo },
  2023. 0x0040 => { Name => 'AFStatusTop', %Image::ExifTool::Minolta::afStatusInfo },
  2024. 0x0042 => { Name => 'AFStatusTopAssist-right', %Image::ExifTool::Minolta::afStatusInfo },
  2025. 0x0044 => { Name => 'AFStatusFarRight', %Image::ExifTool::Minolta::afStatusInfo },
  2026. 0x0046 => { Name => 'AFStatusUpper-right', %Image::ExifTool::Minolta::afStatusInfo },
  2027. 0x0048 => { Name => 'AFStatusRight', %Image::ExifTool::Minolta::afStatusInfo },
  2028. 0x004a => { Name => 'AFStatusLower-right', %Image::ExifTool::Minolta::afStatusInfo },
  2029. 0x004c => { Name => 'AFStatusCenterF2-8', %Image::ExifTool::Minolta::afStatusInfo },
  2030. 0x0130 => {
  2031. Name => 'AFMicroAdjValue',
  2032. Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
  2033. ValueConv => '$val - 20',
  2034. ValueConvInv => '$val + 20',
  2035. },
  2036. 0x0131 => {
  2037. Name => 'AFMicroAdjMode',
  2038. Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
  2039. Mask => 0x80,
  2040. PrintConv => {
  2041. 0x00 => 'Off',
  2042. 0x80 => 'On',
  2043. },
  2044. },
  2045. 305.1 => { # (0x131)
  2046. Name => 'AFMicroAdjRegisteredLenses',
  2047. Notes => 'number of registered lenses with a non-zero AFMicroAdjValue',
  2048. Condition => '$$self{Model} =~ /^DSLR-A(850|900)\b/',
  2049. Mask => 0x7f,
  2050. },
  2051. # 0x0166 - 40 x 128 int8u values: AF Info Blocks for A850 and A900, not for A700
  2052. );
  2053. # camera information for other DSLR models (ref JR)
  2054. %Image::ExifTool::Sony::CameraInfo2 = (
  2055. %binaryDataAttrs,
  2056. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2057. NOTES => q{
  2058. Camera information for the DSLR-A200, A230, A290, A300, A330, A350, A380 and
  2059. A390.
  2060. },
  2061. 0x00 => {
  2062. Name => 'LensSpec',
  2063. Format => 'undef[8]',
  2064. ValueConv => \&ConvLensSpec,
  2065. ValueConvInv => \&ConvInvLensSpec,
  2066. PrintConv => \&PrintLensSpec,
  2067. PrintConvInv => \&PrintInvLensSpec,
  2068. },
  2069. # 0x0010 - maybe to do with AFStatus: 0 na./Manual, 4 Failed, 16 Tracking, 64 Focused
  2070. 0x0014 => {
  2071. Name => 'AFPointSelected',
  2072. PrintConvColumns => 2,
  2073. PrintConv => { #JR (NC) same list as A100, A700/A900, as all have 9 point AF
  2074. 0 => 'Auto',
  2075. 1 => 'Center',
  2076. 2 => 'Top',
  2077. 3 => 'Upper-right',
  2078. 4 => 'Right',
  2079. 5 => 'Lower-right',
  2080. 6 => 'Bottom',
  2081. 7 => 'Lower-left',
  2082. 8 => 'Left',
  2083. 9 => 'Upper-left',
  2084. },
  2085. },
  2086. 0x0015 => {
  2087. Name => 'FocusModeSetting',
  2088. Notes => 'FocusModeSetting for other models',
  2089. PrintConv => {
  2090. 0 => 'Manual',
  2091. 1 => 'AF-S',
  2092. 2 => 'AF-C',
  2093. 3 => 'AF-A',
  2094. 4 => 'DMF',
  2095. },
  2096. },
  2097. # 0x0018 - AF sensor used for focusing for A200/A230/A290/A300/A330/A350/A380/A390; AF sensor layout:
  2098. #
  2099. # - - = AF sensor
  2100. # | | + = cross sensor
  2101. #
  2102. # - + -
  2103. #
  2104. # | |
  2105. # -
  2106. #
  2107. 0x0018 => { # used A100 list which appears to match
  2108. Name => 'AFPoint',
  2109. PrintConv => {
  2110. 0 => 'Top-right',
  2111. 1 => 'Bottom-right',
  2112. 2 => 'Bottom',
  2113. 3 => 'Middle Horizontal',
  2114. 4 => 'Center Vertical',
  2115. 5 => 'Top',
  2116. 6 => 'Top-left',
  2117. 7 => 'Bottom-left',
  2118. },
  2119. },
  2120. # AF Status for A200/A230/A290/A300/A330/A350/A380/A390: analogous to A100 in Minolta.pm
  2121. 0x001b => { Name => 'AFStatusActiveSensor', %Image::ExifTool::Minolta::afStatusInfo },
  2122. 0x001d => { Name => 'AFStatusTop-right', %Image::ExifTool::Minolta::afStatusInfo },
  2123. 0x001f => { Name => 'AFStatusBottom-right', %Image::ExifTool::Minolta::afStatusInfo },
  2124. 0x0021 => { Name => 'AFStatusBottom', %Image::ExifTool::Minolta::afStatusInfo },
  2125. # MiddleHorizontal is any of the 3 central horizontal sensors
  2126. 0x0023 => { Name => 'AFStatusMiddleHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  2127. 0x0025 => { Name => 'AFStatusCenterVertical', %Image::ExifTool::Minolta::afStatusInfo },
  2128. 0x0027 => { Name => 'AFStatusTop', %Image::ExifTool::Minolta::afStatusInfo },
  2129. 0x0029 => { Name => 'AFStatusTop-left', %Image::ExifTool::Minolta::afStatusInfo },
  2130. 0x002b => { Name => 'AFStatusBottom-left', %Image::ExifTool::Minolta::afStatusInfo },
  2131. # the 3 MiddleHorizontal sensors
  2132. 0x002d => { Name => 'AFStatusLeft', %Image::ExifTool::Minolta::afStatusInfo },
  2133. 0x002f => { Name => 'AFStatusCenterHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  2134. 0x0031 => { Name => 'AFStatusRight', %Image::ExifTool::Minolta::afStatusInfo },
  2135. # 0x0166 - 59 x 96 int8u values: AF Info Blocks for A230/A290/A330/A380/A390
  2136. # 0x0182 - 58 x 88 int8u values: AF Info Blocks for A200/A300/A350
  2137. );
  2138. # Camera information for the A55 (ref PH)
  2139. # (also valid for A33, A35, A560, A580 - ref JR)
  2140. %Image::ExifTool::Sony::CameraInfo3 = (
  2141. %binaryDataAttrs,
  2142. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2143. IS_SUBDIR => [ 0x23 ],
  2144. NOTES => q{
  2145. Camera information stored by the A33, A35, A55, A450, A500, A550, A560,
  2146. A580, NEX-3/5/5C/C3 and VG10E. Some tags are valid only for some of these
  2147. models.
  2148. },
  2149. 0x00 => { #JR
  2150. Name => 'LensSpec',
  2151. Condition => '$$self{Model} !~ /^NEX-5C/',
  2152. Format => 'undef[8]',
  2153. ValueConv => \&ConvLensSpec,
  2154. ValueConvInv => \&ConvInvLensSpec,
  2155. PrintConv => \&PrintLensSpec,
  2156. PrintConvInv => \&PrintInvLensSpec,
  2157. },
  2158. 0x0e => { #JR
  2159. Name => 'FocalLength',
  2160. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  2161. Format => 'int16u',
  2162. Priority => 0,
  2163. ValueConv => '$val / 10',
  2164. ValueConvInv => '$val * 10',
  2165. PrintConv => 'sprintf("%.1f mm",$val)',
  2166. PrintConvInv => '$val =~ s/ mm//; $val',
  2167. },
  2168. 0x10 => { #JR
  2169. Name => 'FocalLengthTeleZoom',
  2170. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  2171. Format => 'int16u',
  2172. ValueConv => '$val * 2 / 3',
  2173. ValueConvInv => 'int($val * 3 / 2 + 0.5)',
  2174. PrintConv => 'sprintf("%.1f mm",$val)',
  2175. PrintConvInv => '$val =~ s/ mm//; $val',
  2176. },
  2177. #
  2178. # Note:
  2179. # The below AF decoding covers cameras with 2 different AF systems, with overlapping offsets !
  2180. # 1) DSLR-A450/A500/A550 with 9 point AF system: decoding/offsets identical to A200 - A390 in CameraInfo
  2181. # 2) SLT-A33/A35/A55 and DSLR-A560/A580 with 15 point AF system: similar/more info but at different offsets
  2182. #
  2183. 0x14 => { #JR
  2184. Name => 'AFPointSelected',
  2185. Condition => '$$self{Model} =~ /^(DSLR-A(450|500|550))\b/',
  2186. # (these cameras have a 9-point AF system, ref JR)
  2187. PrintConvColumns => 2,
  2188. PrintConv => {
  2189. 0 => 'Auto', # (seen in Wide mode and for Manual Focus)
  2190. 1 => 'Center', # seen for AFArea=Spot
  2191. 2 => 'Top',
  2192. 3 => 'Upper-right',
  2193. 4 => 'Right',
  2194. 5 => 'Lower-right',
  2195. 6 => 'Bottom',
  2196. 7 => 'Lower-left',
  2197. 8 => 'Left',
  2198. 9 => 'Upper-left',
  2199. },
  2200. },
  2201. 0x15 => { #JR
  2202. Name => 'FocusMode',
  2203. Condition => '$$self{Model} =~ /^(DSLR-A(450|500|550))\b/',
  2204. PrintConv => {
  2205. 0 => 'Manual',
  2206. 1 => 'AF-S',
  2207. 2 => 'AF-C',
  2208. 3 => 'AF-A',
  2209. },
  2210. },
  2211. 0x18 => { #JR
  2212. Name => 'AFPoint',
  2213. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
  2214. PrintConv => {
  2215. 0 => 'Top-right',
  2216. 1 => 'Bottom-right',
  2217. 2 => 'Bottom',
  2218. 3 => 'Middle Horizontal',
  2219. 4 => 'Center Vertical',
  2220. 5 => 'Top',
  2221. 6 => 'Top-left',
  2222. 7 => 'Bottom-left',
  2223. },
  2224. },
  2225. 0x19 => { #JR
  2226. Name => 'FocusStatus',
  2227. Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
  2228. Notes => 'not valid with Contrast AF or for NEX models',
  2229. # seen the following values:
  2230. # 0 with MF (A35, A55V-HDR, A560, A580), non-AF lens (A35), and A580 Contrast-AF
  2231. # 4 with MF (A33, A55V), and A580 Contrast-AF
  2232. # 16 with AF-C (or AF-A) and focus OK
  2233. # 24 with AF-C (or AF-A) and unsharp or fast moving subject e.g. bird in flight
  2234. # 64 with AF-S (or AF-A) and focus OK
  2235. PrintConv => {
  2236. 0 => 'Manual - Not confirmed (0)',
  2237. 4 => 'Manual - Not confirmed (4)',
  2238. 16 => 'AF-C - Confirmed',
  2239. 24 => 'AF-C - Not Confirmed',
  2240. 64 => 'AF-S - Confirmed',
  2241. },
  2242. },
  2243. 0x1b => { #JR
  2244. Name => 'AFStatusActiveSensor',
  2245. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
  2246. %Image::ExifTool::Minolta::afStatusInfo,
  2247. },
  2248. 0x1c => {
  2249. Name => 'AFPointSelected', # (v8.88: renamed from LocalAFAreaPointSelected)
  2250. Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
  2251. Notes => 'not valid for Contrast AF', #JR
  2252. # (all of these cameras have an 15-point three-cross AF system, ref JR)
  2253. PrintConvColumns => 2,
  2254. PrintConv => {
  2255. 0 => 'Auto', # (seen in Wide mode)
  2256. 1 => 'Center',
  2257. 2 => 'Top',
  2258. 3 => 'Upper-right',
  2259. 4 => 'Right',
  2260. 5 => 'Lower-right',
  2261. 6 => 'Bottom',
  2262. 7 => 'Lower-left',
  2263. 8 => 'Left',
  2264. 9 => 'Upper-left',
  2265. 10 => 'Far Right',
  2266. 11 => 'Far Left',
  2267. 12 => 'Upper-middle',
  2268. 13 => 'Near Right',
  2269. 14 => 'Lower-middle',
  2270. 15 => 'Near Left',
  2271. },
  2272. },
  2273. 0x1d => [
  2274. {
  2275. Name => 'FocusMode',
  2276. Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
  2277. PrintConv => {
  2278. 0 => 'Manual',
  2279. 1 => 'AF-S',
  2280. 2 => 'AF-C',
  2281. 3 => 'AF-A',
  2282. },
  2283. },{ #JR
  2284. Name => 'AFStatusTop-right',
  2285. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
  2286. %Image::ExifTool::Minolta::afStatusInfo,
  2287. },
  2288. ],
  2289. 0x1f => { #JR
  2290. Name => 'AFStatusBottom-right',
  2291. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
  2292. %Image::ExifTool::Minolta::afStatusInfo,
  2293. },
  2294. 0x20 => { #JR
  2295. Name => 'AFPoint', # (v8.88: renamed from LocalAFAreaPointUsed)
  2296. Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
  2297. Notes => 'the AF sensor used for focusing. Not valid for Contrast AF',
  2298. PrintConvColumns => 2,
  2299. PrintConv => {
  2300. %afPoint15,
  2301. 255 => '(none)', #PH (A55, guess; also A35 with non-AF lens, ref JR)
  2302. },
  2303. },
  2304. 0x21 => [ #JR
  2305. {
  2306. Name => 'AFStatusActiveSensor',
  2307. Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
  2308. %Image::ExifTool::Minolta::afStatusInfo,
  2309. },{
  2310. Name => 'AFStatusBottom',
  2311. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
  2312. %Image::ExifTool::Minolta::afStatusInfo,
  2313. },
  2314. ],
  2315. 0x23 => [ #JR
  2316. {
  2317. Name => 'AFStatus15',
  2318. Condition => '$$self{Model} =~ /^(SLT-|DSLR-A(560|580))\b/',
  2319. Format => 'int16s[18]',
  2320. SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFStatus15' },
  2321. },{
  2322. Name => 'AFStatusMiddleHorizontal', # MiddleHorizontal is any of the 3 central horizontal sensors
  2323. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/',
  2324. %Image::ExifTool::Minolta::afStatusInfo,
  2325. },
  2326. ],
  2327. 0x25 => { Name => 'AFStatusCenterVertical', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2328. 0x27 => { Name => 'AFStatusTop', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2329. 0x29 => { Name => 'AFStatusTop-left', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2330. 0x2b => { Name => 'AFStatusBottom-left', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2331. # the 3 MiddleHorizontal sensors:
  2332. 0x2d => { Name => 'AFStatusLeft', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2333. 0x2f => { Name => 'AFStatusCenterHorizontal', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2334. 0x31 => { Name => 'AFStatusRight', Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)\b/', %Image::ExifTool::Minolta::afStatusInfo },
  2335. # 0x0166 - starting here there are 96 AF Info blocks of 155 bytes each for the SLT-A33/A35/A55 and DSLR-A560/A580,
  2336. # starting here there are 86 AF Info blocks of 174 bytes each for the DSLR-A450/A500/A550,
  2337. # but NOT for NEX, and not for the A580 in Contrast-AF mode (ref JR)
  2338. # The 43rd byte of each block for A580 appears to be the AFPoint as in offset 0x20,
  2339. # possibly also 73rd and 74th byte
  2340. );
  2341. # Camera information for other models (ref PH)
  2342. %Image::ExifTool::Sony::CameraInfoUnknown = (
  2343. %binaryDataAttrs,
  2344. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2345. );
  2346. # white balance and other camera information (ref PH)
  2347. %Image::ExifTool::Sony::FocusInfo = (
  2348. %binaryDataAttrs,
  2349. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2350. PRIORITY => 0,
  2351. NOTES => q{
  2352. More camera settings and focus information decoded for models such as the
  2353. A200, A230, A290, A300, A330, A350, A380, A390, A700, A850 and A900.
  2354. },
  2355. 0x0e => [{ #7/JR
  2356. Name => 'DriveMode2',
  2357. Condition => '$$self{Model} =~ /^DSLR-A(230|290|330|380|390)$/',
  2358. Notes => 'A230, A290, A330, A380 and A390',
  2359. ValueConvInv => '$val',
  2360. PrintHex => 1,
  2361. PrintConv => { # (values confirmed for specified models - PH)
  2362. 0x01 => 'Single Frame', # (A230,A330,A380)
  2363. 0x02 => 'Continuous High', #PH (A230,A330)
  2364. 0x04 => 'Self-timer 10 sec', # (A230)
  2365. 0x05 => 'Self-timer 2 sec, Mirror Lock-up', # (A230,A290,A330,A380,390)
  2366. 0x07 => 'Continuous Bracketing', # (A230,A330)
  2367. 0x0a => 'Remote Commander', # (A230)
  2368. 0x0b => 'Continuous Self-timer', # (A230,A330)
  2369. },
  2370. },{
  2371. Name => 'DriveMode2',
  2372. Notes => 'A200, A300, A350, A700, A850 and A900',
  2373. ValueConvInv => '$val',
  2374. PrintHex => 1,
  2375. PrintConv => {
  2376. 0x01 => 'Single Frame',
  2377. 0x02 => 'Continuous High', # A700/A900; not on A850
  2378. 0x12 => 'Continuous Low', #JR
  2379. 0x04 => 'Self-timer 10 sec',
  2380. 0x05 => 'Self-timer 2 sec, Mirror Lock-up',
  2381. 0x06 => 'Single-frame Bracketing',
  2382. 0x07 => 'Continuous Bracketing',
  2383. 0x18 => 'White Balance Bracketing Low', #JR
  2384. 0x28 => 'White Balance Bracketing High', #JR
  2385. 0x19 => 'D-Range Optimizer Bracketing Low', #JR
  2386. 0x29 => 'D-Range Optimizer Bracketing High', #JR
  2387. 0x0a => 'Remote Commander', #JR
  2388. 0x0b => 'Mirror Lock-up', #JR (A850/A900; not on A700)
  2389. },
  2390. }],
  2391. 0x10 => { #JR (1 and 2 inverted!)
  2392. Name => 'Rotation',
  2393. PrintConv => {
  2394. 0 => 'Horizontal (normal)',
  2395. 1 => 'Rotate 270 CW',
  2396. 2 => 'Rotate 90 CW',
  2397. },
  2398. },
  2399. 0x14 => {
  2400. Name => 'ImageStabilizationSetting',
  2401. PrintConv => { 0 => 'Off', 1 => 'On' },
  2402. },
  2403. 0x15 => { #7
  2404. Name => 'DynamicRangeOptimizerMode',
  2405. PrintConv => {
  2406. 0 => 'Off',
  2407. 1 => 'Standard',
  2408. 2 => 'Advanced Auto',
  2409. 3 => 'Advanced Level',
  2410. },
  2411. },
  2412. 0x2b => { #JR seen 2,1,3 for both WB and DRO bracketing
  2413. Name => 'BracketShotNumber',
  2414. Notes => 'WB and DRO bracketing',
  2415. },
  2416. 0x2c => { #JR
  2417. Name => 'WhiteBalanceBracketing',
  2418. PrintConv => {
  2419. 0 => 'Off',
  2420. 1 => 'Low',
  2421. 2 => 'High',
  2422. },
  2423. },
  2424. 0x2d => { #JR seen 2,1,3 for both WB and DRO bracketing
  2425. Name => 'BracketShotNumber2',
  2426. },
  2427. 0x2e => { #JR
  2428. Name => 'DynamicRangeOptimizerBracket',
  2429. PrintConv => {
  2430. 0 => 'Off',
  2431. 1 => 'Low',
  2432. 2 => 'High',
  2433. },
  2434. },
  2435. 0x2f => { #JR seen 0,1,2 and 0,1,2,3,4 for 3 and 5 image bracketing sequences
  2436. Name => 'ExposureBracketShotNumber',
  2437. },
  2438. 0x3f => { #JR
  2439. Name => 'ExposureProgram',
  2440. SeparateTable => 'ExposureProgram',
  2441. PrintConv => \%sonyExposureProgram,
  2442. },
  2443. 0x41 => { #JR style actually used (combination of mode dial + creative style menu)
  2444. Name => 'CreativeStyle',
  2445. PrintConvColumns => 2,
  2446. PrintConv => {
  2447. 1 => 'Standard',
  2448. 2 => 'Vivid',
  2449. 3 => 'Portrait',
  2450. 4 => 'Landscape',
  2451. 5 => 'Sunset',
  2452. 6 => 'Night View/Portrait',
  2453. 8 => 'B&W',
  2454. 9 => 'Adobe RGB', # A700
  2455. 11 => 'Neutral',
  2456. 12 => 'Clear', #7
  2457. 13 => 'Deep', #7
  2458. 14 => 'Light', #7
  2459. 15 => 'Autumn Leaves', #7
  2460. 16 => 'Sepia', #7
  2461. },
  2462. },
  2463. 0x6d => {
  2464. Name => 'ISOSetting',
  2465. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  2466. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  2467. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  2468. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  2469. },
  2470. 0x6f => {
  2471. Name => 'ISO',
  2472. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  2473. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  2474. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  2475. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  2476. },
  2477. 0x77 => { #JR
  2478. Name => 'DynamicRangeOptimizerMode',
  2479. PrintConv => {
  2480. 0 => 'Off',
  2481. 1 => 'Standard',
  2482. 2 => 'Advanced Auto',
  2483. 3 => 'Advanced Level',
  2484. },
  2485. },
  2486. 0x79 => 'DynamicRangeOptimizerLevel',
  2487. # 0x06f1 - int16u LensType, Condition => '$$self{Model} =~ /^DSLR-A(700|850|900)$/',
  2488. # 0x4a81 - int16u LensType, Condition => '$$self{Model} !~ /^DSLR-A(700|850|900)$/',
  2489. # 0x4a84 - int16uRev LensType, Condition => '$$self{Model} =~ /^DSLR-A(700|850|900)$/',
  2490. 0x0846 => { #13
  2491. Name => 'ShutterCount', # (=ImageCount for these models)
  2492. Condition => '$$self{Model} =~ /^DSLR-A(230|290|330|380|390|850|900)$/',
  2493. Format => 'int32u',
  2494. Notes => 'only valid for some DSLR models',
  2495. RawConv => '$val & 0x00ffffff', #PH
  2496. },
  2497. 0x09bb => { #PH (validated only for DSLR-A850)
  2498. Name => 'FocusPosition',
  2499. Condition => '$$self{Model} =~ /^DSLR-A(200|230|290|300|330|350|380|390|700|850|900)$/',
  2500. Notes => 'only valid for some DSLR models',
  2501. # 128 = infinity -- see Composite:FocusDistance below
  2502. },
  2503. 0x1110 => { # (9600 bytes: 4 sets of 40x30 int16u values in the range 0-8191)
  2504. Name => 'TiffMeteringImage',
  2505. Format => 'undef[9600]',
  2506. Notes => q{
  2507. 13-bit RBGG (?) 40x30 pixels, presumably metering info, extracted as a
  2508. 16-bit TIFF image;
  2509. },
  2510. ValueConv => sub {
  2511. my ($val, $et) = @_;
  2512. return undef unless length $val >= 9600;
  2513. return \ "Binary data 7404 bytes" unless $et->Options('Binary');
  2514. my @dat = unpack('n*', $val);
  2515. # TIFF header for a 16-bit RGB 10dpi 40x30 image
  2516. $val = MakeTiffHeader(40,30,3,16,10);
  2517. # re-order data to RGB pixels
  2518. my ($i, @val);
  2519. for ($i=0; $i<40*30; ++$i) {
  2520. # data is 13-bit (max 8191), shift left to fill 16 bits
  2521. # (typically, this gives a very dark image since the data should
  2522. # really be anti-logged to convert from EV to perceived brightness)
  2523. # push @val, $dat[$i]<<3, $dat[$i+2400]<<3, $dat[$i+1200]<<3;
  2524. push @val, int(5041.1*log($dat[$i]+1)/log(2)), int(5041.1*log($dat[$i+2400]+1)/log(2)), int(5041.1*log($dat[$i+1200]+1)/log(2));
  2525. }
  2526. $val .= pack('v*', @val); # add TIFF strip data
  2527. return \$val;
  2528. },
  2529. },
  2530. );
  2531. # more camera setting information (ref JR)
  2532. # - many of these tags are the same as in CameraSettings3
  2533. %Image::ExifTool::Sony::MoreInfo = (
  2534. PROCESS_PROC => \&ProcessMoreInfo,
  2535. WRITE_PROC => \&ProcessMoreInfo,
  2536. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2537. NOTES => q{
  2538. More camera settings information decoded for the A450, A500, A550, A560,
  2539. A580, A33, A35, A55, NEX-3/5/C3 and VG10E.
  2540. },
  2541. 0x0001 => { # (256 bytes)
  2542. Name => 'MoreSettings',
  2543. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MoreSettings' },
  2544. },
  2545. # (byte sizes for a single A580 image -- not checked for other images)
  2546. 0x0002 => [ # (256 bytes)
  2547. {
  2548. Name => 'FaceInfo',
  2549. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  2550. SubDirectory => { TagTable => 'Image::ExifTool::Sony::FaceInfo' },
  2551. },{
  2552. Name => 'FaceInfoA',
  2553. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  2554. SubDirectory => { TagTable => 'Image::ExifTool::Sony::FaceInfoA' },
  2555. },
  2556. ],
  2557. # 0x0101: 512 bytes
  2558. # 0x0102: 1804 bytes
  2559. # 0x0103: 176 bytes
  2560. # 0x0104: 1088 bytes
  2561. # 0x0105: 160 bytes (all zero unless flash is used, ref JR)
  2562. # 0x0106: 256 bytes (faces detected if first byte is non-zero? ref JR)
  2563. 0x0107 => { # (7200 bytes: 3 sets of 40x30 int16u values in the range 0-1023)
  2564. Name => 'TiffMeteringImage',
  2565. Notes => q{
  2566. 10-bit RGB data from the 1200 AE metering segments, extracted as a 16-bit
  2567. TIFF image
  2568. },
  2569. ValueConv => sub {
  2570. my ($val, $et) = @_;
  2571. return undef unless length $val >= 7200;
  2572. return \ "Binary data 7404 bytes" unless $et->Options('Binary');
  2573. my @dat = unpack('v*', $val);
  2574. # TIFF header for a 16-bit RGB 10dpi 40x30 image
  2575. $val = MakeTiffHeader(40,30,3,16,10);
  2576. # re-order data to RGB pixels
  2577. my ($i, @val);
  2578. for ($i=0; $i<40*30; ++$i) {
  2579. # data is 10-bit (max 1023), shift left to fill 16 bits
  2580. # (typically, this gives a very dark image since the data should
  2581. # really be anti-logged to convert from EV to perceived brightness)
  2582. push @val, $dat[$i]<<6, $dat[$i+1200]<<6, $dat[$i+2400]<<6;
  2583. }
  2584. $val .= pack('v*', @val); # add TIFF strip data
  2585. return \$val;
  2586. },
  2587. },
  2588. # 0x0108: 140 bytes
  2589. # 0x0109: 256 bytes
  2590. # 0x010a: 256 bytes
  2591. # 0x0306: 276 bytes
  2592. # 0x0307: 256 bytes
  2593. # 0x0308: 96 bytes
  2594. # 0x0309: 112 bytes
  2595. # 0xffff: 788 bytes
  2596. 0x0201 => { # (368 bytes)
  2597. Name => 'MoreInfo0201',
  2598. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MoreInfo0201' },
  2599. },
  2600. # 0x0202: 144 bytes
  2601. # 0x0401: 4608 bytes
  2602. 0x0401 => {
  2603. Name => 'MoreInfo0401',
  2604. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MoreInfo0401' },
  2605. },
  2606. );
  2607. %Image::ExifTool::Sony::MoreInfo0201 = (
  2608. %binaryDataAttrs,
  2609. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2610. PRIORITY => 0,
  2611. # 0x005d - also from 0 - 255, in sync with but lower than 0x005e, depending on FocalLength
  2612. # 0x005e => {
  2613. # # FocusPosition for A560/A580/A33/A35/A55V
  2614. # # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  2615. # Name => 'FocusPosition2_0201',
  2616. # Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  2617. # },
  2618. # 0x0093 - also from 0 - 255, in sync with but lower than 0x0094, depending on FocalLength
  2619. # 0x0094 => {
  2620. # # FocusPosition for A450/A500/A550
  2621. # # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  2622. # Name => 'FocusPosition2_0201',
  2623. # Condition => '$$self{Model} =~ /^(DSLR-(A450|A500|A550)$)/',
  2624. # },
  2625. 0x011b => { #13
  2626. Name => 'ImageCount',
  2627. Condition => '$$self{Model} !~ /^DSLR-A(450|500|550)$/', #JR
  2628. Format => 'int32u',
  2629. Notes => 'not valid for the A450, A500 or A550',
  2630. RawConv => '$val & 0x00ffffff',
  2631. },
  2632. 0x0125 => { #13
  2633. Name => 'ShutterCount',
  2634. Condition => '$$self{Model} !~ /^DSLR-A(450|500|550)$/', #JR
  2635. Format => 'int32u',
  2636. Notes => 'not valid for the A450, A500 or A550',
  2637. RawConv => '$val & 0x00ffffff',
  2638. },
  2639. 0x014a => { #13
  2640. Name => 'ShutterCount', # (=ImageCount for these models)
  2641. Condition => '$$self{Model} =~ /^DSLR-A(450|500|550)$/', #JR
  2642. Format => 'int32u',
  2643. Notes => 'A450, A500 and A550 only',
  2644. RawConv => '$val & 0x00ffffff',
  2645. },
  2646. );
  2647. %Image::ExifTool::Sony::MoreInfo0401 = (
  2648. %binaryDataAttrs,
  2649. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2650. PRIORITY => 0,
  2651. 0x044e => { #JR
  2652. Name => 'ShotNumberSincePowerUp',
  2653. Condition => '$$self{Model} !~ /^NEX-(3|5)$/',
  2654. Format => 'int32u',
  2655. Notes => 'Not valid for the NEX-3 or NEX-5',
  2656. RawConv => '$val & 0x00ffffff',
  2657. },
  2658. # 0x101e - int16u LensType Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
  2659. # 0x1022 - int16u LensType Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
  2660. # 0x102a - int16u LensType Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
  2661. # 0x10a8 - int16u LensType Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
  2662. # 0x10ac - int16u LensType Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
  2663. # 0x10b4 - int16u LensType Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
  2664. #
  2665. # 0x10f7 - int16u LensType Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
  2666. # 0x10fb - int16u LensType Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
  2667. # 0x1103 - int16u LensType Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
  2668. #
  2669. # 0x1181 - int16u LensType Condition => '$$self{Model} =~ /^SLT-A(33|55V)/',
  2670. # 0x1185 - int16u LensType Condition => '$$self{Model} =~ /^DSLR-A(560|580)/',
  2671. # 0x118d - int16u LensType Condition => '$$self{Model} =~ /^(SLT-A35|NEX-C3)/',
  2672. );
  2673. # more camera setting information (ref JR)
  2674. # - many of these tags are the same as in CameraSettings3
  2675. %Image::ExifTool::Sony::MoreSettings = (
  2676. %binaryDataAttrs,
  2677. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  2678. PRIORITY => 0,
  2679. 0x01 => { # interesting: somewhere between CameraSettings3 0x04 and 0x34
  2680. Name => 'DriveMode2',
  2681. PrintHex => 1,
  2682. PrintConv => {
  2683. 0x10 => 'Single Frame',
  2684. 0x21 => 'Continuous High', # also automatically selected for Scene mode Sports-action (0x05=52)
  2685. 0x22 => 'Continuous Low',
  2686. 0x30 => 'Speed Priority Continuous',
  2687. 0x51 => 'Self-timer 10 sec',
  2688. 0x52 => 'Self-timer 2 sec, Mirror Lock-up',
  2689. 0x71 => 'Continuous Bracketing 0.3 EV',
  2690. 0x75 => 'Continuous Bracketing 0.7 EV',
  2691. 0x91 => 'White Balance Bracketing Low',
  2692. 0x92 => 'White Balance Bracketing High',
  2693. 0xc0 => 'Remote Commander',
  2694. },
  2695. },
  2696. 0x02 => {
  2697. Name => 'ExposureProgram',
  2698. SeparateTable => 'ExposureProgram2',
  2699. PrintConv => \%sonyExposureProgram2,
  2700. },
  2701. 0x03 => {
  2702. Name => 'MeteringMode',
  2703. PrintConv => {
  2704. 1 => 'Multi-segment',
  2705. 2 => 'Center-weighted average',
  2706. 3 => 'Spot',
  2707. },
  2708. },
  2709. 0x04 => {
  2710. Name => 'DynamicRangeOptimizerSetting',
  2711. PrintConv => {
  2712. 1 => 'Off',
  2713. 16 => 'On (Auto)',
  2714. 17 => 'On (Manual)',
  2715. },
  2716. },
  2717. 0x05 => 'DynamicRangeOptimizerLevel',
  2718. 0x06 => {
  2719. Name => 'ColorSpace',
  2720. PrintConv => {
  2721. 1 => 'sRGB',
  2722. 2 => 'Adobe RGB',
  2723. },
  2724. },
  2725. 0x07 => {
  2726. Name => 'CreativeStyleSetting',
  2727. PrintConvColumns => 2,
  2728. PrintConv => {
  2729. 16 => 'Standard',
  2730. 32 => 'Vivid',
  2731. 64 => 'Portrait',
  2732. 80 => 'Landscape',
  2733. 96 => 'B&W',
  2734. 160 => 'Sunset',
  2735. },
  2736. },
  2737. 0x08 => { #JR
  2738. Name => 'ContrastSetting',
  2739. Format => 'int8s',
  2740. PrintConv => '$val > 0 ? "+$val" : $val',
  2741. PrintConvInv => '$val',
  2742. },
  2743. 0x09 => {
  2744. Name => 'SaturationSetting',
  2745. Format => 'int8s',
  2746. PrintConv => '$val > 0 ? "+$val" : $val',
  2747. PrintConvInv => '$val',
  2748. },
  2749. 0x0a => {
  2750. Name => 'SharpnessSetting',
  2751. Format => 'int8s',
  2752. PrintConv => '$val > 0 ? "+$val" : $val',
  2753. PrintConvInv => '$val',
  2754. },
  2755. 0x0d => {
  2756. Name => 'WhiteBalanceSetting',
  2757. # many guessed, based on "logical system" as observed for Daylight and Shade and steps of 16 between the modes
  2758. PrintHex => 1,
  2759. PrintConvColumns => 2,
  2760. PrintConv => \%whiteBalanceSetting,
  2761. SeparateTable => 1,
  2762. },
  2763. 0x0e => {
  2764. Name => 'ColorTemperatureSetting',
  2765. # matches "0xb021 ColorTemperature" when WB set to "Custom" or "Color Temperature/Color Filter"
  2766. ValueConv => '$val * 100',
  2767. ValueConvInv => '$val / 100',
  2768. PrintConv => '"$val K"',
  2769. PrintConvInv => '$val =~ s/ ?K$//i; $val',
  2770. },
  2771. 0x0f => {
  2772. Name => 'ColorCompensationFilterSet',
  2773. # seen 0, 1-9 and 245-255, corresponding to 0, M1-M9 and G9-G1 on camera display
  2774. # matches "0xb022 ColorCompensationFilter" when WB set to "Custom" or "Color Temperature/Color Filter"
  2775. Format => 'int8s',
  2776. Notes => 'negative is green, positive is magenta',
  2777. PrintConv => '$val > 0 ? "+$val" : $val',
  2778. PrintConvInv => '$val',
  2779. },
  2780. 0x10 => {
  2781. Name => 'FlashMode',
  2782. PrintConvColumns => 2,
  2783. PrintConv => {
  2784. 1 => 'Flash Off',
  2785. 16 => 'Autoflash',
  2786. 17 => 'Fill-flash',
  2787. 18 => 'Slow Sync',
  2788. 19 => 'Rear Sync',
  2789. 20 => 'Wireless',
  2790. },
  2791. },
  2792. 0x11 => {
  2793. Name => 'LongExposureNoiseReduction',
  2794. PrintConv => {
  2795. 1 => 'Off',
  2796. 16 => 'On', # (unused or dark subject)
  2797. },
  2798. },
  2799. 0x12 => {
  2800. Name => 'HighISONoiseReduction',
  2801. PrintConv => {
  2802. 16 => 'Low',
  2803. 19 => 'Auto',
  2804. },
  2805. },
  2806. 0x13 => { # why is this not valid for A450/A500/A550 ?
  2807. Name => 'FocusMode',
  2808. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  2809. PrintConv => {
  2810. 17 => 'AF-S',
  2811. 18 => 'AF-C',
  2812. 19 => 'AF-A',
  2813. 32 => 'Manual',
  2814. 48 => 'DMF', # (NC) (seen for NEX-5)
  2815. },
  2816. },
  2817. 0x15 => {
  2818. Name => 'MultiFrameNoiseReduction',
  2819. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  2820. PrintConv => {
  2821. 0 => 'n/a', # seen for A450/A500/A550
  2822. 1 => 'Off',
  2823. 16 => 'On',
  2824. 255 => 'None', # seen for NEX-3/5/C3
  2825. },
  2826. },
  2827. 0x16 => {
  2828. Name => 'HDRSetting',
  2829. PrintConv => {
  2830. 1 => 'Off',
  2831. 16 => 'On (Auto)',
  2832. 17 => 'On (Manual)',
  2833. },
  2834. },
  2835. 0x17 => {
  2836. Name => 'HDRLevel',
  2837. PrintConvColumns => 3,
  2838. PrintConv => {
  2839. 33 => '1 EV',
  2840. 34 => '1.5 EV', #JR (NC)
  2841. 35 => '2 EV',
  2842. 36 => '2.5 EV', #JR (NC)
  2843. 37 => '3 EV',
  2844. 38 => '3.5 EV', #PH (NC)
  2845. 39 => '4 EV',
  2846. 40 => '5 EV',
  2847. 41 => '6 EV',
  2848. },
  2849. },
  2850. 0x18 => {
  2851. Name => 'ViewingMode',
  2852. PrintConv => {
  2853. 16 => 'ViewFinder',
  2854. 33 => 'Focus Check Live View',
  2855. 34 => 'Quick AF Live View',
  2856. },
  2857. },
  2858. 0x19 => {
  2859. Name => 'FaceDetection',
  2860. PrintConv => {
  2861. 1 => 'Off',
  2862. 16 => 'On',
  2863. },
  2864. },
  2865. 0x1a => {
  2866. Name => 'CustomWB_RBLevels',
  2867. # matches "0x7313 WB_RGGBLevels" when WB set to "Custom", except factor of 4
  2868. Format => 'int16uRev[2]',
  2869. },
  2870. # From here different and overlapping offsets for 3 groups of cameras:
  2871. # 1) DSLR-A450/A500/A550
  2872. # 2) NEX-3/5/5C
  2873. # 3) DSLR-A560/A580, NEX-C3/VG10/VG10E, SLT-A33/A35/A55V
  2874. 0x1e => [{
  2875. Name => 'BrightnessValue',
  2876. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  2877. Notes => 'A450, A500 and A550',
  2878. ValueConv => '($val-106)/8',
  2879. ValueConvInv => '$val * 8 + 106',
  2880. },{
  2881. Name => 'ExposureCompensationSet',
  2882. Notes => 'other models',
  2883. ValueConv => '($val - 128) / 24', #PH
  2884. ValueConvInv => 'int($val * 24 + 128.5)',
  2885. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  2886. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2887. }],
  2888. 0x1f => [{
  2889. Name => 'ISO',
  2890. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  2891. Notes => 'A450, A500 and A550',
  2892. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  2893. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  2894. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  2895. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  2896. },{
  2897. Name => 'FlashExposureCompSet',
  2898. Notes => 'other models',
  2899. Description => 'Flash Exposure Comp. Setting',
  2900. ValueConv => '($val - 128) / 24', #PH
  2901. ValueConvInv => 'int($val * 24 + 128.5)',
  2902. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  2903. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  2904. }],
  2905. 0x20 => [{
  2906. Name => 'FNumber',
  2907. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  2908. Notes => 'A450, A500 and A550',
  2909. ValueConv => '2 ** (($val/8 - 1) / 2)',
  2910. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  2911. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  2912. PrintConvInv => '$val',
  2913. },{
  2914. Name => 'LiveViewAFMethod',
  2915. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)/',
  2916. Notes => 'other models except the NEX-3/5/5C',
  2917. PrintConv => {
  2918. 0 => 'n/a',
  2919. 1 => 'Phase-detect AF',
  2920. 2 => 'Contrast AF',
  2921. # Contrast AF is only available with SSM/SAM lenses and in Focus Check LV,
  2922. # NOT in Quick AF LV, and is automatically set when mounting SSM/SAM lens
  2923. # - changes into Phase-AF when switching to Quick AF LV.
  2924. },
  2925. }],
  2926. 0x21 => [{
  2927. Name => 'ExposureTime',
  2928. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  2929. Notes => 'A450, A500 and A550',
  2930. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  2931. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  2932. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  2933. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  2934. },{
  2935. Name => 'ISO',
  2936. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  2937. Notes => 'NEX-3/5/5C',
  2938. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  2939. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  2940. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  2941. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  2942. }],
  2943. 0x22 => {
  2944. Name => 'FNumber',
  2945. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  2946. Notes => 'NEX-3/5/5C only',
  2947. ValueConv => '2 ** (($val/8 - 1) / 2)',
  2948. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  2949. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  2950. PrintConvInv => '$val',
  2951. },
  2952. 0x23 => [{
  2953. Name => 'FocalLength2',
  2954. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  2955. Notes => 'A450, A500 and A550',
  2956. ValueConv => '10 * 2 ** (($val-28)/16)',
  2957. ValueConvInv => '$val>0 ? log($val/10)/log(2) * 16 + 28 : 0',
  2958. PrintConv => 'sprintf("%.1f mm",$val)',
  2959. PrintConvInv => '$val=~s/\s*mm$//; $val',
  2960. },{
  2961. Name => 'ExposureTime',
  2962. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  2963. Notes => 'NEX-3/5/5C',
  2964. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  2965. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  2966. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  2967. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  2968. }],
  2969. 0x24 => {
  2970. Name => 'ExposureCompensation2',
  2971. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  2972. Notes => 'A450, A500 and A550',
  2973. Format => 'int16s',
  2974. ValueConv => '$val / 8',
  2975. ValueConvInv => '$val * 8',
  2976. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  2977. PrintConvInv => '$val',
  2978. },
  2979. 0x25 => [{
  2980. Name => 'FocalLength2',
  2981. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  2982. Notes => 'NEX-3/5/5C',
  2983. ValueConv => '10 * 2 ** (($val-28)/16)',
  2984. ValueConvInv => '$val>0 ? log($val/10)/log(2) * 16 + 28 : 0',
  2985. PrintConv => 'sprintf("%.1f mm",$val)',
  2986. PrintConvInv => '$val=~s/\s*mm$//; $val',
  2987. },{
  2988. Name => 'ISO',
  2989. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)/',
  2990. Notes => 'other models except the A450, A500 and A550',
  2991. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  2992. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  2993. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  2994. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  2995. }],
  2996. 0x26 => [{
  2997. Name => 'FlashExposureCompSet2',
  2998. Description => 'Flash Exposure Comp. Setting 2',
  2999. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  3000. Notes => 'A450, A500 and A550',
  3001. Format => 'int16s',
  3002. ValueConv => '$val / 8',
  3003. ValueConvInv => '$val * 8',
  3004. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3005. PrintConvInv => '$val',
  3006. },{
  3007. Name => 'ExposureCompensation2',
  3008. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  3009. Notes => 'NEX-3/5/5C',
  3010. Format => 'int16s',
  3011. ValueConv => '$val / 8',
  3012. ValueConvInv => '$val * 8',
  3013. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3014. PrintConvInv => '$val',
  3015. },{
  3016. Name => 'FNumber',
  3017. Notes => 'other models',
  3018. ValueConv => '2 ** (($val/8 - 1) / 2)',
  3019. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  3020. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  3021. PrintConvInv => '$val',
  3022. }],
  3023. 0x27 => {
  3024. Name => 'ExposureTime',
  3025. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
  3026. Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
  3027. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  3028. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  3029. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  3030. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  3031. },
  3032. 0x28 => {
  3033. Name => 'Orientation2',
  3034. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  3035. Notes => 'A450, A500 and A550',
  3036. PrintConv => {
  3037. 1 => 'Horizontal (normal)',
  3038. 2 => 'Rotate 180',
  3039. 6 => 'Rotate 90 CW',
  3040. 8 => 'Rotate 270 CW',
  3041. },
  3042. },
  3043. 0x29 => [{
  3044. # FocusPosition for A450/A500/A550
  3045. # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  3046. Name => 'FocusPosition2',
  3047. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  3048. Notes => 'A450, A500 and A550',
  3049. },{
  3050. # value increase of 16 corresponds to doubling of FocalLength
  3051. Name => 'FocalLength2',
  3052. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)/',
  3053. Notes => 'other models except the NEX-3/5/5C',
  3054. ValueConv => '10 * 2 ** (($val-28)/16)',
  3055. ValueConvInv => '$val>0 ? log($val/10)/log(2) * 16 + 28 : 0',
  3056. PrintConv => 'sprintf("%.1f mm",$val)',
  3057. PrintConvInv => '$val=~s/\s*mm$//; $val',
  3058. }],
  3059. 0x2a => [{
  3060. Name => 'FlashAction',
  3061. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  3062. Notes => 'A450, A500 and A550',
  3063. PrintConv => {
  3064. 0 => 'Did not fire',
  3065. 1 => 'Fired',
  3066. },
  3067. },{
  3068. Name => 'ExposureCompensation2',
  3069. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)/',
  3070. Notes => 'other models except the NEX-3/5/5C',
  3071. Format => 'int16s',
  3072. ValueConv => '$val / 8',
  3073. ValueConvInv => '$val * 8',
  3074. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3075. PrintConvInv => '$val',
  3076. }],
  3077. 0x2b => {
  3078. # FocusPosition for NEX-3/5/5C
  3079. # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  3080. Name => 'FocusPosition2',
  3081. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  3082. Notes => 'NEX-3/5/5C only',
  3083. },
  3084. 0x2c => [{
  3085. Name => 'FocusMode2',
  3086. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  3087. Notes => 'A450, A500 and A550',
  3088. PrintConv => {
  3089. 0 => 'AF',
  3090. 1 => 'MF',
  3091. },
  3092. },{
  3093. Name => 'FlashAction',
  3094. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  3095. Notes => 'NEX-3/5/5C FlashAction2',
  3096. PrintConv => {
  3097. 0 => 'Did not fire',
  3098. 1 => 'Fired',
  3099. },
  3100. },{
  3101. Name => 'FlashExposureCompSet2',
  3102. Description => 'Flash Exposure Comp. Setting 2',
  3103. Notes => 'other models FlashExposureCompSet2',
  3104. Format => 'int16s',
  3105. ValueConv => '$val / 8',
  3106. ValueConvInv => '$val * 8',
  3107. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3108. PrintConvInv => '$val',
  3109. }],
  3110. 0x2e => [{
  3111. Name => 'FocusMode2',
  3112. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  3113. Notes => 'NEX-3/5/5C',
  3114. PrintConv => {
  3115. 0 => 'AF',
  3116. 1 => 'MF',
  3117. },
  3118. },{
  3119. Name => 'Orientation2', # seen some A55 images where this does not match the other Orientation tags
  3120. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)/',
  3121. Notes => 'other models except the A450, A500 and A550',
  3122. PrintConv => {
  3123. 1 => 'Horizontal (normal)',
  3124. 2 => 'Rotate 180',
  3125. 6 => 'Rotate 90 CW',
  3126. 8 => 'Rotate 270 CW',
  3127. },
  3128. }],
  3129. 0x2f => {
  3130. # FocusPosition for A560/A580/A33/A35/A55V and NEX-C3/VG10/VG10E
  3131. # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  3132. Name => 'FocusPosition2',
  3133. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
  3134. Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
  3135. },
  3136. 0x30 => {
  3137. Name => 'FlashAction',
  3138. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
  3139. Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
  3140. PrintConv => {
  3141. 0 => 'Did not fire',
  3142. 1 => 'Fired',
  3143. },
  3144. },
  3145. 0x32 => {
  3146. Name => 'FocusMode2',
  3147. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
  3148. Notes => 'models other than the A450, A500, A550 and NEX-3/5/5C',
  3149. PrintConv => {
  3150. 0 => 'AF',
  3151. 1 => 'MF',
  3152. },
  3153. },
  3154. 0x0077 => {
  3155. Name => 'FlashAction2',
  3156. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)/',
  3157. PrintConv => {
  3158. 0 => 'Did not fire',
  3159. 2 => 'External Flash fired (2)',
  3160. 3 => 'Built-in Flash fired',
  3161. 4 => 'External Flash fired (4)', # what is difference with 2 ?
  3162. },
  3163. },
  3164. 0x0078 => {
  3165. Name => 'FlashActionExternal',
  3166. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  3167. PrintConv => {
  3168. 136 => 'Did not fire',
  3169. 122 => 'Fired',
  3170. },
  3171. },
  3172. 0x007c => {
  3173. Name => 'FlashActionExternal',
  3174. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
  3175. PrintConv => {
  3176. 136 => 'Did not fire',
  3177. 167 => 'Fired',
  3178. 182 => 'Fired, HSS',
  3179. },
  3180. },
  3181. 0x0082 => {
  3182. Name => 'FlashStatus',
  3183. Condition => '$$self{Model} =~ /^NEX-(3|5|5C)/',
  3184. PrintConv => {
  3185. 0 => 'None',
  3186. 2 => 'External',
  3187. },
  3188. },
  3189. 0x0086 => {
  3190. Name => 'FlashStatus',
  3191. Condition => '$$self{Model} !~ /^NEX-(3|5|5C)|DSLR-(A450|A500|A550)/',
  3192. PrintConv => {
  3193. 0 => 'None',
  3194. 1 => 'Built-in',
  3195. 2 => 'External',
  3196. },
  3197. },
  3198. );
  3199. # Face detection information (ref JR)
  3200. my %faceInfo = (
  3201. Format => 'int16u[4]',
  3202. # re-order to top,left,height,width and scale to full-sized image like other Sony models
  3203. ValueConv => 'my @v=split(" ",$val); $_*=15 foreach @v; "$v[1] $v[0] $v[3] $v[2]"',
  3204. ValueConvInv => 'my @v=split(" ",$val); $_=int($_/15+0.5) foreach @v; "$v[1] $v[0] $v[3] $v[2]"',
  3205. );
  3206. %Image::ExifTool::Sony::FaceInfo = (
  3207. %binaryDataAttrs,
  3208. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3209. FORMAT => 'int16u',
  3210. DATAMEMBER => [ 0x00 ],
  3211. 0x00 => {
  3212. Name => 'FacesDetected',
  3213. DataMember => 'FacesDetected',
  3214. Format => 'int16s',
  3215. RawConv => '$$self{FacesDetected} = ($val == -1 ? 0 : $val); $val',
  3216. PrintConv => {
  3217. OTHER => sub { shift }, # pass other values straight through
  3218. -1 => 'n/a',
  3219. },
  3220. },
  3221. 0x01 => {
  3222. Name => 'Face1Position',
  3223. Condition => '$$self{FacesDetected} >= 1',
  3224. %faceInfo,
  3225. Notes => q{
  3226. re-ordered and scaled to return the top, left, height and width of detected
  3227. face, with coordinates relative to the full-sized unrotated image and
  3228. increasing Y downwards
  3229. },
  3230. },
  3231. 0x06 => {
  3232. Name => 'Face2Position',
  3233. Condition => '$$self{FacesDetected} >= 2',
  3234. %faceInfo,
  3235. },
  3236. 0x0b => {
  3237. Name => 'Face3Position',
  3238. Condition => '$$self{FacesDetected} >= 3',
  3239. %faceInfo,
  3240. },
  3241. 0x10 => {
  3242. Name => 'Face4Position',
  3243. Condition => '$$self{FacesDetected} >= 4',
  3244. %faceInfo,
  3245. },
  3246. 0x15 => {
  3247. Name => 'Face5Position',
  3248. Condition => '$$self{FacesDetected} >= 5',
  3249. %faceInfo,
  3250. },
  3251. 0x1a => {
  3252. Name => 'Face6Position',
  3253. Condition => '$$self{FacesDetected} >= 6',
  3254. %faceInfo,
  3255. },
  3256. 0x1f => {
  3257. Name => 'Face7Position',
  3258. Condition => '$$self{FacesDetected} >= 7',
  3259. %faceInfo,
  3260. },
  3261. 0x24 => {
  3262. Name => 'Face8Position',
  3263. Condition => '$$self{FacesDetected} >= 8',
  3264. %faceInfo,
  3265. },
  3266. );
  3267. %Image::ExifTool::Sony::FaceInfoA = ( # different offsets for A450/A500/A550
  3268. %binaryDataAttrs,
  3269. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3270. FORMAT => 'int16u',
  3271. DATAMEMBER => [ 0x02, 0x03, 0x08 ],
  3272. #
  3273. # The FacesDetected number at 0x03 below is often 1 lower than the one at Tag900b 0x02.
  3274. # The number of Face Positions starting at 0x5b (max. 4) corresponds to the number at 0x03.
  3275. # The number of Face Positions starting at 0x0b usually corresponds to the FacesDetected number of Tag900b...
  3276. # Therefore created the extra condition at 0x0b (11.1) to output an available FacePosition, even when 0x03=0...
  3277. #
  3278. 0x02 => {
  3279. Name => 'FaceTest2',
  3280. DataMember => 'FaceTest2',
  3281. Hidden => 1,
  3282. RawConv => '$$self{FaceTest2} = $val; $$self{OPTIONS}{Unknown}<2 ? undef : $val',
  3283. },
  3284. 0x03 => {
  3285. Name => 'FacesDetected',
  3286. DataMember => 'FacesDetected',
  3287. RawConv => '$$self{FacesDetected} = ($val > 8 ? 0 : $val); $val',
  3288. ValueConv => '$val > 8 ? 0 : $val',
  3289. },
  3290. 0x08 => {
  3291. Name => 'FaceTest8',
  3292. DataMember => 'FaceTest8',
  3293. Hidden => 1,
  3294. RawConv => '$$self{FaceTest8} = $val; $$self{OPTIONS}{Unknown}<2 ? undef : $val',
  3295. },
  3296. # 0x0b - start of 8 Face Positions of 10 int16u values each
  3297. 0x0b => {
  3298. Name => 'PotentialFace1Position',
  3299. Condition => q{
  3300. $$self{FacesDetected} >= 1 or
  3301. ($$self{FaceTest8} > 0 and ($$self{FaceTest2} == 1 or $$self{FaceTest2} == 257))
  3302. },
  3303. %faceInfo,
  3304. },
  3305. 0x15 => {
  3306. Name => 'PotentialFace2Position',
  3307. Condition => '$$self{FacesDetected} >= 2 or ($$self{FacesDetected} == 1 and $$self{FaceTest8} > 0)',
  3308. %faceInfo,
  3309. },
  3310. 0x1f => {
  3311. Name => 'PotentialFace3Position',
  3312. Condition => '$$self{FacesDetected} >= 3 or ($$self{FacesDetected} == 2 and $$self{FaceTest8} > 0)',
  3313. %faceInfo,
  3314. },
  3315. 0x29 => {
  3316. Name => 'PotentialFace4Position',
  3317. Condition => '$$self{FacesDetected} >= 4 or ($$self{FacesDetected} == 3 and $$self{FaceTest8} > 0)',
  3318. %faceInfo,
  3319. },
  3320. 0x33 => {
  3321. Name => 'PotentialFace5Position',
  3322. Condition => '$$self{FacesDetected} >= 5 or ($$self{FacesDetected} == 4 and $$self{FaceTest8} > 0)',
  3323. %faceInfo,
  3324. },
  3325. 0x3d => {
  3326. Name => 'PotentialFace6Position',
  3327. Condition => '$$self{FacesDetected} >= 6 or ($$self{FacesDetected} == 5 and $$self{FaceTest8} > 0)',
  3328. %faceInfo,
  3329. },
  3330. 0x47 => {
  3331. Name => 'PotentialFace7Position',
  3332. Condition => '$$self{FacesDetected} >= 7 or ($$self{FacesDetected} == 6 and $$self{FaceTest8} > 0)',
  3333. %faceInfo,
  3334. },
  3335. 0x51 => {
  3336. Name => 'PotentialFace8Position',
  3337. Condition => '$$self{FacesDetected} >= 8 or ($$self{FacesDetected} == 7 and $$self{FaceTest8} > 0)',
  3338. %faceInfo,
  3339. },
  3340. # 0x5b - start of max. 4 further Face Positions here
  3341. 0x5b => {
  3342. Name => 'Face1Position',
  3343. Condition => '$$self{FacesDetected} >= 1',
  3344. %faceInfo,
  3345. },
  3346. 0x65 => {
  3347. Name => 'Face2Position',
  3348. Condition => '$$self{FacesDetected} >= 2',
  3349. %faceInfo,
  3350. },
  3351. 0x6f => {
  3352. Name => 'Face3Position',
  3353. Condition => '$$self{FacesDetected} >= 3',
  3354. %faceInfo,
  3355. },
  3356. 0x79 => {
  3357. Name => 'Face4Position',
  3358. Condition => '$$self{FacesDetected} >= 4',
  3359. %faceInfo,
  3360. },
  3361. );
  3362. # Camera settings (ref PH) (decoded mainly from A200)
  3363. %Image::ExifTool::Sony::CameraSettings = (
  3364. %binaryDataAttrs,
  3365. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3366. FORMAT => 'int16u',
  3367. PRIORITY => 0,
  3368. NOTES => 'Camera settings for the A200, A300, A350, A700, A850 and A900.',
  3369. 0x00 => { #JR
  3370. Name => 'ExposureTime',
  3371. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  3372. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  3373. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  3374. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  3375. },
  3376. 0x01 => { #JR
  3377. Name => 'FNumber',
  3378. ValueConv => '2 ** (($val/8 - 1) / 2)',
  3379. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  3380. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  3381. PrintConvInv => '$val',
  3382. },
  3383. 0x02 => { #JR (requires external flash)
  3384. Name => 'HighSpeedSync',
  3385. PrintConv => {
  3386. 0 => 'Off',
  3387. 1 => 'On',
  3388. },
  3389. },
  3390. 0x03 => { #JR
  3391. Name => 'ExposureCompensationSet',
  3392. ValueConv => '($val - 128) / 24',
  3393. ValueConvInv => 'int($val * 24 + 128.5)',
  3394. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3395. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3396. },
  3397. 0x04 => { #7/JR
  3398. Name => 'DriveMode',
  3399. Mask => 0xff, # (not sure what upper byte is for)
  3400. PrintConv => {
  3401. 0x01 => 'Single Frame',
  3402. 0x02 => 'Continuous High', # A700/A900; not on A850
  3403. 0x12 => 'Continuous Low', #JR
  3404. 0x04 => 'Self-timer 10 sec',
  3405. 0x05 => 'Self-timer 2 sec, Mirror Lock-up',
  3406. 0x06 => 'Single-frame Bracketing',
  3407. 0x07 => 'Continuous Bracketing', # (A200 val=0x1107)
  3408. 0x18 => 'White Balance Bracketing Low', #JR
  3409. 0x28 => 'White Balance Bracketing High', #JR
  3410. 0x19 => 'D-Range Optimizer Bracketing Low', #JR
  3411. 0x29 => 'D-Range Optimizer Bracketing High', #JR
  3412. 0x0a => 'Remote Commander', #JR
  3413. 0x0b => 'Mirror Lock-up', #JR (A850/A900; not on A700)
  3414. },
  3415. },
  3416. 0x05 => { #JR
  3417. Name => 'WhiteBalanceSetting',
  3418. PrintConv => {
  3419. 2 => 'Auto',
  3420. 4 => 'Daylight',
  3421. 5 => 'Fluorescent',
  3422. 6 => 'Tungsten',
  3423. 7 => 'Flash',
  3424. 16 => 'Cloudy',
  3425. 17 => 'Shade',
  3426. 18 => 'Color Temperature/Color Filter',
  3427. 32 => 'Custom 1',
  3428. 33 => 'Custom 2',
  3429. 34 => 'Custom 3',
  3430. },
  3431. },
  3432. 0x06 => { #7 (A700) (ref JR: at least also valid for A200, ValueConv as for ColorCompensationFilterSet)
  3433. Name => 'WhiteBalanceFineTune',
  3434. ValueConv => '$val > 128 ? $val - 256 : $val',
  3435. },
  3436. 0x07 => { #JR as set in WB "Color Temperature/Color Filter" and in White Balance Bracketing
  3437. Name => 'ColorTemperatureSet',
  3438. ValueConv => '$val * 100',
  3439. ValueConvInv => '$val / 100',
  3440. PrintConv => '"$val K"',
  3441. PrintConvInv => '$val =~ s/ ?K$//i; $val',
  3442. },
  3443. 0x08 => { #JR as set in WB "Color Temperature/Color Filter"
  3444. Name => 'ColorCompensationFilterSet',
  3445. Notes => 'negative is green, positive is magenta',
  3446. ValueConv => '$val > 128 ? $val - 256 : $val',
  3447. ValueConvInv => '$val < 0 ? $val + 256 : $val',
  3448. PrintConv => '$val > 0 ? "+$val" : $val',
  3449. PrintConvInv => '$val',
  3450. },
  3451. 0x0c => { #JR as set in WB "Custom" and in White Balance Bracketing
  3452. Name => 'ColorTemperatureCustom',
  3453. ValueConv => '$val * 100',
  3454. ValueConvInv => '$val / 100',
  3455. PrintConv => '"$val K"',
  3456. PrintConvInv => '$val =~ s/ ?K$//i; $val',
  3457. },
  3458. 0x0d => { #JR as set in WB "Custom"
  3459. Name => 'ColorCompensationFilterCustom',
  3460. Notes => 'negative is green, positive is magenta',
  3461. ValueConv => '$val > 128 ? $val - 256 : $val',
  3462. ValueConvInv => '$val < 0 ? $val + 256 : $val',
  3463. PrintConv => '$val > 0 ? "+$val" : $val',
  3464. PrintConvInv => '$val',
  3465. },
  3466. 0x0f => { #JR
  3467. Name => 'WhiteBalance',
  3468. PrintConv => {
  3469. 2 => 'Auto',
  3470. 4 => 'Daylight',
  3471. 5 => 'Fluorescent',
  3472. 6 => 'Tungsten',
  3473. 7 => 'Flash',
  3474. 12 => 'Color Temperature',
  3475. 13 => 'Color Filter',
  3476. 14 => 'Custom',
  3477. 16 => 'Cloudy',
  3478. 17 => 'Shade',
  3479. },
  3480. },
  3481. 0x10 => { #7 (A700)
  3482. Name => 'FocusModeSetting',
  3483. PrintConv => {
  3484. 0 => 'Manual',
  3485. 1 => 'AF-S',
  3486. 2 => 'AF-C',
  3487. 3 => 'AF-A',
  3488. 4 => 'DMF', #JR
  3489. },
  3490. },
  3491. 0x11 => { #JD (A700)
  3492. Name => 'AFAreaMode',
  3493. PrintConv => {
  3494. 0 => 'Wide',
  3495. 1 => 'Local',
  3496. 2 => 'Spot',
  3497. },
  3498. },
  3499. 0x12 => { #7 (A700)
  3500. Name => 'AFPointSetting',
  3501. Format => 'int16u',
  3502. # The AF point as selected by the user in AFAreaMode=Local or Spot;
  3503. # Reported value remains at the last-set position in AFAreaModes=Wide.
  3504. # A200, A300, A350: 9-point centre-cross (ref JR)
  3505. # A700: 11-point centre-dual-cross (ref JR)
  3506. # A850, A900: 9-point centre-dual-cross with 10 assist-points (ref JR)
  3507. PrintConvColumns => 2,
  3508. PrintConv => {
  3509. 1 => 'Center',
  3510. 2 => 'Top',
  3511. 3 => 'Upper-right',
  3512. 4 => 'Right',
  3513. 5 => 'Lower-right',
  3514. 6 => 'Bottom',
  3515. 7 => 'Lower-left',
  3516. 8 => 'Left',
  3517. 9 => 'Upper-left',
  3518. 10 => 'Far Right', # (presumably A700 only)
  3519. 11 => 'Far Left', # (presumably A700 only)
  3520. },
  3521. },
  3522. 0x13 => { #JR
  3523. Name => 'FlashMode',
  3524. PrintConv => {
  3525. 0 => 'Autoflash',
  3526. 2 => 'Rear Sync',
  3527. 3 => 'Wireless',
  3528. 4 => 'Fill-flash',
  3529. 5 => 'Flash Off',
  3530. 6 => 'Slow Sync',
  3531. },
  3532. },
  3533. 0x14 => { #JR
  3534. Name => 'FlashExposureCompSet',
  3535. Description => 'Flash Exposure Comp. Setting',
  3536. # (as pre-selected by the user, not zero if flash didn't fire)
  3537. ValueConv => '($val - 128) / 24', #PH
  3538. ValueConvInv => 'int($val * 24 + 128.5)',
  3539. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3540. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3541. },
  3542. 0x15 => { #7
  3543. Name => 'MeteringMode',
  3544. PrintConv => {
  3545. 1 => 'Multi-segment',
  3546. 2 => 'Center-weighted Average',
  3547. 4 => 'Spot',
  3548. },
  3549. },
  3550. 0x16 => {
  3551. Name => 'ISOSetting',
  3552. # 0 indicates 'Auto' (I think)
  3553. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  3554. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  3555. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  3556. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  3557. },
  3558. 0x18 => { #7
  3559. Name => 'DynamicRangeOptimizerMode',
  3560. PrintConv => {
  3561. 0 => 'Off',
  3562. 1 => 'Standard',
  3563. 2 => 'Advanced Auto',
  3564. 3 => 'Advanced Level',
  3565. },
  3566. },
  3567. 0x19 => { #7
  3568. Name => 'DynamicRangeOptimizerLevel',
  3569. },
  3570. 0x1a => { # style actually used (combination of mode dial + creative style menu)
  3571. Name => 'CreativeStyle',
  3572. PrintConvColumns => 2,
  3573. PrintConv => {
  3574. 1 => 'Standard',
  3575. 2 => 'Vivid',
  3576. 3 => 'Portrait',
  3577. 4 => 'Landscape',
  3578. 5 => 'Sunset',
  3579. 6 => 'Night View/Portrait',
  3580. 8 => 'B&W',
  3581. 9 => 'Adobe RGB', # A700
  3582. 11 => 'Neutral',
  3583. 12 => 'Clear', #7
  3584. 13 => 'Deep', #7
  3585. 14 => 'Light', #7
  3586. 15 => 'Autumn Leaves', #7
  3587. 16 => 'Sepia', #7
  3588. },
  3589. },
  3590. 0x1b => { #JR
  3591. Name => 'ColorSpace',
  3592. PrintConv => {
  3593. 0 => 'sRGB',
  3594. 1 => 'Adobe RGB', # (A850, selected via Colorspace menu item)
  3595. 5 => 'Adobe RGB (A700)', # (A700, selected via CreativeStyle menu)
  3596. },
  3597. },
  3598. 0x1c => {
  3599. Name => 'Sharpness',
  3600. ValueConv => '$val - 10',
  3601. ValueConvInv => '$val + 10',
  3602. PrintConv => '$val > 0 ? "+$val" : $val',
  3603. PrintConvInv => '$val',
  3604. },
  3605. 0x1d => {
  3606. Name => 'Contrast',
  3607. ValueConv => '$val - 10',
  3608. ValueConvInv => '$val + 10',
  3609. PrintConv => '$val > 0 ? "+$val" : $val',
  3610. PrintConvInv => '$val',
  3611. },
  3612. 0x1e => {
  3613. Name => 'Saturation',
  3614. ValueConv => '$val - 10',
  3615. ValueConvInv => '$val + 10',
  3616. PrintConv => '$val > 0 ? "+$val" : $val',
  3617. PrintConvInv => '$val',
  3618. },
  3619. 0x1f => { #7
  3620. Name => 'ZoneMatchingValue',
  3621. ValueConv => '$val - 10',
  3622. ValueConvInv => '$val + 10',
  3623. PrintConv => '$val > 0 ? "+$val" : $val',
  3624. PrintConvInv => '$val',
  3625. },
  3626. 0x22 => { #7
  3627. Name => 'Brightness',
  3628. ValueConv => '$val - 10',
  3629. ValueConvInv => '$val + 10',
  3630. PrintConv => '$val > 0 ? "+$val" : $val',
  3631. PrintConvInv => '$val',
  3632. },
  3633. 0x23 => {
  3634. Name => 'FlashControl',
  3635. PrintConv => {
  3636. 0 => 'ADI',
  3637. 1 => 'Pre-flash TTL',
  3638. 2 => 'Manual',
  3639. },
  3640. },
  3641. 0x28 => { #7
  3642. Name => 'PrioritySetupShutterRelease',
  3643. PrintConv => {
  3644. 0 => 'AF',
  3645. 1 => 'Release',
  3646. },
  3647. },
  3648. 0x29 => { #7
  3649. Name => 'AFIlluminator',
  3650. PrintConv => {
  3651. 0 => 'Auto',
  3652. 1 => 'Off',
  3653. },
  3654. },
  3655. 0x2a => { #7
  3656. Name => 'AFWithShutter',
  3657. PrintConv => { 0 => 'On', 1 => 'Off' },
  3658. },
  3659. 0x2b => { #7
  3660. Name => 'LongExposureNoiseReduction',
  3661. PrintConv => { 0 => 'Off', 1 => 'On' },
  3662. },
  3663. 0x2c => { #7
  3664. Name => 'HighISONoiseReduction',
  3665. PrintConv => {
  3666. 0 => 'Normal',
  3667. 1 => 'Low',
  3668. 2 => 'High',
  3669. 3 => 'Off',
  3670. },
  3671. },
  3672. 0x2d => { #7
  3673. Name => 'ImageStyle',
  3674. PrintConvColumns => 2,
  3675. PrintConv => {
  3676. 1 => 'Standard',
  3677. 2 => 'Vivid',
  3678. 3 => 'Portrait', #PH
  3679. 4 => 'Landscape', #PH
  3680. 5 => 'Sunset', #PH
  3681. 7 => 'Night View/Portrait', #PH (A200/A350 when CreativeStyle was 6!)
  3682. 8 => 'B&W', #PH (guess)
  3683. 9 => 'Adobe RGB',
  3684. 11 => 'Neutral',
  3685. 129 => 'StyleBox1',
  3686. 130 => 'StyleBox2',
  3687. 131 => 'StyleBox3',
  3688. 132 => 'StyleBox4', #JR (A850)
  3689. 133 => 'StyleBox5', #JR (A850)
  3690. 134 => 'StyleBox6', #JR (A850)
  3691. },
  3692. },
  3693. 0x2e => { #JR (may not apply to A200/A300/A350 -- they don't have the AF/MF button)
  3694. Name => 'FocusModeSwitch',
  3695. PrintConv => {
  3696. 0 => 'AF',
  3697. 1 => 'Manual',
  3698. },
  3699. },
  3700. 0x2f => { #JR
  3701. Name => 'ShutterSpeedSetting',
  3702. Notes => 'used in M, S and Program Shift S modes',
  3703. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  3704. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  3705. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  3706. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  3707. },
  3708. 0x30 => { #JR
  3709. Name => 'ApertureSetting',
  3710. Notes => 'used in M, A and Program Shift A modes',
  3711. ValueConv => '2 ** (($val/8 - 1) / 2)',
  3712. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  3713. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  3714. PrintConvInv => '$val',
  3715. },
  3716. 0x3c => {
  3717. Name => 'ExposureProgram',
  3718. SeparateTable => 'ExposureProgram',
  3719. PrintConv => \%sonyExposureProgram,
  3720. },
  3721. 0x3d => {
  3722. Name => 'ImageStabilizationSetting',
  3723. PrintConv => { 0 => 'Off', 1 => 'On' },
  3724. },
  3725. 0x3e => { #JR
  3726. Name => 'FlashAction',
  3727. PrintConv => {
  3728. 0 => 'Did not fire',
  3729. 1 => 'Fired',
  3730. 2 => 'External Flash, Did not fire',
  3731. 3 => 'External Flash, Fired',
  3732. },
  3733. },
  3734. 0x3f => { # (verified for A330/A380)
  3735. Name => 'Rotation',
  3736. PrintConv => {
  3737. 0 => 'Horizontal (normal)',
  3738. 1 => 'Rotate 90 CW', #(NC)
  3739. 2 => 'Rotate 270 CW',
  3740. },
  3741. },
  3742. 0x40 => { #JR
  3743. Name => 'AELock',
  3744. PrintConv => {
  3745. 1 => 'Off',
  3746. 2 => 'On',
  3747. },
  3748. },
  3749. 0x4c => { #JR
  3750. Name => 'FlashAction2',
  3751. PrintConv => {
  3752. 1 => 'Fired, Autoflash',
  3753. 2 => 'Fired, Fill-flash',
  3754. 3 => 'Fired, Rear Sync',
  3755. 4 => 'Fired, Wireless',
  3756. 5 => 'Did not fire',
  3757. 6 => 'Fired, Slow Sync',
  3758. 17 => 'Fired, Autoflash, Red-eye reduction',
  3759. 18 => 'Fired, Fill-flash, Red-eye reduction',
  3760. 34 => 'Fired, Fill-flash, HSS',
  3761. },
  3762. },
  3763. 0x4d => { #JR
  3764. Name => 'FocusMode', # (focus mode actually used)
  3765. PrintConv => {
  3766. 0 => 'Manual',
  3767. 1 => 'AF-S',
  3768. 2 => 'AF-C',
  3769. 3 => 'AF-A',
  3770. 4 => 'DMF', #JR
  3771. },
  3772. },
  3773. 0x50 => { #JR
  3774. Name => 'BatteryState',
  3775. PrintConv => {
  3776. 2 => 'Empty', # 0%
  3777. 3 => 'Very Low', # 1 - 20%
  3778. 4 => 'Low', # 21 - 50%
  3779. 5 => 'Sufficient', # 51 - 80%
  3780. 6 => 'Full', # > 80%
  3781. },
  3782. },
  3783. 0x51 => { #JR
  3784. Name => 'BatteryLevel',
  3785. PrintConv => '"$val%"',
  3786. PrintConvInv => '$val=~s/\s*\%//; $val',
  3787. },
  3788. 0x53 => { #JR
  3789. Name => 'FocusStatus',
  3790. PrintConv => {
  3791. 0 => 'Not confirmed',
  3792. 4 => 'Not confirmed, Tracking',
  3793. BITMASK => {
  3794. 0 => 'Confirmed',
  3795. 1 => 'Failed',
  3796. 2 => 'Tracking',
  3797. },
  3798. },
  3799. },
  3800. 0x54 => {
  3801. Name => 'SonyImageSize',
  3802. PrintConv => {
  3803. 1 => 'Large',
  3804. 2 => 'Medium',
  3805. 3 => 'Small',
  3806. },
  3807. },
  3808. 0x55 => { #7
  3809. Name => 'AspectRatio',
  3810. PrintConv => {
  3811. 1 => '3:2',
  3812. 2 => '16:9',
  3813. },
  3814. },
  3815. 0x56 => { #PH/7
  3816. Name => 'Quality',
  3817. PrintConv => {
  3818. 0 => 'RAW',
  3819. 2 => 'CRAW',
  3820. 34 => 'RAW + JPEG',
  3821. 35 => 'CRAW + JPEG',
  3822. 16 => 'Extra Fine',
  3823. 32 => 'Fine',
  3824. 48 => 'Standard',
  3825. },
  3826. },
  3827. 0x58 => { #7
  3828. Name => 'ExposureLevelIncrements',
  3829. PrintConv => {
  3830. 33 => '1/3 EV',
  3831. 50 => '1/2 EV',
  3832. },
  3833. },
  3834. 0x6a => { #JR
  3835. Name => 'RedEyeReduction',
  3836. PrintConv => {
  3837. 0 => 'Off',
  3838. 1 => 'On',
  3839. },
  3840. },
  3841. 0x9a => { #JR
  3842. Name => 'FolderNumber',
  3843. Mask => 0x03ff, # (not sure what the upper 6 bits are for)
  3844. PrintConv => 'sprintf("%.3d",$val)',
  3845. PrintConvInv => '$val',
  3846. },
  3847. 0x9b => { #JR
  3848. Name => 'ImageNumber',
  3849. Mask => 0x3fff, # (not sure what the upper 2 bits are for)
  3850. PrintConv => 'sprintf("%.4d",$val)',
  3851. PrintConvInv => '$val',
  3852. },
  3853. );
  3854. # Camera settings (ref PH) (A230, A290, A330, A380 and A390)
  3855. %Image::ExifTool::Sony::CameraSettings2 = (
  3856. %binaryDataAttrs,
  3857. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  3858. FORMAT => 'int16u',
  3859. PRIORITY => 0,
  3860. NOTES => 'Camera settings for the A230, A290, A330, A380 and A390.',
  3861. ### 0x00-0x03: same TagID as CameraSettings
  3862. 0x00 => { #JR
  3863. Name => 'ExposureTime',
  3864. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  3865. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  3866. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  3867. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  3868. },
  3869. 0x01 => { #JR
  3870. Name => 'FNumber',
  3871. ValueConv => '2 ** (($val/8 - 1) / 2)',
  3872. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  3873. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  3874. PrintConvInv => '$val',
  3875. },
  3876. 0x02 => { #JR (requires external flash)
  3877. Name => 'HighSpeedSync',
  3878. PrintConv => {
  3879. 0 => 'Off',
  3880. 1 => 'On',
  3881. },
  3882. },
  3883. 0x03 => { #JR
  3884. Name => 'ExposureCompensationSet',
  3885. ValueConv => '($val - 128) / 24',
  3886. ValueConvInv => 'int($val * 24 + 128.5)',
  3887. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  3888. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  3889. },
  3890. ### 0x04-0x11: subtract 1 from CameraSettings TagID
  3891. 0x04 => { #JR
  3892. Name => 'WhiteBalanceSetting',
  3893. PrintConv => {
  3894. 2 => 'Auto',
  3895. 4 => 'Daylight',
  3896. 5 => 'Fluorescent',
  3897. 6 => 'Tungsten',
  3898. 7 => 'Flash',
  3899. 16 => 'Cloudy',
  3900. 17 => 'Shade',
  3901. 18 => 'Color Temperature/Color Filter',
  3902. 32 => 'Custom 1',
  3903. 33 => 'Custom 2',
  3904. 34 => 'Custom 3',
  3905. },
  3906. },
  3907. 0x05 => { #JR
  3908. Name => 'WhiteBalanceFineTune',
  3909. ValueConv => '$val > 128 ? $val - 256 : $val',
  3910. },
  3911. 0x06 => { #JR as set in WB "Color Temperature/Color Filter" and in White Balance Bracketing
  3912. Name => 'ColorTemperatureSet',
  3913. ValueConv => '$val * 100',
  3914. ValueConvInv => '$val / 100',
  3915. PrintConv => '"$val K"',
  3916. PrintConvInv => '$val =~ s/ ?K$//i; $val',
  3917. },
  3918. 0x07 => { #JR as set in WB "Color Temperature/Color Filter"
  3919. Name => 'ColorCompensationFilterSet',
  3920. Notes => 'negative is green, positive is magenta',
  3921. ValueConv => '$val > 128 ? $val - 256 : $val',
  3922. ValueConvInv => '$val < 0 ? $val + 256 : $val',
  3923. PrintConv => '$val > 0 ? "+$val" : $val',
  3924. PrintConvInv => '$val',
  3925. },
  3926. 0x08 => { #JR
  3927. Name => 'CustomWB_RGBLevels',
  3928. Format => 'int16u[3]',
  3929. },
  3930. 0x0b => { #JR as set in WB "Custom" and in White Balance Bracketing
  3931. Name => 'ColorTemperatureCustom',
  3932. ValueConv => '$val * 100',
  3933. ValueConvInv => '$val / 100',
  3934. PrintConv => '"$val K"',
  3935. PrintConvInv => '$val =~ s/ ?K$//i; $val',
  3936. },
  3937. 0x0c => { #JR as set in WB "Custom"
  3938. Name => 'ColorCompensationFilterCustom',
  3939. Notes => 'negative is green, positive is magenta',
  3940. ValueConv => '$val > 128 ? $val - 256 : $val',
  3941. ValueConvInv => '$val < 0 ? $val + 256 : $val',
  3942. PrintConv => '$val > 0 ? "+$val" : $val',
  3943. PrintConvInv => '$val',
  3944. },
  3945. 0x0e => { #JR
  3946. Name => 'WhiteBalance',
  3947. PrintConv => {
  3948. 2 => 'Auto',
  3949. 4 => 'Daylight',
  3950. 5 => 'Fluorescent',
  3951. 6 => 'Tungsten',
  3952. 7 => 'Flash',
  3953. 12 => 'Color Temperature',
  3954. 13 => 'Color Filter',
  3955. 14 => 'Custom',
  3956. 16 => 'Cloudy',
  3957. 17 => 'Shade',
  3958. },
  3959. },
  3960. 0x0f => { #JR/PH (educated guess)
  3961. Name => 'FocusModeSetting',
  3962. PrintConv => {
  3963. 0 => 'Manual',
  3964. 1 => 'AF-S',
  3965. 2 => 'AF-C',
  3966. 3 => 'AF-A',
  3967. # seen 5 for A380 (FocusMode was Manual and FocusStatus was Confirmed)
  3968. },
  3969. },
  3970. 0x10 => { #JR/PH (educated guess)
  3971. Name => 'AFAreaMode',
  3972. PrintConv => {
  3973. 0 => 'Wide',
  3974. 1 => 'Local',
  3975. 2 => 'Spot',
  3976. },
  3977. },
  3978. 0x11 => { #JR/PH (educated guess)
  3979. Name => 'AFPointSetting',
  3980. Format => 'int16u',
  3981. # The AF point as selected by the user in AFAreaMode=Local or Spot;
  3982. # Reported value remains at the last-set position in AFAreaModes=Wide.
  3983. # (all of these cameras have a 9-point centre-cross AF system, ref JR)
  3984. PrintConvColumns => 2,
  3985. PrintConv => {
  3986. 1 => 'Center',
  3987. 2 => 'Top',
  3988. 3 => 'Upper-right',
  3989. 4 => 'Right',
  3990. 5 => 'Lower-right',
  3991. 6 => 'Bottom',
  3992. 7 => 'Lower-left',
  3993. 8 => 'Left',
  3994. 9 => 'Upper-left',
  3995. },
  3996. },
  3997. ### 0x12-0x18: subtract 2 from CameraSettings TagID
  3998. 0x12 => { #JR
  3999. Name => 'FlashExposureCompSet',
  4000. Description => 'Flash Exposure Comp. Setting',
  4001. # (as pre-selected by the user, not zero if flash didn't fire)
  4002. ValueConv => '($val - 128) / 24', #PH
  4003. ValueConvInv => 'int($val * 24 + 128.5)',
  4004. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  4005. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4006. },
  4007. 0x13 => {
  4008. Name => 'MeteringMode',
  4009. PrintConv => {
  4010. 1 => 'Multi-segment',
  4011. 2 => 'Center-weighted Average',
  4012. 4 => 'Spot',
  4013. },
  4014. },
  4015. 0x14 => { # A330/A380
  4016. Name => 'ISOSetting',
  4017. # 0 indicates 'Auto' (?)
  4018. ValueConv => '$val ? exp(($val/8-6)*log(2))*100 : $val',
  4019. ValueConvInv => '$val ? 8*(log($val/100)/log(2)+6) : $val',
  4020. PrintConv => '$val ? sprintf("%.0f",$val) : "Auto"',
  4021. PrintConvInv => '$val =~ /auto/i ? 0 : $val',
  4022. },
  4023. 0x16 => {
  4024. Name => 'DynamicRangeOptimizerMode',
  4025. PrintConv => {
  4026. 0 => 'Off',
  4027. 1 => 'Standard',
  4028. 2 => 'Advanced Auto',
  4029. 3 => 'Advanced Level',
  4030. },
  4031. },
  4032. 0x17 => 'DynamicRangeOptimizerLevel',
  4033. 0x18 => { # A380
  4034. Name => 'CreativeStyle',
  4035. PrintConvColumns => 2,
  4036. PrintConv => {
  4037. 1 => 'Standard',
  4038. 2 => 'Vivid',
  4039. 3 => 'Portrait',
  4040. 4 => 'Landscape',
  4041. 5 => 'Sunset',
  4042. 6 => 'Night View/Portrait',
  4043. 8 => 'B&W',
  4044. # (these models don't have Neutral - PH)
  4045. },
  4046. },
  4047. ### 0x19-0x1b: subtract 3 from CameraSettings TagID
  4048. 0x19 => {
  4049. Name => 'Sharpness',
  4050. ValueConv => '$val - 10',
  4051. ValueConvInv => '$val + 10',
  4052. PrintConv => '$val > 0 ? "+$val" : $val',
  4053. PrintConvInv => '$val',
  4054. },
  4055. 0x1a => {
  4056. Name => 'Contrast',
  4057. ValueConv => '$val - 10',
  4058. ValueConvInv => '$val + 10',
  4059. PrintConv => '$val > 0 ? "+$val" : $val',
  4060. PrintConvInv => '$val',
  4061. },
  4062. 0x1b => {
  4063. Name => 'Saturation',
  4064. ValueConv => '$val - 10',
  4065. ValueConvInv => '$val + 10',
  4066. PrintConv => '$val > 0 ? "+$val" : $val',
  4067. PrintConvInv => '$val',
  4068. },
  4069. ### 0x1c-0x24: subtract 4 from CameraSettings TagID (not sure about 0x1c)
  4070. 0x1f => { #PH (educated guess)
  4071. Name => 'FlashControl',
  4072. PrintConv => {
  4073. 0 => 'ADI',
  4074. 1 => 'Pre-flash TTL',
  4075. 2 => 'Manual',
  4076. },
  4077. },
  4078. ### 0x25-0x27: subtract 6 from CameraSettings TagID
  4079. 0x25 => { #PH
  4080. Name => 'LongExposureNoiseReduction',
  4081. PrintConv => { 0 => 'Off', 1 => 'On' },
  4082. },
  4083. 0x26 => { #PH
  4084. Name => 'HighISONoiseReduction',
  4085. # (Note: the order is different from that in CameraSettings)
  4086. PrintConv => {
  4087. 0 => 'Off',
  4088. 1 => 'Low',
  4089. 2 => 'Normal',
  4090. 3 => 'High',
  4091. },
  4092. },
  4093. 0x27 => { #PH
  4094. Name => 'ImageStyle',
  4095. PrintConvColumns => 2,
  4096. PrintConv => {
  4097. 1 => 'Standard',
  4098. 2 => 'Vivid',
  4099. 3 => 'Portrait', #PH
  4100. 4 => 'Landscape', #PH
  4101. 5 => 'Sunset', #PH
  4102. 7 => 'Night View/Portrait', #PH (A200 when CreativeStyle was 6!)
  4103. 8 => 'B&W', #PH (A380)
  4104. # (these models don't have Neutral - PH)
  4105. },
  4106. },
  4107. ### 0x28-0x3b: subtract 7 from CameraSettings TagID
  4108. 0x28 => { #PH
  4109. Name => 'ShutterSpeedSetting',
  4110. Notes => 'used in M, S and Program Shift S modes',
  4111. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  4112. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  4113. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  4114. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  4115. },
  4116. 0x29 => { #PH
  4117. Name => 'ApertureSetting',
  4118. Notes => 'used in M, A and Program Shift A modes',
  4119. ValueConv => '2 ** (($val/8 - 1) / 2)',
  4120. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  4121. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  4122. PrintConvInv => '$val',
  4123. },
  4124. ### 0x3c-0x59: same TagID as CameraSettings
  4125. 0x3c => {
  4126. Name => 'ExposureProgram',
  4127. SeparateTable => 'ExposureProgram',
  4128. PrintConv => \%sonyExposureProgram,
  4129. },
  4130. 0x3d => { # (copied from CameraSettings, ref JR)
  4131. Name => 'ImageStabilizationSetting',
  4132. PrintConv => { 0 => 'Off', 1 => 'On' },
  4133. },
  4134. 0x3e => { #JR
  4135. Name => 'FlashAction',
  4136. PrintConv => {
  4137. 0 => 'Did not fire',
  4138. 1 => 'Fired',
  4139. 2 => 'External Flash, Did not fire',
  4140. 3 => 'External Flash, Fired',
  4141. },
  4142. },
  4143. 0x3f => { # (verified for A330/A380)
  4144. Name => 'Rotation',
  4145. PrintConv => {
  4146. 0 => 'Horizontal (normal)',
  4147. 1 => 'Rotate 90 CW', #(NC)
  4148. 2 => 'Rotate 270 CW',
  4149. },
  4150. },
  4151. 0x40 => { #JR
  4152. Name => 'AELock',
  4153. PrintConv => {
  4154. 1 => 'Off',
  4155. 2 => 'On',
  4156. },
  4157. },
  4158. 0x4c => { #JR
  4159. Name => 'FlashAction2',
  4160. PrintConv => {
  4161. 1 => 'Fired, Autoflash',
  4162. 2 => 'Fired, Fill-flash',
  4163. 3 => 'Fired, Rear Sync',
  4164. 4 => 'Fired, Wireless',
  4165. 5 => 'Did not fire',
  4166. 6 => 'Fired, Slow Sync',
  4167. 17 => 'Fired, Autoflash, Red-eye reduction',
  4168. 18 => 'Fired, Fill-flash, Red-eye reduction',
  4169. 34 => 'Fired, Fill-flash, HSS',
  4170. },
  4171. },
  4172. 0x4d => { #JR
  4173. Name => 'FocusMode', # (focus mode actually used)
  4174. PrintConv => {
  4175. 0 => 'Manual',
  4176. 1 => 'AF-S',
  4177. 2 => 'AF-C',
  4178. 3 => 'AF-A',
  4179. },
  4180. },
  4181. 0x53 => { #JR (copied from CameraSettings, but all bits may not be applicable for these models)
  4182. Name => 'FocusStatus',
  4183. PrintConv => {
  4184. 0 => 'Not confirmed',
  4185. 4 => 'Not confirmed, Tracking',
  4186. BITMASK => {
  4187. 0 => 'Confirmed',
  4188. 1 => 'Failed',
  4189. 2 => 'Tracking',
  4190. },
  4191. },
  4192. },
  4193. 0x54 => {
  4194. Name => 'SonyImageSize',
  4195. PrintConv => {
  4196. 1 => 'Large',
  4197. 2 => 'Medium',
  4198. 3 => 'Small',
  4199. },
  4200. },
  4201. 0x55 => { # (copied from CameraSettings, ref JR)
  4202. Name => 'AspectRatio',
  4203. PrintConv => {
  4204. 1 => '3:2',
  4205. 2 => '16:9',
  4206. },
  4207. },
  4208. 0x56 => { # (copied from CameraSettings, ref JR)
  4209. Name => 'Quality',
  4210. PrintConv => {
  4211. 0 => 'RAW',
  4212. 2 => 'CRAW',
  4213. 34 => 'RAW + JPEG',
  4214. 35 => 'CRAW + JPEG',
  4215. 16 => 'Extra Fine',
  4216. 32 => 'Fine',
  4217. 48 => 'Standard',
  4218. },
  4219. },
  4220. 0x58 => { # (copied from CameraSettings, ref JR)
  4221. Name => 'ExposureLevelIncrements',
  4222. PrintConv => {
  4223. 33 => '1/3 EV',
  4224. 50 => '1/2 EV',
  4225. },
  4226. },
  4227. ### 0x5a onwards: subtract 1 from CameraSettings TagID
  4228. # (0x69 not confirmed)
  4229. #0x69 => { #JR
  4230. # Name => 'RedEyeReduction',
  4231. # PrintConv => {
  4232. # 0 => 'Off',
  4233. # 1 => 'On',
  4234. # },
  4235. #},
  4236. 0x7e => { #JR
  4237. Name => 'DriveMode',
  4238. Mask => 0xff, # (not sure what upper byte is for)
  4239. PrintConv => { # (values confirmed for specified models - PH)
  4240. 0x01 => 'Single Frame', # (A230,A330,A380)
  4241. 0x02 => 'Continuous High', #PH (A230,A330)
  4242. 0x04 => 'Self-timer 10 sec', # (A230)
  4243. 0x05 => 'Self-timer 2 sec, Mirror Lock-up', # (A230,A290,A330,A380,390)
  4244. 0x07 => 'Continuous Bracketing', # (A230 val=0x1107, A330 val=0x1307 [0.7 EV])
  4245. 0x0a => 'Remote Commander', # (A230)
  4246. 0x0b => 'Continuous Self-timer', # (A230 val=0x800b [5 shots], A330 val=0x400b [3 shots])
  4247. },
  4248. },
  4249. 0x7f => { #JR
  4250. Name => 'FlashMode',
  4251. PrintConv => {
  4252. 0 => 'Autoflash',
  4253. 2 => 'Rear Sync',
  4254. 3 => 'Wireless',
  4255. 4 => 'Fill-flash',
  4256. 5 => 'Flash Off',
  4257. 6 => 'Slow Sync',
  4258. },
  4259. },
  4260. 0x83 => { #PH
  4261. Name => 'ColorSpace',
  4262. PrintConv => {
  4263. 5 => 'Adobe RGB',
  4264. 6 => 'sRGB',
  4265. },
  4266. },
  4267. );
  4268. # more Camera settings (ref PH)
  4269. # This was decoded for the A55, but it seems to apply to the following models:
  4270. # A33, A35, A55, A450, A500, A550, A560, A580, NEX-3, NEX-5, NEX-C3 and NEX-VG10E
  4271. %Image::ExifTool::Sony::CameraSettings3 = (
  4272. %binaryDataAttrs,
  4273. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4274. FORMAT => 'int8u',
  4275. PRIORITY => 0,
  4276. DATAMEMBER => [ 0x99 ],
  4277. NOTES => q{
  4278. Camera settings for models such as the A33, A35, A55, A450, A500, A550,
  4279. A560, A580, NEX-3, NEX-5, NEX-C3 and NEX-VG10E.
  4280. },
  4281. 0x00 => { #JR
  4282. Name => 'ShutterSpeedSetting',
  4283. Notes => 'used only in M and S exposure modes',
  4284. ValueConv => '$val ? 2 ** (6 - $val/8) : 0',
  4285. ValueConvInv => '$val ? int((6 - log($val) / log(2)) * 8 + 0.5) : 0',
  4286. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  4287. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  4288. },
  4289. 0x01 => { #JR
  4290. Name => 'ApertureSetting',
  4291. Notes => 'used only in M and A exposure modes',
  4292. ValueConv => '2 ** (($val/8 - 1) / 2)',
  4293. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  4294. PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)',
  4295. PrintConvInv => '$val',
  4296. },
  4297. 0x02 => {
  4298. Name => 'ISOSetting',
  4299. ValueConv => '($val and $val < 254) ? exp(($val/8-6)*log(2))*100 : $val',
  4300. ValueConvInv => '($val and $val != 254) ? 8*(log($val/100)/log(2)+6) : $val',
  4301. PrintConv => {
  4302. OTHER => sub {
  4303. my ($val, $inv) = @_;
  4304. return int($val + 0.5) unless $inv;
  4305. return Image::ExifTool::IsFloat($val) ? $val : undef;
  4306. },
  4307. 0 => 'Auto',
  4308. 254 => 'n/a', # get this for multi-shot noise reduction
  4309. },
  4310. },
  4311. 0x03 => { #JR
  4312. Name => 'ExposureCompensationSet',
  4313. ValueConv => '($val - 128) / 24', #PH
  4314. ValueConvInv => 'int($val * 24 + 128.5)',
  4315. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  4316. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4317. },
  4318. 0x04 => { #JR
  4319. Name => 'DriveModeSetting',
  4320. # Same drivemode info is repeated in 0x0034, but with at least the following exceptions:
  4321. # - 0x0034 not for A550 ? - seen "0"
  4322. # - hand-held night (0x05=56): 0x0004=0x10 and 0x0034=0xd3
  4323. # - 3D sweep panorama (0x05=57): 0x0004=0x10 and 0x0034=0xd6
  4324. # - sweep panorama (0x05=80): 0x0004=0x10 and 0x0034=0xd5
  4325. # preliminary conclusion: 0x0004 is Drivemode as pre-set, but may be overruled by Scene/Panorama mode selections
  4326. # 0x0034 is Divemode as actually used
  4327. PrintHex => 1,
  4328. PrintConv => {
  4329. 0x10 => 'Single Frame',
  4330. 0x21 => 'Continuous High', # also automatically selected for Scene mode Sports-action (0x05=52)
  4331. 0x22 => 'Continuous Low',
  4332. 0x30 => 'Speed Priority Continuous',
  4333. 0x51 => 'Self-timer 10 sec',
  4334. 0x52 => 'Self-timer 2 sec, Mirror Lock-up',
  4335. 0x71 => 'Continuous Bracketing 0.3 EV',
  4336. 0x75 => 'Continuous Bracketing 0.7 EV',
  4337. 0x91 => 'White Balance Bracketing Low',
  4338. 0x92 => 'White Balance Bracketing High',
  4339. 0xc0 => 'Remote Commander',
  4340. },
  4341. },
  4342. 0x05 => { #JR
  4343. Name => 'ExposureProgram',
  4344. # Camera exposure program/mode as selected with the Mode dial.
  4345. # For SCN a further selection is done via the menu
  4346. # Matches OK with 0xb023
  4347. SeparateTable => 'ExposureProgram2',
  4348. PrintConv => \%sonyExposureProgram2,
  4349. },
  4350. 0x06 => { #JR
  4351. Name => 'FocusModeSetting',
  4352. PrintConv => {
  4353. 17 => 'AF-S',
  4354. 18 => 'AF-C',
  4355. 19 => 'AF-A',
  4356. 32 => 'Manual',
  4357. 48 => 'DMF', # (NC) (seen for NEX-5)
  4358. },
  4359. },
  4360. 0x07 => { #JR
  4361. Name => 'MeteringMode',
  4362. PrintConv => {
  4363. 1 => 'Multi-segment',
  4364. 2 => 'Center-weighted average',
  4365. 3 => 'Spot',
  4366. },
  4367. },
  4368. 0x09 => { #JR
  4369. Name => 'SonyImageSize',
  4370. PrintConv => { # values confirmed as noted for the A580 and A33
  4371. 21 => 'Large (3:2)', # A580: 16M (4912x3264), A33: 14M (4592x3056)
  4372. 22 => 'Medium (3:2)', # A580: 8.4M (3568x2368), A33: 7.4M (3344x2224)
  4373. 23 => 'Small (3:2)', # A580: 4.0M (2448x1624), A33: 3.5M (2288x1520)
  4374. 25 => 'Large (16:9)', # A580: 14M (4912x2760)
  4375. 26 => 'Medium (16:9)', # A580: 7.1M (3568x2000)
  4376. 27 => 'Small (16:9)', # A580: 3.4M (2448x1376)
  4377. },
  4378. },
  4379. 0x0a => { #JR
  4380. Name => 'AspectRatio',
  4381. # normally 4 for A580 3:2 ratio images
  4382. # seen 8 when selecting 16:9 via menu, and when selecting Panorama mode
  4383. PrintConv => {
  4384. 4 => '3:2',
  4385. 8 => '16:9',
  4386. },
  4387. },
  4388. 0x0b => { #JR
  4389. Name => 'Quality',
  4390. PrintConv => {
  4391. 2 => 'RAW',
  4392. 4 => 'RAW + JPEG',
  4393. 6 => 'Fine',
  4394. 7 => 'Standard',
  4395. },
  4396. },
  4397. 0x0c => {
  4398. Name => 'DynamicRangeOptimizerSetting',
  4399. PrintConv => {
  4400. 1 => 'Off',
  4401. 16 => 'On (Auto)',
  4402. 17 => 'On (Manual)',
  4403. },
  4404. },
  4405. 0x0d => 'DynamicRangeOptimizerLevel',
  4406. 0x0e => { #JR
  4407. Name => 'ColorSpace',
  4408. PrintConv => {
  4409. 1 => 'sRGB',
  4410. 2 => 'Adobe RGB',
  4411. },
  4412. },
  4413. 0x0f => { #JR
  4414. Name => 'CreativeStyleSetting',
  4415. PrintConvColumns => 2,
  4416. PrintConv => {
  4417. 16 => 'Standard',
  4418. 32 => 'Vivid',
  4419. 64 => 'Portrait',
  4420. 80 => 'Landscape',
  4421. 96 => 'B&W',
  4422. 160 => 'Sunset',
  4423. },
  4424. },
  4425. 0x10 => { #JR (seen values 253, 254, 255, 0, 1, 2, 3)
  4426. Name => 'ContrastSetting',
  4427. Format => 'int8s',
  4428. PrintConv => '$val > 0 ? "+$val" : $val',
  4429. PrintConvInv => '$val',
  4430. },
  4431. 0x11 => { #JR
  4432. Name => 'SaturationSetting',
  4433. Format => 'int8s',
  4434. PrintConv => '$val > 0 ? "+$val" : $val',
  4435. PrintConvInv => '$val',
  4436. },
  4437. 0x12 => { #JR
  4438. Name => 'SharpnessSetting',
  4439. Format => 'int8s',
  4440. PrintConv => '$val > 0 ? "+$val" : $val',
  4441. PrintConvInv => '$val',
  4442. },
  4443. 0x16 => { #JR
  4444. Name => 'WhiteBalanceSetting',
  4445. # many guessed, based on "logical system" as observed for Daylight and Shade and steps of 16 between the modes
  4446. PrintHex => 1,
  4447. PrintConvColumns => 2,
  4448. PrintConv => \%whiteBalanceSetting,
  4449. SeparateTable => 1,
  4450. },
  4451. 0x17 => { #JR
  4452. Name => 'ColorTemperatureSetting',
  4453. # matches "0xb021 ColorTemperature" when WB set to "Custom" or "Color Temperature/Color Filter"
  4454. ValueConv => '$val * 100',
  4455. ValueConvInv => '$val / 100',
  4456. PrintConv => '"$val K"',
  4457. PrintConvInv => '$val =~ s/ ?K$//i; $val',
  4458. },
  4459. 0x18 => { #JR
  4460. Name => 'ColorCompensationFilterSet',
  4461. # seen 0, 1-9 and 245-255, corresponding to 0, M1-M9 and G9-G1 on camera display
  4462. # matches "0xb022 ColorCompensationFilter" when WB set to "Custom" or "Color Temperature/Color Filter"
  4463. Format => 'int8s',
  4464. Notes => 'negative is green, positive is magenta',
  4465. PrintConv => '$val > 0 ? "+$val" : $val',
  4466. PrintConvInv => '$val',
  4467. },
  4468. 0x19 => { #JR
  4469. Name => 'CustomWB_RGBLevels',
  4470. Format => 'int16uRev[3]',
  4471. # 0x19 - 0x1e are related to Custom WB measurements performed by the camera.
  4472. # The values change only each time when measuring and setting a new Custom WB.
  4473. # (0x19,0x1a) and (0x1d,0x1e) are same as MoreSettings (0x1a,0x1b) and (0x1c,0x1d)
  4474. },
  4475. # 0x1f - always 2 (ref JR)
  4476. 0x20 => { #JR
  4477. Name => 'FlashMode',
  4478. PrintConvColumns => 2,
  4479. PrintConv => {
  4480. 1 => 'Flash Off',
  4481. 16 => 'Autoflash',
  4482. 17 => 'Fill-flash',
  4483. 18 => 'Slow Sync',
  4484. 19 => 'Rear Sync',
  4485. 20 => 'Wireless',
  4486. },
  4487. },
  4488. 0x21 => { #JR
  4489. Name => 'FlashControl',
  4490. PrintConv => {
  4491. 1 => 'ADI Flash',
  4492. 2 => 'Pre-flash TTL',
  4493. },
  4494. },
  4495. 0x23 => { #JR
  4496. Name => 'FlashExposureCompSet',
  4497. Description => 'Flash Exposure Comp. Setting',
  4498. # (as pre-selected by the user, not zero if flash didn't fire)
  4499. ValueConv => '($val - 128) / 24', #PH
  4500. ValueConvInv => 'int($val * 24 + 128.5)',
  4501. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  4502. PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)',
  4503. },
  4504. 0x24 => {
  4505. Name => 'AFAreaMode',
  4506. PrintConv => {
  4507. 1 => 'Wide',
  4508. 2 => 'Spot',
  4509. 3 => 'Local',
  4510. 4 => 'Flexible', #JR
  4511. # (Flexible Spot is a grid of 17x11 points for the NEX-5)
  4512. },
  4513. },
  4514. 0x25 => { #JR
  4515. Name => 'LongExposureNoiseReduction',
  4516. PrintConv => {
  4517. 1 => 'Off',
  4518. 16 => 'On', # (unused or dark subject)
  4519. },
  4520. },
  4521. 0x26 => { #JR
  4522. Name => 'HighISONoiseReduction',
  4523. PrintConv => {
  4524. 16 => 'Low',
  4525. 19 => 'Auto',
  4526. },
  4527. },
  4528. 0x27 => { #JR
  4529. Name => 'SmileShutterMode',
  4530. PrintConv => {
  4531. 17 => 'Slight Smile',
  4532. 18 => 'Normal Smile',
  4533. 19 => 'Big Smile',
  4534. },
  4535. },
  4536. 0x28 => { #JR
  4537. Name => 'RedEyeReduction',
  4538. PrintConv => {
  4539. 1 => 'Off',
  4540. 16 => 'On',
  4541. },
  4542. },
  4543. 0x2d => {
  4544. Name => 'HDRSetting',
  4545. PrintConv => {
  4546. 1 => 'Off',
  4547. 16 => 'On (Auto)',
  4548. 17 => 'On (Manual)',
  4549. },
  4550. },
  4551. 0x2e => {
  4552. Name => 'HDRLevel',
  4553. PrintConvColumns => 3,
  4554. PrintConv => {
  4555. 33 => '1 EV',
  4556. 34 => '1.5 EV', #JR (NC)
  4557. 35 => '2 EV',
  4558. 36 => '2.5 EV', #JR (NC)
  4559. 37 => '3 EV',
  4560. 38 => '3.5 EV', #PH (NC)
  4561. 39 => '4 EV',
  4562. 40 => '5 EV',
  4563. 41 => '6 EV',
  4564. },
  4565. },
  4566. 0x2f => { #JR (not sure what is difference with 0x85)
  4567. Name => 'ViewingMode',
  4568. PrintConv => {
  4569. 16 => 'ViewFinder',
  4570. 33 => 'Focus Check Live View',
  4571. 34 => 'Quick AF Live View',
  4572. },
  4573. },
  4574. 0x30 => { #JR
  4575. Name => 'FaceDetection',
  4576. PrintConv => {
  4577. 1 => 'Off',
  4578. 16 => 'On',
  4579. },
  4580. },
  4581. 0x31 => { #JR
  4582. Name => 'SmileShutter',
  4583. PrintConv => {
  4584. 1 => 'Off',
  4585. 16 => 'On',
  4586. },
  4587. },
  4588. 0x32 => { #JR
  4589. Name => 'SweepPanoramaSize',
  4590. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4591. PrintConv => {
  4592. 1 => 'Standard',
  4593. 2 => 'Wide',
  4594. },
  4595. },
  4596. 0x33 => { #JR
  4597. Name => 'SweepPanoramaDirection',
  4598. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4599. PrintConv => {
  4600. 1 => 'Right',
  4601. 2 => 'Left',
  4602. 3 => 'Up',
  4603. 4 => 'Down',
  4604. },
  4605. },
  4606. 0x34 => { #JR
  4607. Name => 'DriveMode', # (drive mode actually used)
  4608. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4609. PrintHex => 1,
  4610. PrintConv => {
  4611. 0x10 => 'Single Frame',
  4612. 0x21 => 'Continuous High', # also automatically selected for Scene mode Sports-action (0x05=52)
  4613. 0x22 => 'Continuous Low',
  4614. 0x30 => 'Speed Priority Continuous',
  4615. 0x51 => 'Self-timer 10 sec',
  4616. 0x52 => 'Self-timer 2 sec, Mirror Lock-up',
  4617. 0x71 => 'Continuous Bracketing 0.3 EV',
  4618. 0x75 => 'Continuous Bracketing 0.7 EV',
  4619. 0x91 => 'White Balance Bracketing Low',
  4620. 0x92 => 'White Balance Bracketing High',
  4621. 0xc0 => 'Remote Commander',
  4622. 0xd1 => 'Continuous - HDR',
  4623. 0xd2 => 'Continuous - Multi Frame NR',
  4624. 0xd3 => 'Continuous - Handheld Night Shot', # (also called "Hand-held Twilight")
  4625. 0xd4 => 'Continuous - Anti Motion Blur', #PH (NEX-5)
  4626. 0xd5 => 'Continuous - Sweep Panorama',
  4627. 0xd6 => 'Continuous - 3D Sweep Panorama',
  4628. },
  4629. },
  4630. 0x35 => {
  4631. Name => 'MultiFrameNoiseReduction',
  4632. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4633. PrintConv => {
  4634. 0 => 'n/a', # seen for A450/A500/A550
  4635. 1 => 'Off',
  4636. 16 => 'On',
  4637. 255 => 'None', # seen for NEX-3/5/C3
  4638. },
  4639. },
  4640. 0x36 => { #JR (not 100% sure about this one)
  4641. Name => 'LiveViewAFSetting',
  4642. Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  4643. PrintConv => {
  4644. 0 => 'n/a',
  4645. 1 => 'Phase-detect AF',
  4646. 2 => 'Contrast AF',
  4647. # Contrast AF is only available with SSM/SAM lenses and in Focus Check LV,
  4648. # NOT in Quick AF LV, and is automatically set when mounting SSM/SAM lens
  4649. # - changes into Phase-AF when switching to Quick AF LV.
  4650. },
  4651. },
  4652. 0x38 => { #JR
  4653. Name => 'PanoramaSize3D',
  4654. Description => '3D Panorama Size',
  4655. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4656. PrintConv => {
  4657. 0 => 'n/a',
  4658. 1 => 'Standard',
  4659. 2 => 'Wide',
  4660. 3 => '16:9',
  4661. },
  4662. },
  4663. 0x83 => { #JR
  4664. Name => 'AFButtonPressed',
  4665. # only indicates pressing and holding the "AF" button (centre-controller),
  4666. # not pressing the shutter release button halfway down
  4667. Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  4668. PrintConv => {
  4669. 1 => 'No',
  4670. 16 => 'Yes',
  4671. },
  4672. },
  4673. 0x84 => { #JR (not 100% sure about this one)
  4674. Name => 'LiveViewMetering',
  4675. Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  4676. PrintConv => {
  4677. 0 => 'n/a',
  4678. 16 => '40 Segment', # DSLR with LiveView/OVF switch in OVF position
  4679. 32 => '1200-zone Evaluative', # SLT, or DSLR with LiveView/OVF switch in LiveView position
  4680. },
  4681. },
  4682. 0x85 => { #JR (not sure what is difference with 0x2f)
  4683. Name => 'ViewingMode2',
  4684. Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  4685. PrintConv => {
  4686. 0 => 'n/a',
  4687. 16 => 'Viewfinder',
  4688. 33 => 'Focus Check Live View',
  4689. 34 => 'Quick AF Live View',
  4690. },
  4691. },
  4692. 0x86 => { #JR
  4693. Name => 'AELock',
  4694. Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  4695. PrintConv => {
  4696. 1 => 'On',
  4697. 2 => 'Off',
  4698. },
  4699. },
  4700. 0x87 => { #JR
  4701. Name => 'FlashStatusBuilt-in',
  4702. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)/',
  4703. PrintConv => {
  4704. 1 => 'Off',
  4705. 2 => 'On',
  4706. },
  4707. },
  4708. 0x88 => { #JR
  4709. Name => 'FlashStatusExternal',
  4710. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)/',
  4711. PrintConv => {
  4712. 1 => 'None',
  4713. 2 => 'Off',
  4714. 3 => 'On',
  4715. },
  4716. },
  4717. # 0x8a => { #JR
  4718. # Name => 'LensAF',
  4719. # Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4720. # PrintConv => {
  4721. # 1 => 'No',
  4722. # 16 => 'AF Lens',
  4723. # },
  4724. # },
  4725. 0x8b => { #JR
  4726. Name => 'LiveViewFocusMode',
  4727. Condition => '$$self{Model} !~ /^(NEX-|DSLR-(A450|A500|A550)$)/',
  4728. PrintConv => {
  4729. 0 => 'n/a',
  4730. 1 => 'AF',
  4731. 16 => 'Manual',
  4732. },
  4733. },
  4734. # 0x8e => { #JR
  4735. # Name => 'LensSAM',
  4736. # Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4737. # PrintConv => {
  4738. # 1 => 'No',
  4739. # 16 => 'SAM Lens',
  4740. # },
  4741. # },
  4742. 0x99 => { #JR
  4743. Name => 'LensMount',
  4744. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4745. DataMember => 'LensMount',
  4746. RawConv => '$$self{LensMount} = $val',
  4747. PrintConv => {
  4748. 1 => 'Unknown',
  4749. 16 => 'A-mount',
  4750. 17 => 'E-mount',
  4751. },
  4752. },
  4753. # 0x9b => { #JR
  4754. # Name => 'LensOSS',
  4755. # Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4756. # PrintConv => {
  4757. # 1 => 'No',
  4758. # 16 => 'OSS Lens',
  4759. # 17 => 'OSS Lens (NEX-VG)', # active ?
  4760. # },
  4761. # },
  4762. # 0x9c - 1; 2 for multi-shot modes
  4763. 0x10c => { #JR
  4764. Name => 'SequenceNumber',
  4765. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/', # seen 18 for A550, so better exclude ?
  4766. # normally 0; seen 1,2,3 for bracketing, 6 for Handheld Night Shot, 3 for HDR, 6 for MFNR
  4767. PrintConv => {
  4768. 0 => 'Single',
  4769. 255 => 'n/a',
  4770. OTHER => sub { shift }, # pass all other numbers straight through
  4771. },
  4772. },
  4773. # when reading 0x0114 - 0x0117 as int32u:
  4774. # - upper 8 bits (0x0117): always value 4, meaning unknown
  4775. # - next 10 bits: FolderNumber (max. 999 according to manual)
  4776. # - last 14 bits: ImageNumber (max 9999)
  4777. 0x0114 => { #JR
  4778. Name => 'FolderNumber',
  4779. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4780. Format => 'int32u',
  4781. Mask => 0x00ffc000,
  4782. ValueConv => '$val >> 14',
  4783. ValueConvInv => '$val << 14',
  4784. PrintConv => 'sprintf("%.3d",$val)',
  4785. PrintConvInv => '$val',
  4786. },
  4787. 276.1 => { #JR (0x0114.1)
  4788. Name => 'ImageNumber',
  4789. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4790. Format => 'int32u',
  4791. Mask => 0x00003fff,
  4792. PrintConv => 'sprintf("%.4d",$val)',
  4793. PrintConvInv => '$val',
  4794. },
  4795. 0x200 => { #JR
  4796. Name => 'ShotNumberSincePowerUp2',
  4797. Notes => q{
  4798. same as ShotNumberSincePowerUp for single-shot images, but includes all
  4799. shots of the current image in multi-shot modes like HDR, panorama, and
  4800. multi-frame noise reduction
  4801. },
  4802. # (includes all shutter actuations of the current shot)
  4803. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/',
  4804. Format => 'int32u',
  4805. },
  4806. 0x283 => { #JR
  4807. Name => 'AFButtonPressed',
  4808. # only indicates pressing and holding the "AF" button (centre-controller),
  4809. # not pressing the shutter release button halfway down
  4810. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4811. PrintConv => {
  4812. 1 => 'No',
  4813. 16 => 'Yes',
  4814. },
  4815. },
  4816. 0x284 => { #JR (not 100% sure about this one)
  4817. Name => 'LiveViewMetering',
  4818. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4819. PrintConv => {
  4820. 0 => 'n/a',
  4821. 16 => '40 Segment', # DSLR with LiveView/OVF switch in OVF position
  4822. 32 => '1200-zone Evaluative', # DSLR with LiveView/OVF switch in LiveView position
  4823. },
  4824. },
  4825. 0x285 => { #JR (not sure what is difference with 0x2f)
  4826. Name => 'ViewingMode2',
  4827. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4828. PrintConv => {
  4829. 0 => 'n/a',
  4830. 16 => 'Viewfinder',
  4831. 33 => 'Focus Check Live View',
  4832. 34 => 'Quick AF Live View',
  4833. },
  4834. },
  4835. 0x286 => { #JR
  4836. Name => 'AELock',
  4837. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4838. PrintConv => {
  4839. 1 => 'On',
  4840. 2 => 'Off',
  4841. },
  4842. },
  4843. 0x287 => { #JR
  4844. Name => 'FlashStatusBuilt-in',
  4845. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4846. Notes => 'A450, A500 and A550',
  4847. PrintConv => {
  4848. 1 => 'Off',
  4849. 2 => 'On',
  4850. },
  4851. },
  4852. 0x288 => { #JR
  4853. Name => 'FlashStatusExternal',
  4854. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4855. Notes => 'A450, A500 and A550',
  4856. PrintConv => {
  4857. 1 => 'None',
  4858. 2 => 'Off',
  4859. 3 => 'On',
  4860. },
  4861. },
  4862. 0x28b => { #JR
  4863. Name => 'LiveViewFocusMode',
  4864. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4865. PrintConv => {
  4866. 0 => 'n/a',
  4867. 1 => 'AF',
  4868. 16 => 'Manual',
  4869. },
  4870. },
  4871. 0x30c => { #JR
  4872. Name => 'SequenceNumber',
  4873. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4874. Notes => 'A450, A500 and A550',
  4875. # normally 0; seen 2 for HDR
  4876. PrintConv => {
  4877. 0 => 'Single',
  4878. 255 => 'n/a',
  4879. OTHER => sub { shift }, # pass all other numbers straight through
  4880. },
  4881. },
  4882. 0x314 => { #JR
  4883. Name => 'ImageNumber',
  4884. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4885. Format => 'int16u',
  4886. Notes => 'A450, A500 and A550',
  4887. Mask => 0x3fff, #PH (not sure what the upper 2 bits are for)
  4888. PrintConv => 'sprintf("%.4d",$val)',
  4889. PrintConvInv => '$val',
  4890. },
  4891. 0x316 => { #JR
  4892. Name => 'FolderNumber',
  4893. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4894. Notes => 'A450, A500 and A550',
  4895. Format => 'int16u',
  4896. Mask => 0x03ff, # (NC)
  4897. PrintConv => 'sprintf("%.3d",$val)',
  4898. PrintConvInv => '$val',
  4899. },
  4900. 0x03f0 => {
  4901. Name => 'LensE-mountVersion',
  4902. Format => 'int16u',
  4903. Condition => '($$self{Model} =~ /^NEX-/)',
  4904. PrintConv => 'sprintf("%x.%.2x",$val>>8,$val&0xff)',
  4905. PrintConvInv => 'my @a=split(/\./,$val);(hex($a[0])<<8)|hex($a[1])',
  4906. },
  4907. # maybe this wasn't right (ref JR)
  4908. #0x03f3 => {
  4909. # Name => 'CameraE-mountVersion',
  4910. # Format => 'int16u',
  4911. # Condition => '($$self{Model} =~ /^NEX-/)',
  4912. # PrintConv => 'sprintf("%x.%.2x",$val>>8,$val&0xff)',
  4913. # PrintConvInv => 'my @a=split(/\./,$val);(hex($a[0])<<8)|hex($a[1])',
  4914. # # seen values 1.00, 1.01, 1.02, 1.03 and 1.04 for NEX-3/5/5C/C3/VG10/VG10E with various Firmware versions.
  4915. #},
  4916. 0x03f4 => { #JR (NC)
  4917. Name => 'LensFirmwareVersion',
  4918. Format => 'int8u',
  4919. Condition => '($$self{Model} =~ /^NEX-/)',
  4920. PrintConv => 'sprintf("Ver.%.2x",$val)',
  4921. PrintConvInv => '$val=~s/^Ver\.//; hex($val)',
  4922. },
  4923. 0x3f7 => { #JR
  4924. Name => 'LensType2',
  4925. Condition => '($$self{Model} =~ /^NEX-/) and ($$self{LensMount} != 1)',
  4926. Format => 'int16u',
  4927. SeparateTable => 1,
  4928. PrintConv => \%sonyLensTypes2,
  4929. },
  4930. 0x400 => { #JR
  4931. Name => 'ImageNumber',
  4932. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4933. Format => 'int16u',
  4934. Notes => 'A450, A500 and A550',
  4935. Mask => 0x3fff, #PH (not sure what the upper 2 bits are for)
  4936. PrintConv => 'sprintf("%.4d",$val)',
  4937. PrintConvInv => '$val',
  4938. },
  4939. 0x402 => { #JR
  4940. Name => 'FolderNumber',
  4941. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)$/',
  4942. Format => 'int16u',
  4943. Mask => 0x03ff, # (NC)
  4944. Notes => 'A450, A500 and A550',
  4945. PrintConv => 'sprintf("%.3d",$val)',
  4946. PrintConvInv => '$val',
  4947. },
  4948. );
  4949. # Camera settings for other models
  4950. %Image::ExifTool::Sony::CameraSettingsUnknown = (
  4951. %binaryDataAttrs,
  4952. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4953. FORMAT => 'int16u',
  4954. );
  4955. # extra hardware information (ref JR)
  4956. %Image::ExifTool::Sony::ExtraInfo = (
  4957. %binaryDataAttrs,
  4958. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  4959. NOTES => 'Extra hardware information for the A850 and A900.',
  4960. # 0x0000: seen values 5 or 6
  4961. 0x0001 => {
  4962. Name => 'BatteryTemperature',
  4963. # seen values of appr. 55 - 115: looks like temperature Fahrenheit
  4964. # changing battery in cold weather: new battery starts with value 53
  4965. ValueConv => '($val - 32) / 1.8', # convert to Celsius
  4966. ValueConvInv => '$val * 1.8 + 32',
  4967. PrintConv => 'sprintf("%.1f C",$val)',
  4968. PrintConvInv => '$val=~ s/\s*C//; $val',
  4969. # (may be invalid for non-OEM batteries)
  4970. },
  4971. 0x0002 => {
  4972. Name => 'BatteryUnknown',
  4973. # appears to be an int16u value together with 0x0005 (values similar to ExtraInfo3 0x0000)
  4974. # seen values of appr. 800 at 23 deg C to 630 at 40 deg C for A850 with NP-FM500H battery (7.2 V nominal)
  4975. # i.e. inversely proportional to BatteryTemperature: can not be BatteryVoltage, must be something else ?
  4976. Unknown => 1,
  4977. Format => 'undef[4]',
  4978. ValueConv => sub {
  4979. my $val = shift;;
  4980. my @a = unpack("CvC",pack('v*', unpack('n*', $val)));
  4981. return $a[1];
  4982. },
  4983. },
  4984. # 0x0003: seen 0 or 16
  4985. # 0x0004: always 255
  4986. # 0x0006: int16u value together with 0x0009: same behaviour and almost same values as 0x0002
  4987. # 0x0007: always 3
  4988. 0x0008 => {
  4989. Name => 'BatteryVoltage',
  4990. # 0x0008: int16u value together with 0x000b:
  4991. # values follow BatteryLevel: from appr.900 when battery full, to appr. 775 when empty.
  4992. # with factor 118 they range from appr. 7.6 to 6.6 - looks like battery voltage (nominal 7.2 V)
  4993. Unknown => 1,
  4994. Format => 'undef[4]',
  4995. ValueConv => sub {
  4996. my $val = shift;;
  4997. my @a = unpack("CvC",pack('v*', unpack('n*', $val)));
  4998. return $a[1]/118;
  4999. },
  5000. PrintConv => 'sprintf("%.2f V",$val)',
  5001. },
  5002. 0x000a => {
  5003. # seen mostly 213 and 246, corresponding with other ImageStabilization On/Off tags.
  5004. Name => 'ImageStabilization2',
  5005. Unknown => 1, # (because the decoding is funny and possibly incomplete - PH)
  5006. PrintConv => {
  5007. 191 => 'On (191)', # seen a few times with moving subject, continuous drive, bracketing
  5008. 207 => 'On (207)', # seen once with RemoteCommander
  5009. 210 => 'On (210)', # seen a few times with continous drive
  5010. 213 => 'On',
  5011. 246 => 'Off',
  5012. },
  5013. },
  5014. # 0x000c: seen always decreasing values, from max. 107 to min. 0,
  5015. # then jump back to high value: correlates with battery change/recharging
  5016. # Seen once 255 immediately after inserting new battery, next frame OK at 106.
  5017. # Validation: matches exactly with batterylevel display on camera (all 100+ values displayed as 100%)
  5018. 0x000c => {
  5019. Name => 'BatteryLevel',
  5020. PrintConv => '"$val%"',
  5021. PrintConvInv => '$val=~s/\s*\%//; $val',
  5022. },
  5023. # 0x000d: always 2
  5024. # 0x000e: always 204
  5025. # 0x000f: always 0
  5026. # 0x0010-0x0019: always 204
  5027. 0x001a => {
  5028. Name => 'ExtraInfoVersion',
  5029. Format => 'int8u[4]',
  5030. PrintConv => '$val=~tr/ /./; $val',
  5031. PrintConvInv => '$val=~tr/./ /; $val',
  5032. # always 0 1 0 1 for 0x0131 Software = DSLR-A850 v1.00
  5033. # always 0 2 0 4 for 0x0131 Software = DSLR-A850 v2.00
  5034. # seen 0 2 0 0 for 0x0131 Software = DSLR-A900 v1.00
  5035. # seen 0 4 0 0 for 0x0131 Software = DSLR-A900 v1.00
  5036. # seen 0 5 0 4 for 0x0131 Software = DSLR-A900 v2.00
  5037. # A850: correlates exactly with Firmware versions.
  5038. # A900: have there been different FW 1.0 versions ?
  5039. },
  5040. );
  5041. # extra hardware information (ref JR)
  5042. %Image::ExifTool::Sony::ExtraInfo2 = (
  5043. %binaryDataAttrs,
  5044. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5045. NOTES => 'Extra hardware information for the A230/290/330/380/390.',
  5046. 0x0004 => {
  5047. Name => 'BatteryLevel',
  5048. PrintConv => '"$val%"',
  5049. PrintConvInv => '$val=~s/\s*\%//; $val',
  5050. },
  5051. 0x0012 => {
  5052. Name => 'ImageStabilization',
  5053. PrintConv => {
  5054. 0 => 'Off',
  5055. 64 => 'On',
  5056. },
  5057. },
  5058. );
  5059. # extra hardware information (ref JR)
  5060. %Image::ExifTool::Sony::ExtraInfo3 = (
  5061. %binaryDataAttrs,
  5062. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  5063. NOTES => q{
  5064. Extra hardware information for the A33, A35, A55, A450, A500, A550, A560,
  5065. A580 and NEX-3/5/C3/VG10.
  5066. },
  5067. 0x0000 => {
  5068. Name => 'BatteryUnknown',
  5069. # seen values of appr. 870 at 10 deg C to 650 at 39 deg C for A580 with NP-FM500H battery (7.2 V nominal)
  5070. # i.e. inversely proportional to BatteryTemperature: can not be BatteryVoltage, must be something else ?
  5071. Unknown => 1,
  5072. Format => 'int16u',
  5073. },
  5074. 0x0002 => {
  5075. Name => 'BatteryTemperature',
  5076. ValueConv => '($val - 32) / 1.8', # convert to Celsius
  5077. ValueConvInv => '$val * 1.8 + 32',
  5078. PrintConv => 'sprintf("%.1f C",$val)',
  5079. PrintConvInv => '$val=~ s/\s*C//; $val',
  5080. },
  5081. 0x0004 => {
  5082. Name => 'BatteryLevel',
  5083. PrintConv => '"$val%"',
  5084. PrintConvInv => '$val=~s/\s*\%//; $val',
  5085. },
  5086. # 0x0005: always 255
  5087. # from here on the differences between DSLR, SLT and NEX
  5088. # 0x0006 and 0x0008:
  5089. # values follow BatteryLevel: start high (970, 940) when battery full,
  5090. # and decrease with decreasing battery level to (850, 815)
  5091. # with factor 128 they range from (7.6, 7.3) to (6.6, 6.4) - looks like battery voltage (nominal 7.2 V)
  5092. 0x0006 => {
  5093. Name => 'BatteryVoltage1',
  5094. Format => 'int16u',
  5095. Condition => '$$self{Model} !~ /^(NEX-(3|5|5C|C3|VG10|VG10E))\b/',
  5096. ValueConv => '$val / 128',
  5097. ValueConvInv => '$val * 128',
  5098. PrintConv => 'sprintf("%.2f V",$val)',
  5099. PrintConvInv => '$val=~s/\s*V//; $val',
  5100. },
  5101. 0x0008 => {
  5102. Name => 'BatteryVoltage2',
  5103. Format => 'int16u',
  5104. Condition => '$$self{Model} !~ /^(NEX-(3|5|5C|C3|VG10|VG10E))\b/',
  5105. ValueConv => '$val / 128',
  5106. ValueConvInv => '$val * 128',
  5107. PrintConv => 'sprintf("%.2f V",$val)',
  5108. PrintConvInv => '$val=~s/\s*V//; $val',
  5109. },
  5110. # 0x000a - 0x000f: 3 int16u values: probably some mode or status info:
  5111. # seen various 3-number-sequences for SLT and DSLR, but meaning unknown
  5112. # 0x000a => {
  5113. # Name => 'ExtraInfo_000a',
  5114. # Format => 'int16u[3]',
  5115. # Condition => '$$self{Model} !~ /^(NEX-(3|5|5C|C3|VG10|VG10E))\b/',
  5116. # },
  5117. # 0x0010 seen:
  5118. # 176 for SLT
  5119. # 204 for NEX
  5120. # 240 for DSLR
  5121. 0x0011 => {
  5122. Name => 'ImageStabilization',
  5123. Condition => '$$self{Model} !~ /^(NEX-(3|5|5C|C3|VG10|VG10E))\b/',
  5124. # usually matches 0xb026 ImageStabilization, except some images with SelfTimer and on tripod
  5125. PrintConv => {
  5126. 0 => 'Off',
  5127. 64 => 'On',
  5128. },
  5129. },
  5130. 0x0014 => [
  5131. {
  5132. Name => 'BatteryState',
  5133. Condition => '$$self{Model} =~ /^SLT-/',
  5134. # possibly relates to "simple" batterylevel indication with battery-icon, but not completely sure
  5135. Notes => 'BatteryState for SLT models',
  5136. PrintConv => {
  5137. 1 => 'Empty',
  5138. 2 => 'Low',
  5139. 3 => 'Half full',
  5140. 4 => 'Almost full',
  5141. 5 => 'Full',
  5142. },
  5143. },{
  5144. Name => 'ExposureProgram',
  5145. Condition => '$$self{Model} =~ /^DSLR-(A450|A500|A550)\b/',
  5146. Notes => 'ExposureProgram for the A450, A500 and A550',
  5147. Priority => 0, # (some unknown values)
  5148. PrintConv => {
  5149. 241 => 'Landscape',
  5150. 243 => 'Aperture-priority AE',
  5151. 245 => 'Portrait',
  5152. 246 => 'Auto',
  5153. 247 => 'Program AE',
  5154. 249 => 'Macro',
  5155. 252 => 'Sunset',
  5156. 253 => 'Sports', #PH (A550)
  5157. 255 => 'Manual',
  5158. # missing: Shutter speed priority AE, No Flash, Night View
  5159. },
  5160. },{
  5161. Name => 'ModeDialPosition',
  5162. Condition => '$$self{Model} =~ /^DSLR-/',
  5163. Notes => 'ModeDialPosition for other DSLR models',
  5164. # (decoded from A560/A580)
  5165. PrintConv => {
  5166. 248 => 'No Flash',
  5167. 249 => 'Aperture-priority AE',
  5168. 250 => 'SCN', # <-- the reason we don't call it ExposureProgram for these models
  5169. 251 => 'Shutter speed priority AE',
  5170. 252 => 'Auto',
  5171. 253 => 'Program AE',
  5172. 254 => 'Panorama',
  5173. 255 => 'Manual',
  5174. },
  5175. },
  5176. ],
  5177. # 0x0015: DSLR: appears to be a bitmask relating to "switch" positions:
  5178. # bit 0 ( 1) only seen OFF for A580
  5179. # bit 1 ( 2) ON = Flash down, OFF = Flash raised
  5180. # bit 2 ( 4) only seen ON for A580
  5181. # bit 3 ( 8) only seen ON for A580
  5182. # bit 4 ( 16) ON = AF, OFF = MF
  5183. # bit 5 ( 32) ON = OVF, OFF = LiveView
  5184. # bit 6 ( 64) seen ON and OFF, meaning unknown
  5185. # bit 7 (128) seen ON and OFF, meaning unknown
  5186. # 0x0016: DSLR: seen 244,245,252,254, decoded for A580 with 32GB SD and 16GB MS cards
  5187. # 0x0016: NEX: seen 61,62, 125,126, 190: bits '64' and '128' appear to relate to CameraOrientation
  5188. # 0x0016: SLT: seen 64 - 78, meaning unknown
  5189. 0x0016 => [{
  5190. Name => 'MemoryCardConfiguration',
  5191. Condition => '$$self{Model} =~ /^DSLR-/',
  5192. PrintConv => {
  5193. 244 => 'MemoryStick in use, SD card present',
  5194. 245 => 'MemoryStick in use, SD slot empty',
  5195. 252 => 'SD card in use, MemoryStick present',
  5196. 254 => 'SD card in use, MemoryStick slot empty',
  5197. },
  5198. },{
  5199. Name => 'CameraOrientation',
  5200. Condition => '$$self{Model} =~ /^(NEX-(3|5|5C|C3|VG10|VG10E))\b/',
  5201. Mask => 0xc0, # (don't know what other bits mean)
  5202. PrintConv => {
  5203. 0x00 => 'Horizontal (normal)',
  5204. 0x40 => 'Rotate 90 CW',
  5205. 0x80 => 'Rotate 270 CW',
  5206. 0xc0 => 'Rotate 180', # (NC)
  5207. },
  5208. }],
  5209. # 0x0017: seen 0 for SLT, 255 for DSLR, variable for NEX
  5210. 0x0018 => {
  5211. Name => 'CameraOrientation',
  5212. Condition => '$$self{Model} !~ /^(NEX-(3|5|5C|C3|VG10|VG10E))\b/',
  5213. Mask => 0x30, # (don't know what other bits mean)
  5214. PrintConv => {
  5215. 0x00 => 'Horizontal (normal)',
  5216. 0x10 => 'Rotate 90 CW',
  5217. 0x20 => 'Rotate 270 CW',
  5218. 0x30 => 'Rotate 180',
  5219. },
  5220. },
  5221. # 0x0019:
  5222. # A450/500/550: 0 - 12 and 233 - 255
  5223. # A560/580: 1 or 64, seen a few 0 and 8
  5224. # A33/35/55: seen 0, 1, 64
  5225. # NEX: 204
  5226. # 0x001a, 0x001c appear to be 2 int16u values, meaning unknown
  5227. );
  5228. # shot information (ref PH)
  5229. %Image::ExifTool::Sony::ShotInfo = (
  5230. %binaryDataAttrs,
  5231. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5232. DATAMEMBER => [ 0x02, 0x30, 0x32, 0x34 ],
  5233. IS_SUBDIR => [ 0x48, 0x5e ],
  5234. # 0x00 - byte order 'II'
  5235. 0x02 => {
  5236. Name => 'FaceInfoOffset',
  5237. Format => 'int16u',
  5238. DataMember => 'FaceInfoOffset',
  5239. Writable => 0,
  5240. RawConv => '$$self{FaceInfoOffset} = $val',
  5241. },
  5242. 0x06 => {
  5243. Name => 'SonyDateTime',
  5244. Format => 'string[20]',
  5245. Groups => { 2 => 'Time' },
  5246. Shift => 'Time',
  5247. PrintConv => '$self->ConvertDateTime($val)',
  5248. PrintConvInv => '$self->InverseDateTime($val,0)',
  5249. },
  5250. 0x1a => { Name => 'SonyImageHeight', Format => 'int16u' }, #JR
  5251. 0x1c => { Name => 'SonyImageWidth', Format => 'int16u' }, #JR
  5252. 0x30 => { #Jeffrey Friedl
  5253. Name => 'FacesDetected',
  5254. DataMember => 'FacesDetected',
  5255. Format => 'int16u',
  5256. RawConv => '$$self{FacesDetected} = $val',
  5257. },
  5258. 0x32 => {
  5259. Name => 'FaceInfoLength', # length of a single FaceInfo entry
  5260. DataMember => 'FaceInfoLength',
  5261. Format => 'int16u',
  5262. Writable => 0,
  5263. RawConv => '$$self{FaceInfoLength} = $val',
  5264. },
  5265. 0x34 => {
  5266. # oldest/other DSC/other -
  5267. # older DSC models "DC5303320222000" or "DC6303320222000"
  5268. # DSC-W650/W690/W730 "THm101000000000" or "THm211000000000"
  5269. # DSC-HX9V generation and newer "DC7303320222000"
  5270. Name => 'MetaVersion', # (tentative)
  5271. Format => 'string[16]',
  5272. DataMember => 'MetaVersion',
  5273. RawConv => '$$self{MetaVersion} = $val',
  5274. },
  5275. 0x48 => { # (most models: DC5303320222000 and DC6303320222000)
  5276. Name => 'FaceInfo1',
  5277. Condition => q{
  5278. $$self{FacesDetected} and
  5279. $$self{FaceInfoOffset} == 0x48 and
  5280. $$self{FaceInfoLength} == 0x20
  5281. },
  5282. SubDirectory => { TagTable => 'Image::ExifTool::Sony::FaceInfo1' },
  5283. },
  5284. 0x5e => { # (HX7V: DC7303320222000)
  5285. Name => 'FaceInfo2',
  5286. Condition => q{
  5287. $$self{FacesDetected} and
  5288. $$self{FaceInfoOffset} == 0x5e and
  5289. $$self{FaceInfoLength} == 0x25
  5290. },
  5291. SubDirectory => { TagTable => 'Image::ExifTool::Sony::FaceInfo2' },
  5292. },
  5293. );
  5294. # tags used in Tag2010 and Tag9400 tables
  5295. my %sequenceImageNumber = ( #PH
  5296. Name => 'SequenceImageNumber',
  5297. Notes => 'number of images captured in burst sequence',
  5298. # (not shutter count because it increments for auto portrait framing)
  5299. Format => 'int32u',
  5300. ValueConv => '$val + 1',
  5301. ValueConvInv => '$val - 1',
  5302. );
  5303. my %sequenceFileNumber = ( #PH
  5304. Name => 'SequenceFileNumber',
  5305. Notes => 'file number in burst sequence',
  5306. Format => 'int32u',
  5307. ValueConv => '$val + 1', #JR
  5308. ValueConvInv => '$val - 1',
  5309. );
  5310. my %releaseMode2 = ( #JR
  5311. Name => 'ReleaseMode2',
  5312. SeparateTable => 'ReleaseMode2',
  5313. PrintConv => {
  5314. 0 => 'Normal',
  5315. 1 => 'Continuous', # (RX100 "Continuous - Self-timer")
  5316. 2 => 'Continuous - Exposure Bracketing', # (RX100)
  5317. 3 => 'Continuous - White Balance Bracketing', # (HX9V) (RX100)
  5318. 5 => 'Continuous - Burst', # (HX9V)
  5319. 6 => 'Single Frame - Capture During Movie', #PH (RX100)
  5320. 7 => 'Continuous - Sweep Panorama',
  5321. 8 => 'Continuous - Anti-Motion Blur, Hand-held Twilight', # (HX9V)
  5322. 9 => 'Continuous - HDR',
  5323. 10 => 'Continuous - Background defocus', # (HX9V)
  5324. 13 => 'Continuous - 3D Sweep Panorama', #PH/JR
  5325. 15 => 'Continuous - High Resolution Sweep Panorama', #JR (HX50V)
  5326. 16 => 'Continuous - 3D Image', # (HX9V)
  5327. 17 => 'Continuous - Burst 2', # (WX7 - PH) (#JR 9400-SequenceLength=10 shots)
  5328. 19 => 'Continuous - Speed/Advance Priority', #PH/JR (RX100)
  5329. 20 => 'Continuous - Multi Frame NR',
  5330. 23 => 'Single-frame - Exposure Bracketing', # (NC, seen for ILCE-7)
  5331. 26 => 'Continuous Low', #PH (A77)
  5332. 27 => 'Continuous - High Sensitivity', # seen for DSC-WX60 and WX300
  5333. 28 => 'Smile Shutter', #PH (RX100)
  5334. 29 => 'Continuous - Tele-zoom Advance Priority',
  5335. 146 => 'Single Frame - Movie Capture', #PH (seen in Tag2010 ReleaseMode2 values)
  5336. },
  5337. );
  5338. # tag definitions for Tag2010 tables (ref JR)
  5339. my %sonyDateTime2010 = (
  5340. Name => 'SonyDateTime',
  5341. Format => 'undef[7]',
  5342. Shift => 'Time',
  5343. ValueConv => q{
  5344. my @v = unpack('vC*', $val);
  5345. return sprintf("%.4d:%.2d:%.2d %.2d:%.2d:%.2d", @v)
  5346. },
  5347. ValueConvInv => q{
  5348. my @v = ($val =~ /\d+/g);
  5349. return undef unless @v == 6;
  5350. return pack('vC*', @v);
  5351. },
  5352. PrintConv => '$self->ConvertDateTime($val)',
  5353. PrintConvInv => '$self->InverseDateTime($val,0)',
  5354. );
  5355. my %releaseMode2010 = (
  5356. Name => 'ReleaseMode3',
  5357. PrintConv => {
  5358. 0 => 'Normal',
  5359. 1 => 'Continuous',
  5360. 2 => 'Bracketing', # (also white balance bracketing - PH) (also Single-frame Exposure Bracketing - ref JR)
  5361. # 3 => 'Remote Commander', (NC) (seen this when other ReleaseMode and ReleaseMode2 are 'Normal' - PH, A77)
  5362. 4 => 'Continuous - Burst', # seen for DSC-WX500 with burst of 10 shots
  5363. 5 => 'Continuous - Speed/Advance Priority',
  5364. },
  5365. );
  5366. my %gain2010 = (
  5367. Name => 'StopsAboveBaseISO',
  5368. # BaseISO is 100 for SLT, ILCE-3000, NEX-5N/5R/5T/6/7/VG20/VG30/VG900, DSC-RX1/RX1R
  5369. # BaseISO is 200 for NEX-F3/3N
  5370. # BaseISO is 160 for DSC-RX100M2
  5371. # BaseISO is 125 for DSC-RX100
  5372. # Also several other DSC models have BaseISO different from 100.
  5373. Format => 'int16u',
  5374. ValueConv => '16 - $val/256',
  5375. ValueConvInv => '(16 - $val) * 256',
  5376. PrintConv => '$val ? sprintf("%.1f",$val) : $val',
  5377. PrintConvInv => '$val',
  5378. );
  5379. my %brightnessValue2010 = (
  5380. Name => 'BrightnessValue',
  5381. Format => 'int16u',
  5382. ValueConv => '$val/256 - 56.6',
  5383. ValueConvInv => '($val + 56.6) * 256',
  5384. );
  5385. my %dynamicRangeOptimizer2010 = (
  5386. Name => 'DynamicRangeOptimizer',
  5387. PrintConv => {
  5388. 0 => 'Off',
  5389. 1 => 'Auto',
  5390. 3 => 'Lv1',
  5391. 4 => 'Lv2',
  5392. 5 => 'Lv3',
  5393. 6 => 'Lv4',
  5394. 7 => 'Lv5',
  5395. 8 => 'n/a',
  5396. },
  5397. );
  5398. my %hdr2010 = (
  5399. Name => 'HDRSetting', # (Off when HDR tag is On for RX100 superior auto backlight - PH)
  5400. PrintConv => {
  5401. 0 => 'Off',
  5402. 1 => 'HDR Auto',
  5403. 3 => 'HDR 1 EV',
  5404. 5 => 'HDR 2 EV',
  5405. 7 => 'HDR 3 EV',
  5406. 9 => 'HDR 4 EV',
  5407. 11 => 'HDR 5 EV',
  5408. 13 => 'HDR 6 EV',
  5409. },
  5410. );
  5411. my %exposureComp2010 = (
  5412. Name => 'ExposureCompensation',
  5413. Format=>'int16s',
  5414. ValueConv => '-$val/256',
  5415. ValueConvInv => '-$val*256',
  5416. PrintConv => '$val ? sprintf("%+.1f",$val) : $val',
  5417. PrintConvInv => '$val',
  5418. );
  5419. my %pictureEffect2010 = (
  5420. Name => 'PictureEffect2',
  5421. SeparateTable => 'PictureEffect2',
  5422. PrintConv => {
  5423. 0 => 'Off',
  5424. 1 => 'Toy Camera',
  5425. 2 => 'Pop Color',
  5426. 3 => 'Posterization',
  5427. 4 => 'Retro Photo',
  5428. 5 => 'Soft High Key',
  5429. 6 => 'Partial Color',
  5430. 7 => 'High Contrast Monochrome',
  5431. 8 => 'Soft Focus',
  5432. 9 => 'HDR Painting',
  5433. 10 => 'Rich-tone Monochrome',
  5434. 11 => 'Miniature',
  5435. 12 => 'Water Color',
  5436. 13 => 'Illustration',
  5437. },
  5438. );
  5439. my %quality2010 = (
  5440. Name => 'Quality2',
  5441. PrintConv => {
  5442. 0 => 'JPEG',
  5443. 1 => 'RAW',
  5444. 2 => 'RAW + JPEG',
  5445. },
  5446. );
  5447. my %meteringMode2010 = (
  5448. Name => 'MeteringMode',
  5449. PrintConv => {
  5450. 0 => 'Multi-segment',
  5451. 2 => 'Center-weighted average',
  5452. 3 => 'Spot',
  5453. },
  5454. );
  5455. my %flashMode2010 = (
  5456. Name => 'FlashMode',
  5457. PrintConv => {
  5458. 0 => 'Autoflash',
  5459. 1 => 'Fill-flash',
  5460. 2 => 'Flash Off',
  5461. 3 => 'Slow Sync',
  5462. 4 => 'Rear Sync',
  5463. # 6 => 'Wireless', #(NC)
  5464. },
  5465. );
  5466. my %exposureProgram2010 = (
  5467. Name => 'ExposureProgram',
  5468. SeparateTable => 'ExposureProgram3',
  5469. PrintConv => \%sonyExposureProgram3,
  5470. );
  5471. my %pictureProfile2010 = (
  5472. Name => 'PictureProfile',
  5473. # values 0-9: Seen for all cameras writing this tag: matches CreativeStyle and/or SceneMode settings.
  5474. # 10 and higher: Seen for ILCE-7S/7M2 and newer, having a PictureProfile setting, also some DSC/HDR models.
  5475. # Although intended for video, when set these profiles are also applied to (JPG) still images.
  5476. PrintConv => {
  5477. 0 => 'Standard/Neutral - Gamma Still (PP2)', # CreativeStyle = Standard or Neutral
  5478. 1 => 'Portrait',
  5479. 3 => 'Night View/Portrait',
  5480. 4 => 'B&W/Sepia',
  5481. 5 => 'Clear',
  5482. 6 => 'Deep',
  5483. 7 => 'Light',
  5484. 8 => 'Vivid', # SceneMode or CreativeStyle = Vivid, Autumn, Sunset or Landscape
  5485. 9 => 'Real',
  5486. 10 => 'Gamma Movie (PP1)',
  5487. 22 => 'Gamma ITU709 (PP3)',
  5488. 23 => 'ColorTone ITU709 (PP4)', # seen for HDR-CX130E
  5489. 24 => 'Gamma Cine1 (PP5)',
  5490. 25 => 'Gamma Cine2 (PP6)',
  5491. 26 => 'Gamma Cine3',
  5492. 27 => 'Gamma Cine4',
  5493. 28 => 'Gamma S-Log2 (PP7)',
  5494. 29 => 'Gamma ITU709(800%)',
  5495. },
  5496. );
  5497. %Image::ExifTool::Sony::Tag2010a = ( #JR
  5498. PROCESS_PROC => \&ProcessEnciphered,
  5499. WRITE_PROC => \&WriteEnciphered,
  5500. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5501. FORMAT => 'int8u',
  5502. NOTES => 'Valid for NEX-5N.',
  5503. WRITABLE => 1,
  5504. FIRST_ENTRY => 0,
  5505. PRIORITY => 0,
  5506. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5507. 0x04b0 => {
  5508. Name => 'MeterInfo',
  5509. Format => 'int32u[486]',
  5510. Unknown => 1,
  5511. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  5512. },
  5513. 0x1128 => { %releaseMode2010 },
  5514. 0x112c => { %releaseMode2 },
  5515. 0x1138 => { %flashMode2010 },
  5516. 0x113e => { %gain2010 },
  5517. 0x1140 => { %brightnessValue2010 },
  5518. 0x1144 => { %dynamicRangeOptimizer2010 },
  5519. 0x1148 => { %hdr2010 },
  5520. 0x114c => { %exposureComp2010 },
  5521. 0x115e => { %pictureProfile2010 },
  5522. 0x115f => { %pictureProfile2010 },
  5523. 0x1163 => { %pictureEffect2010 },
  5524. 0x1170 => { %quality2010 },
  5525. 0x1174 => { %meteringMode2010 },
  5526. 0x1175 => { %exposureProgram2010 },
  5527. 0x117c => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5528. #0x1a08 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5529. #0x1a0c => { Name => 'SonyImageHeight', Format => 'int16u' },
  5530. );
  5531. %Image::ExifTool::Sony::Tag2010b = ( #JR
  5532. PROCESS_PROC => \&ProcessEnciphered,
  5533. WRITE_PROC => \&WriteEnciphered,
  5534. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5535. FORMAT => 'int8u',
  5536. NOTES => 'Valid for SLT-A65/A77, NEX-7/VG20E.',
  5537. WRITABLE => 1,
  5538. FIRST_ENTRY => 0,
  5539. PRIORITY => 0,
  5540. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5541. 0x0000 => { %sequenceImageNumber }, #PH
  5542. 0x0004 => { %sequenceFileNumber }, #PH
  5543. 0x0008 => { %releaseMode2, Format => 'int32u' },
  5544. #0x0044 => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5545. #0x0048 => { Name => 'SonyImageHeight3', Format => 'int16u' },
  5546. #0x0054 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5547. #0x0058 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5548. #0x0064 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5549. #0x0068 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5550. #0x00a8 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5551. #0x00ac => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5552. #0x00b8 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5553. #0x00bc => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5554. #0x00c8 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5555. #0x00cc => { Name => 'SonyImageHeight', Format => 'int16u' },
  5556. 0x01b6 => { %sonyDateTime2010, Groups => { 2 => 'Time' } },
  5557. #0x0204 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5558. #0x0206 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5559. 0x0324 => { %dynamicRangeOptimizer2010 },
  5560. 0x04b4 => {
  5561. Name => 'MeterInfo',
  5562. Format => 'int32u[486]',
  5563. Unknown => 1,
  5564. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  5565. },
  5566. 0x1128 => { %releaseMode2010 },
  5567. 0x112c => { %releaseMode2 },
  5568. 0x1138 => { %flashMode2010 },
  5569. 0x113e => { %gain2010 },
  5570. 0x1140 => { %brightnessValue2010 },
  5571. 0x1144 => { %dynamicRangeOptimizer2010 },
  5572. 0x1148 => { %hdr2010 },
  5573. 0x114c => { %exposureComp2010 },
  5574. 0x1162 => { %pictureProfile2010 },
  5575. 0x1163 => { %pictureProfile2010 },
  5576. 0x1167 => { %pictureEffect2010 },
  5577. 0x1174 => { %quality2010 },
  5578. 0x1178 => { %meteringMode2010 }, #1154
  5579. 0x1179 => { %exposureProgram2010 },
  5580. 0x1180 => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5581. 0x1218 => {
  5582. Name => 'SonyISO',
  5583. Format => 'int16u',
  5584. ValueConv => '3.125*(2**(21-($val/256)))',
  5585. PrintConv => 'sprintf("%.0f",$val)',
  5586. },
  5587. #0x1a08 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5588. #0x1a0c => { Name => 'SonyImageHeight', Format => 'int16u' },
  5589. 0x1a23 => { # only for NEX-7 with Firmware v1.02 and higher, but slightly different from Tag9405 ...
  5590. Name => 'LensParameters',
  5591. Format => 'int16s[16]',
  5592. PrintConv => 'sprintf("%5d" . " %5d" x 15, split(" ",$val))',
  5593. },
  5594. );
  5595. %Image::ExifTool::Sony::Tag2010c = ( #JR
  5596. PROCESS_PROC => \&ProcessEnciphered,
  5597. WRITE_PROC => \&WriteEnciphered,
  5598. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5599. FORMAT => 'int8u',
  5600. NOTES => 'Valid for SLT-A37/A57 and NEX-F3.',
  5601. WRITABLE => 1,
  5602. FIRST_ENTRY => 0,
  5603. PRIORITY => 0,
  5604. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5605. 0x0000 => { %sequenceImageNumber }, #PH
  5606. 0x0004 => { %sequenceFileNumber }, #PH
  5607. 0x0008 => { %releaseMode2, Format => 'int32u' },
  5608. #0x0048 => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5609. #0x004c => { Name => 'SonyImageHeight3', Format => 'int16u' },
  5610. #0x0058 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5611. #0x005c => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5612. #0x0068 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5613. #0x006c => { Name => 'SonyImageHeight', Format => 'int16u' },
  5614. #0x00c0 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5615. #0x00c4 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5616. #0x00d0 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5617. #0x00d4 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5618. #0x00e0 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5619. #0x00e4 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5620. #0x0134 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5621. #0x0144 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5622. #0x0154 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5623. 0x0200 => { Name => 'DigitalZoomRatio', ValueConv => '$val/16', ValueConvInv => '$val*16', Priority => 0 },
  5624. 0x0210 => { %sonyDateTime2010, Groups => { 2 => 'Time' } },
  5625. 0x0300 => { %dynamicRangeOptimizer2010 },
  5626. 0x0490 => {
  5627. Name => 'MeterInfo',
  5628. Format => 'int32u[486]',
  5629. Unknown => 1,
  5630. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  5631. },
  5632. 0x1104 => { %releaseMode2010 },
  5633. 0x1108 => { %releaseMode2 },
  5634. 0x1114 => { %flashMode2010 },
  5635. 0x111a => { %gain2010 },
  5636. 0x111c => { %brightnessValue2010 },
  5637. 0x1120 => { %dynamicRangeOptimizer2010 },
  5638. 0x1124 => { %hdr2010 },
  5639. 0x1128 => { %exposureComp2010 },
  5640. 0x113e => { %pictureProfile2010 },
  5641. 0x113f => { %pictureProfile2010 },
  5642. 0x1143 => { %pictureEffect2010 },
  5643. 0x1150 => { %quality2010 },
  5644. 0x1154 => { %meteringMode2010 },
  5645. 0x1155 => { %exposureProgram2010 },
  5646. 0x115c => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5647. 0x11f4 => {
  5648. Name => 'SonyISO',
  5649. Format => 'int16u',
  5650. ValueConv => '3.125*(2**(21-($val/256)))',
  5651. PrintConv => 'sprintf("%.0f",$val)',
  5652. },
  5653. #0x1a08 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5654. #0x1a0c => { Name => 'SonyImageHeight', Format => 'int16u' },
  5655. );
  5656. %Image::ExifTool::Sony::Tag2010d = ( #JR
  5657. PROCESS_PROC => \&ProcessEnciphered,
  5658. WRITE_PROC => \&WriteEnciphered,
  5659. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5660. FORMAT => 'int8u',
  5661. NOTES => q{
  5662. Valid for DSC-HX10V/HX20V/HX200V/TX66/TX200V/TX300V/WX50/WX100/WX150, but
  5663. not valid for panorama images.
  5664. },
  5665. WRITABLE => 1,
  5666. FIRST_ENTRY => 0,
  5667. PRIORITY => 0,
  5668. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5669. 0x0000 => { %sequenceImageNumber }, #PH
  5670. 0x0004 => { %sequenceFileNumber }, #PH
  5671. 0x0008 => { %releaseMode2, Format => 'int32u' },
  5672. #0x0048 => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5673. #0x004c => { Name => 'SonyImageHeight3', Format => 'int16u' },
  5674. #0x0058 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5675. #0x005c => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5676. #0x0068 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5677. #0x006c => { Name => 'SonyImageHeight', Format => 'int16u' },
  5678. #0x00c0 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5679. #0x00c4 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5680. #0x00d0 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5681. #0x00d4 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5682. #0x00e0 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5683. #0x00e4 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5684. 0x01fe => { %sonyDateTime2010, Groups => { 2 => 'Time' } },
  5685. 0x037c => { %dynamicRangeOptimizer2010 },
  5686. 0x050c => {
  5687. Name => 'MeterInfo',
  5688. Format => 'int32u[486]',
  5689. Unknown => 1,
  5690. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  5691. },
  5692. 0x1180 => { %releaseMode2010 },
  5693. 0x1184 => { %releaseMode2 },
  5694. 0x1190 => { %flashMode2010 },
  5695. 0x1196 => { %gain2010 },
  5696. 0x1198 => { %brightnessValue2010 },
  5697. 0x119c => { %dynamicRangeOptimizer2010 },
  5698. 0x11a0 => { %hdr2010 },
  5699. 0x11ba => { %pictureProfile2010 },
  5700. 0x11bb => { %pictureProfile2010 },
  5701. 0x11bf => { %pictureEffect2010 },
  5702. 0x11d0 => { %meteringMode2010 },
  5703. # 0x11d1 - not valid for HX20V panorama images - PH
  5704. 0x11d1 => { %exposureProgram2010 },
  5705. 0x11d8 => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5706. 0x1270 => {
  5707. Name => 'SonyISO',
  5708. Format => 'int16u',
  5709. ValueConv => '3.125*(2**(21-($val/256)))',
  5710. PrintConv => 'sprintf("%.0f",$val)',
  5711. },
  5712. );
  5713. %Image::ExifTool::Sony::Tag2010e = ( #JR
  5714. PROCESS_PROC => \&ProcessEnciphered,
  5715. WRITE_PROC => \&WriteEnciphered,
  5716. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5717. FORMAT => 'int8u',
  5718. NOTES => q{
  5719. Valid for SLT-A58/A99, ILCE-3000/3500, NEX-3N/5R/5T/6/VG30E/VG900, DSC-RX100,
  5720. DSC-RX1/RX1R. Also valid for DSC-HX300/HX50V/TX30/WX60/WX200/WX300, but not
  5721. for panorama images.
  5722. },
  5723. WRITABLE => 1,
  5724. FIRST_ENTRY => 0,
  5725. PRIORITY => 0,
  5726. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5727. 0x0000 => { %sequenceImageNumber }, #PH
  5728. 0x0004 => { %sequenceFileNumber }, #PH
  5729. 0x0008 => { %releaseMode2, Format => 'int32u' },
  5730. #0x0048 => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5731. #0x004c => { Name => 'SonyImageHeight3', Format => 'int16u' },
  5732. #0x0058 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5733. #0x005c => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5734. #0x0068 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5735. #0x006c => { Name => 'SonyImageHeight', Format => 'int16u' },
  5736. #0x00c0 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5737. #0x00c4 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5738. #0x00d0 => { Name => 'SonyImageWidth2', Format => 'int16u' },
  5739. #0x00d4 => { Name => 'SonyImageHeight2', Format => 'int16u' },
  5740. #0x00e0 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5741. #0x00e4 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5742. #0x01fa => { Name => 'SonyImageHeight', Format => 'int16u' },
  5743. #0x0200 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5744. 0x021c => { Name => 'DigitalZoomRatio', ValueConv => '$val/16', ValueConvInv => '$val*16', Priority => 0 },
  5745. 0x022c => { %sonyDateTime2010, Groups => { 2 => 'Time' } },
  5746. 0x0328 => { %dynamicRangeOptimizer2010 },
  5747. 0x04b8 => {
  5748. Name => 'MeterInfo',
  5749. Format => 'int32u[486]',
  5750. Unknown => 1,
  5751. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  5752. },
  5753. 0x115c => { %releaseMode2010 },
  5754. 0x1160 => { %releaseMode2 },
  5755. 0x116c => { %flashMode2010 },
  5756. 0x1172 => { %gain2010 },
  5757. 0x1174 => { %brightnessValue2010 },
  5758. 0x1178 => { %dynamicRangeOptimizer2010 },
  5759. 0x117c => { %hdr2010 },
  5760. 0x1180 => { %exposureComp2010 },
  5761. 0x1196 => { %pictureProfile2010 },
  5762. 0x1197 => { %pictureProfile2010 },
  5763. 0x119b => { %pictureEffect2010 },
  5764. 0x11a8 => { %quality2010 },
  5765. 0x11ac => { %meteringMode2010 },
  5766. 0x11ad => { %exposureProgram2010 },
  5767. 0x11b4 => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5768. 0x1254 => {
  5769. Condition => '$$self{Model} =~ /^(SLT-(A99|A99V)|NEX-(5R|5T|6|VG900|VG30E)|DSC-RX100|Stellar|HV)\b/',
  5770. Name => 'SonyISO',
  5771. Format => 'int16u',
  5772. ValueConv => '3.125*(2**(21-($val/256)))',
  5773. PrintConv => 'sprintf("%.0f",$val)',
  5774. },
  5775. 0x1258 => {
  5776. Condition => '$$self{Model} =~ /^(DSC-(RX1|RX1R))\b/',
  5777. Name => 'SonyISO',
  5778. Format => 'int16u',
  5779. ValueConv => '3.125*(2**(21-($val/256)))',
  5780. PrintConv => 'sprintf("%.0f",$val)',
  5781. },
  5782. 0x1278 => {
  5783. Condition => '$$self{Model} =~ /^(SLT-A58|ILCE-(3000|3500)|NEX-3N|DSC-(HX300|HX50V|WX60|WX80|WX200|WX300|TX30))\b/',
  5784. Name => 'FocalLength',
  5785. Format => 'int16u',
  5786. ValueConv => '$val / 10',
  5787. ValueConvInv => '$val * 10',
  5788. PrintConv => 'sprintf("%.1f mm",$val)',
  5789. PrintConvInv => '$val =~ / ?mm//; $val',
  5790. },
  5791. 0x127a => {
  5792. Condition => '$$self{Model} =~ /^(SLT-A58|ILCE-(3000|3500)|NEX-3N|DSC-(HX300|HX50V|WX60|WX80|WX200|WX300|TX30))\b/',
  5793. Name => 'MinFocalLength',
  5794. Format => 'int16u',
  5795. ValueConv => '$val / 10',
  5796. ValueConvInv => '$val * 10',
  5797. PrintConv => 'sprintf("%.1f mm",$val)',
  5798. PrintConvInv => '$val =~ / ?mm//; $val',
  5799. },
  5800. 0x127c => { # may give 0 for fixed focal length lenses
  5801. Condition => '$$self{Model} =~ /^(SLT-A58|ILCE-(3000|3500)|NEX-3N|DSC-(HX300|HX50V|WX60|WX80|WX200|WX300|TX30))\b/',
  5802. Name => 'MaxFocalLength',
  5803. Format => 'int16u',
  5804. RawConv => '$val || undef',
  5805. ValueConv => '$val / 10',
  5806. ValueConvInv => '$val * 10',
  5807. PrintConv => 'sprintf("%.1f mm",$val)',
  5808. PrintConvInv => '$val =~ / ?mm//; $val',
  5809. },
  5810. 0x1280 => {
  5811. Condition => '$$self{Model} =~ /^(SLT-A58|ILCE-(3000|3500)|NEX-3N|DSC-(HX300|HX50V|WX60|WX80|WX200|WX300|TX30))\b/',
  5812. Name => 'SonyISO',
  5813. Format => 'int16u',
  5814. ValueConv => '3.125*(2**(21-($val/256)))',
  5815. PrintConv => 'sprintf("%.0f",$val)',
  5816. },
  5817. 0x1870 => {
  5818. Name => 'LensParameters',
  5819. Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  5820. Format => 'int16s[16]',
  5821. Unknown => 1, # (not sure how these are applied)
  5822. PrintConv => 'sprintf("%5d" . " %5d" x 15, split(" ",$val))',
  5823. },
  5824. # 0x1890 - same as 0x1892, but has value 3 for 50mm F1.4 ZA, DT 18-135mm and for 70-400mm G II: meaning ??
  5825. 0x1891 => {
  5826. Name => 'LensFormat',
  5827. Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  5828. PrintConv => {
  5829. 0 => 'Unknown',
  5830. 1 => 'APS-C',
  5831. 2 => 'Full-frame',
  5832. },
  5833. },
  5834. 0x1892 => {
  5835. Name => 'LensMount',
  5836. DataMember => 'LensMount',
  5837. RawConv => '$$self{LensMount} = $val; $$self{Model} =~ /^(DSC-|Stellar)/ ? undef : $val',
  5838. PrintConv => {
  5839. 0 => 'Unknown',
  5840. 1 => 'A-mount',
  5841. 2 => 'E-mount',
  5842. },
  5843. },
  5844. 0x1893 => { #JR
  5845. Name => 'LensType2',
  5846. Condition => '$$self{LensMount} == 2',
  5847. Format => 'int16u',
  5848. SeparateTable => 1,
  5849. PrintConv => \%sonyLensTypes2,
  5850. },
  5851. 0x1896 => {
  5852. Name => 'LensType',
  5853. Condition => '$$self{LensMount} == 1',
  5854. Priority => 0, #PH (just to be safe)
  5855. Format => 'int16u', #PH
  5856. SeparateTable => 1,
  5857. ValueConvInv => '($val & 0xff00) == 0x8000 ? 0 : int($val)',
  5858. PrintConv => \%sonyLensTypes,
  5859. },
  5860. #0x1914 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5861. #0x1918 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5862. #0x192e => { Name => 'SonyImageWidth', Format => 'int16u' },
  5863. #0x1930 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5864. );
  5865. %Image::ExifTool::Sony::Tag2010f = ( #JR
  5866. PROCESS_PROC => \&ProcessEnciphered,
  5867. WRITE_PROC => \&WriteEnciphered,
  5868. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5869. FORMAT => 'int8u',
  5870. NOTES => 'Valid for DSC-RX100M2, DSC-QX10/QX100.',
  5871. WRITABLE => 1,
  5872. FIRST_ENTRY => 0,
  5873. PRIORITY => 0,
  5874. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5875. 0x0004 => { %releaseMode2, Format => 'int32u' }, # NOT at offset 0x08 !
  5876. #0x002e => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5877. #0x0042 => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5878. 0x0050 => { %dynamicRangeOptimizer2010 },
  5879. 0x01e0 => {
  5880. Name => 'MeterInfo',
  5881. Format => 'int32u[486]',
  5882. Unknown => 1,
  5883. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  5884. },
  5885. 0x1014 => { %releaseMode2010 },
  5886. 0x1018 => { %releaseMode2 },
  5887. 0x1024 => { %flashMode2010 },
  5888. 0x102a => { %gain2010 },
  5889. 0x102c => { %brightnessValue2010 },
  5890. 0x1030 => { %dynamicRangeOptimizer2010 },
  5891. 0x1034 => { %hdr2010 },
  5892. 0x1038 => { %exposureComp2010 },
  5893. 0x104e => { %pictureProfile2010 },
  5894. 0x104f => { %pictureProfile2010 },
  5895. 0x1053 => { %pictureEffect2010 },
  5896. 0x1060 => { %quality2010 },
  5897. 0x1064 => { %meteringMode2010 },
  5898. 0x1065 => { %exposureProgram2010 },
  5899. 0x106c => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5900. #0x1096 => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5901. #0x10aa => { Name => 'SonyImageWidth3', Format => 'int16u' },
  5902. 0x1134 => {
  5903. Name => 'FocalLength',
  5904. Format => 'int16u',
  5905. ValueConv => '$val / 10',
  5906. ValueConvInv => '$val * 10',
  5907. PrintConv => 'sprintf("%.1f mm",$val)',
  5908. PrintConvInv => '$val =~ / ?mm//; $val',
  5909. },
  5910. 0x1136 => {
  5911. Name => 'MinFocalLength',
  5912. Format => 'int16u',
  5913. ValueConv => '$val / 10',
  5914. ValueConvInv => '$val * 10',
  5915. PrintConv => 'sprintf("%.1f mm",$val)',
  5916. PrintConvInv => '$val =~ / ?mm//; $val',
  5917. },
  5918. 0x1138 => {
  5919. Name => 'MaxFocalLength',
  5920. Format => 'int16u',
  5921. ValueConv => '$val / 10',
  5922. ValueConvInv => '$val * 10',
  5923. PrintConv => 'sprintf("%.1f mm",$val)',
  5924. PrintConvInv => '$val =~ / ?mm//; $val',
  5925. },
  5926. 0x113c => {
  5927. Name => 'SonyISO',
  5928. Format => 'int16u',
  5929. ValueConv => '3.125*(2**(21-($val/256)))',
  5930. PrintConv => 'sprintf("%.0f",$val)',
  5931. },
  5932. #0x1914 => { Name => 'SonyImageWidth', Format => 'int16u' },
  5933. #0x1918 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5934. #0x192e => { Name => 'SonyImageWidth', Format => 'int16u' },
  5935. #0x1930 => { Name => 'SonyImageHeight', Format => 'int16u' },
  5936. );
  5937. %Image::ExifTool::Sony::Tag2010g = ( #JR
  5938. PROCESS_PROC => \&ProcessEnciphered,
  5939. WRITE_PROC => \&WriteEnciphered,
  5940. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  5941. FORMAT => 'int8u',
  5942. NOTES => q{
  5943. Valid for DSC-HX400V/HX60V/QX30/RX10/RX100M3/WX220/WX350,
  5944. ILCE-7/7R/7S/7M2/5000/5100/6000/QX1, ILCA-77M2.
  5945. },
  5946. WRITABLE => 1,
  5947. FIRST_ENTRY => 0,
  5948. PRIORITY => 0,
  5949. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  5950. 0x0004 => { %releaseMode2, Format => 'int32u' }, # NOT at offset 0x08 !
  5951. 0x0050 => { %dynamicRangeOptimizer2010 },
  5952. 0x020c => { %releaseMode2010 },
  5953. 0x0210 => { %releaseMode2 },
  5954. 0x021c => { %flashMode2010 },
  5955. 0x0222 => { %gain2010 },
  5956. 0x0224 => { %brightnessValue2010 },
  5957. 0x0228 => { %dynamicRangeOptimizer2010 },
  5958. 0x022c => { %hdr2010 },
  5959. 0x0230 => { %exposureComp2010 },
  5960. 0x0246 => { %pictureProfile2010 },
  5961. 0x0247 => { %pictureProfile2010 },
  5962. 0x024b => { %pictureEffect2010 },
  5963. 0x0258 => { %quality2010 },
  5964. 0x025c => { %meteringMode2010 },
  5965. 0x025d => { %exposureProgram2010 },
  5966. 0x0264 => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  5967. 0x032c => {
  5968. Name => 'FocalLength',
  5969. Format => 'int16u',
  5970. ValueConv => '$val / 10',
  5971. ValueConvInv => '$val * 10',
  5972. PrintConv => 'sprintf("%.1f mm",$val)',
  5973. PrintConvInv => '$val =~ / ?mm//; $val',
  5974. },
  5975. 0x032e => {
  5976. Name => 'MinFocalLength',
  5977. Format => 'int16u',
  5978. ValueConv => '$val / 10',
  5979. ValueConvInv => '$val * 10',
  5980. PrintConv => 'sprintf("%.1f mm",$val)',
  5981. PrintConvInv => '$val =~ / ?mm//; $val',
  5982. },
  5983. 0x0330 => { # may give 0 for fixed focal length lenses
  5984. Name => 'MaxFocalLength',
  5985. Format => 'int16u',
  5986. RawConv => '$val || undef',
  5987. ValueConv => '$val / 10',
  5988. ValueConvInv => '$val * 10',
  5989. PrintConv => 'sprintf("%.1f mm",$val)',
  5990. PrintConvInv => '$val =~ / ?mm//; $val',
  5991. },
  5992. 0x0344 => {
  5993. Name => 'SonyISO',
  5994. Format => 'int16u',
  5995. ValueConv => '3.125*(2**(21-($val/256)))',
  5996. PrintConv => 'sprintf("%.0f",$val)',
  5997. },
  5998. 0x0388 => {
  5999. Name => 'MeterInfo',
  6000. Format => 'int32u[486]',
  6001. Unknown => 1,
  6002. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  6003. },
  6004. 0x189c => {
  6005. Name => 'LensParameters',
  6006. Condition => '$$self{Model} !~ /^DSC-/',
  6007. Format => 'int16s[16]',
  6008. Unknown => 1,
  6009. PrintConv => 'sprintf("%5d" . " %5d" x 15, split(" ",$val))',
  6010. },
  6011. # 0x18bc - same as 0x18be, but has value 3 for 50mm F1.4 ZA, DT 18-135mm and for 70-400mm G II: meaning ??
  6012. 0x18bd => {
  6013. Name => 'LensFormat',
  6014. Condition => '$$self{Model} !~ /^DSC-/',
  6015. PrintConv => {
  6016. 0 => 'Unknown',
  6017. 1 => 'APS-C',
  6018. 2 => 'Full-frame',
  6019. },
  6020. },
  6021. 0x18be => {
  6022. Name => 'LensMount',
  6023. DataMember => 'LensMount',
  6024. RawConv => '$$self{LensMount} = $val; $$self{Model} =~ /^DSC-/ ? undef : $val',
  6025. PrintConv => {
  6026. 0 => 'Unknown',
  6027. 1 => 'A-mount',
  6028. 2 => 'E-mount',
  6029. },
  6030. },
  6031. 0x18bf => { #JR
  6032. Name => 'LensType2',
  6033. Condition => '$$self{LensMount} == 2',
  6034. Format => 'int16u',
  6035. SeparateTable => 1,
  6036. PrintConv => \%sonyLensTypes2,
  6037. },
  6038. 0x18c2 => {
  6039. Name => 'LensType',
  6040. Condition => '$$self{LensMount} == 1',
  6041. Priority => 0, #PH (just to be safe)
  6042. Format => 'int16u', #PH
  6043. SeparateTable => 1,
  6044. ValueConvInv => '($val & 0xff00) == 0x8000 ? 0 : int($val)',
  6045. PrintConv => \%sonyLensTypes,
  6046. },
  6047. # 0x1940 => { Name => 'SonyImageWidth', Format => 'int16u' },
  6048. # 0x1944 => { Name => 'SonyImageHeight', Format => 'int16u' },
  6049. # 0x195a => { Name => 'SonyImageWidth', Format => 'int16u' },
  6050. # 0x195c => { Name => 'SonyImageHeight', Format => 'int16u' },
  6051. );
  6052. %Image::ExifTool::Sony::Tag2010h = ( #JR
  6053. PROCESS_PROC => \&ProcessEnciphered,
  6054. WRITE_PROC => \&WriteEnciphered,
  6055. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6056. FORMAT => 'int8u',
  6057. NOTES => q{
  6058. Valid for DSC-HX90V/RX1RM2/RX10M2/RX100M4/WX500, ILCE-7RM2/7SM2.
  6059. },
  6060. WRITABLE => 1,
  6061. FIRST_ENTRY => 0,
  6062. PRIORITY => 0,
  6063. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6064. 0x0004 => { %releaseMode2, Format => 'int32u' },
  6065. 0x0050 => { %dynamicRangeOptimizer2010 },
  6066. 0x020c => { %releaseMode2010 },
  6067. 0x0210 => { %releaseMode2 },
  6068. 0x021c => { %flashMode2010 },
  6069. 0x0222 => { %gain2010 },
  6070. 0x0224 => { %brightnessValue2010 },
  6071. 0x0228 => { %dynamicRangeOptimizer2010 },
  6072. 0x022c => { %hdr2010 },
  6073. 0x0230 => { %exposureComp2010 },
  6074. 0x0246 => { %pictureProfile2010 },
  6075. 0x0247 => { %pictureProfile2010 },
  6076. 0x024b => { %pictureEffect2010 },
  6077. 0x0258 => { %quality2010 },
  6078. 0x025c => { %meteringMode2010 },
  6079. 0x025d => { %exposureProgram2010 },
  6080. 0x0264 => { Name => 'WB_RGBLevels', Format => 'int16u[3]' },
  6081. 0x032c => {
  6082. Name => 'FocalLength',
  6083. Format => 'int16u',
  6084. ValueConv => '$val / 10',
  6085. ValueConvInv => '$val * 10',
  6086. PrintConv => 'sprintf("%.1f mm",$val)',
  6087. PrintConvInv => '$val =~ / ?mm//; $val',
  6088. },
  6089. 0x032e => {
  6090. Name => 'MinFocalLength',
  6091. Format => 'int16u',
  6092. ValueConv => '$val / 10',
  6093. ValueConvInv => '$val * 10',
  6094. PrintConv => 'sprintf("%.1f mm",$val)',
  6095. PrintConvInv => '$val =~ / ?mm//; $val',
  6096. },
  6097. 0x0330 => { # may give 0 for fixed focal length lenses
  6098. Name => 'MaxFocalLength',
  6099. Format => 'int16u',
  6100. RawConv => '$val || undef',
  6101. ValueConv => '$val / 10',
  6102. ValueConvInv => '$val * 10',
  6103. PrintConv => 'sprintf("%.1f mm",$val)',
  6104. PrintConvInv => '$val =~ / ?mm//; $val',
  6105. },
  6106. 0x0346 => {
  6107. Name => 'SonyISO',
  6108. Format => 'int16u',
  6109. ValueConv => '3.125*(2**(21-($val/256)))',
  6110. PrintConv => 'sprintf("%.0f",$val)',
  6111. },
  6112. 0x0388 => {
  6113. Name => 'MeterInfo',
  6114. Format => 'int32u[486]',
  6115. Unknown => 1,
  6116. SubDirectory => { TagTable => 'Image::ExifTool::Sony::MeterInfo' },
  6117. },
  6118. 0x18cc => {
  6119. Name => 'LensParameters',
  6120. Condition => '$$self{Model} !~ /^DSC-/',
  6121. Format => 'int16s[16]',
  6122. Unknown => 1,
  6123. PrintConv => 'sprintf("%5d" . " %5d" x 15, split(" ",$val))',
  6124. },
  6125. # 0x18ec - same as 0x18ee, but has value 3 for LensType>=65, except SAL300F28G2
  6126. 0x18ed => {
  6127. Name => 'LensFormat',
  6128. Condition => '$$self{Model} !~ /^DSC-/',
  6129. PrintConv => {
  6130. 0 => 'Unknown',
  6131. 1 => 'APS-C',
  6132. 2 => 'Full-frame',
  6133. },
  6134. },
  6135. 0x18ee => {
  6136. Name => 'LensMount',
  6137. DataMember => 'LensMount',
  6138. RawConv => '$$self{LensMount} = $val; $$self{Model} =~ /^DSC-/ ? undef : $val',
  6139. PrintConv => {
  6140. 0 => 'Unknown',
  6141. 1 => 'A-mount',
  6142. 2 => 'E-mount',
  6143. },
  6144. },
  6145. 0x18ef => { #JR
  6146. Name => 'LensType2',
  6147. Condition => '$$self{LensMount} == 2',
  6148. Format => 'int16u',
  6149. SeparateTable => 1,
  6150. PrintConv => \%sonyLensTypes2,
  6151. },
  6152. 0x18f2 => {
  6153. Name => 'LensType',
  6154. Condition => '$$self{LensMount} == 1',
  6155. Priority => 0, #PH (just to be safe)
  6156. Format => 'int16u', #PH
  6157. SeparateTable => 1,
  6158. ValueConvInv => '($val & 0xff00) == 0x8000 ? 0 : int($val)',
  6159. PrintConv => \%sonyLensTypes,
  6160. },
  6161. # 0x1970 => { Name => 'SonyImageWidth', Format => 'int16u' },
  6162. # 0x1974 => { Name => 'SonyImageHeight', Format => 'int16u' },
  6163. # 0x198a => { Name => 'SonyImageWidth', Format => 'int16u' },
  6164. # 0x198c => { Name => 'SonyImageHeight', Format => 'int16u' },
  6165. );
  6166. # possible metering information (ref JR)
  6167. %Image::ExifTool::Sony::MeterInfo = (
  6168. %binaryDataAttrs,
  6169. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6170. NOTES => q{
  6171. Information possibly related to metering. Extracted only if the Unknown
  6172. option is used.
  6173. },
  6174. #
  6175. # 162 'triplets' of 3 int32u numbers: (k,n1,n2)
  6176. # These appear to relate to two sets of brightness distribution over the image area:
  6177. # Set 1: 7 rows of 9
  6178. # Set 2: 9 rows of 11
  6179. #
  6180. # Exact meaning presently unknown, however:
  6181. # n1 ranges from 0 (black) - appr. 1300 (bright white)
  6182. # n2 ranges from 0 (black) - appr. 142000 (bright white), i.e. roughly factor 100 higher
  6183. # Many panorama images: all 0
  6184. # Flash images: n2 = n1
  6185. # k maybe some kind of 'gain' or multiplication factor ?
  6186. # k distribution over the image as function of Aspect-Ratio is as follows:
  6187. #
  6188. # 3:2 image 16:9 image 4:3 image
  6189. # set 1:
  6190. #
  6191. # 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 9 12 12 12 12 12 12 12 9
  6192. # 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 9 12 12 12 12 12 12 12 9
  6193. # 16 16 16 16 16 16 16 16 16 12 12 12 15 18 15 12 12 12 12 16 16 16 16 16 16 16 12
  6194. # 16 16 16 16 16 16 16 16 16 12 12 12 15 18 15 12 12 12 12 16 16 16 16 16 16 16 12
  6195. # 16 16 16 16 16 16 16 16 16 12 12 12 15 18 15 12 12 12 12 16 16 16 16 16 16 16 12
  6196. # 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 9 12 12 12 12 12 12 12 9
  6197. # 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 9 12 12 12 12 12 12 12 9
  6198. #
  6199. # set 2:
  6200. #
  6201. # 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 12 9 9 12 12 12 12 12 12 12 9 9
  6202. # 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 12 9 9 12 12 12 12 12 12 12 9 9
  6203. # 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 12 9 9 12 12 12 12 12 12 12 9 9
  6204. # 16 16 16 16 16 16 16 16 16 16 16 12 12 12 12 15 18 15 12 12 12 12 12 12 16 16 16 16 16 16 16 12 12
  6205. # 16 16 16 16 16 16 16 16 16 16 16 12 12 12 12 15 18 15 12 12 12 12 12 12 16 16 16 16 16 16 16 12 12
  6206. # 16 16 16 16 16 16 16 16 16 16 16 12 12 12 12 15 18 15 12 12 12 12 12 12 16 16 16 16 16 16 16 12 12
  6207. # 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 12 9 9 12 12 12 12 12 12 12 9 9
  6208. # 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 15 18 15 12 12 12 12 9 9 12 12 12 12 12 12 12 9 9
  6209. # 12 12 12 12 12 12 12 12 12 12 12 8 8 8 8 10 12 10 8 8 8 8 9 9 12 12 12 12 12 12 12 9 9
  6210. #
  6211. # Usually, in the center, the numbers of set 1 row 2-6 match with set 2 row 3-7, except for first and last 2 columns.
  6212. #
  6213. 0x0000 => { Name => 'MeterInfo1Row1', %meterInfo1 },
  6214. 0x006c => { Name => 'MeterInfo1Row2', %meterInfo1 },
  6215. 0x00d8 => { Name => 'MeterInfo1Row3', %meterInfo1 },
  6216. 0x0144 => { Name => 'MeterInfo1Row4', %meterInfo1 },
  6217. 0x01b0 => { Name => 'MeterInfo1Row5', %meterInfo1 },
  6218. 0x021c => { Name => 'MeterInfo1Row6', %meterInfo1 },
  6219. 0x0288 => { Name => 'MeterInfo1Row7', %meterInfo1 },
  6220. 0x02f4 => { Name => 'MeterInfo2Row1', %meterInfo2 },
  6221. 0x0378 => { Name => 'MeterInfo2Row2', %meterInfo2 },
  6222. 0x03fc => { Name => 'MeterInfo2Row3', %meterInfo2 },
  6223. 0x0480 => { Name => 'MeterInfo2Row4', %meterInfo2 },
  6224. 0x0504 => { Name => 'MeterInfo2Row5', %meterInfo2 },
  6225. 0x0588 => { Name => 'MeterInfo2Row6', %meterInfo2 },
  6226. 0x060c => { Name => 'MeterInfo2Row7', %meterInfo2 },
  6227. 0x0690 => { Name => 'MeterInfo2Row8', %meterInfo2 },
  6228. 0x0714 => { Name => 'MeterInfo2Row9', %meterInfo2 },
  6229. );
  6230. %Image::ExifTool::Sony::Tag900b = ( #JR
  6231. PROCESS_PROC => \&ProcessEnciphered,
  6232. WRITE_PROC => \&WriteEnciphered,
  6233. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6234. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  6235. # 0x0000 - always 174 (e)
  6236. 0x0002 => {
  6237. Name => 'FacesDetected',
  6238. PrintConv => {
  6239. 0 => '0',
  6240. 98 => '1',
  6241. 57 => '2',
  6242. 93 => '3',
  6243. 77 => '4',
  6244. 33 => '5',
  6245. 168 => '6',
  6246. 241 => '7',
  6247. 115 => '8',
  6248. },
  6249. },
  6250. # 0x00bc - always 98 (221 (e))
  6251. 0x00bd => {
  6252. Condition => '$$self{Model} !~ /^DSLR-(A450|A500|A550)$/', # always 98 for A450/A500/A550: exclude
  6253. Name => 'FaceDetection',
  6254. PrintConv => {
  6255. 0 => 'Off',
  6256. 98 => 'On',
  6257. },
  6258. },
  6259. );
  6260. %Image::ExifTool::Sony::Tag9050 = ( #JR
  6261. PROCESS_PROC => \&ProcessEnciphered,
  6262. WRITE_PROC => \&WriteEnciphered,
  6263. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6264. FORMAT => 'int8u',
  6265. WRITABLE => 1,
  6266. FIRST_ENTRY => 0,
  6267. DATAMEMBER => [ 0x0105 ],
  6268. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6269. NOTES => q{
  6270. Data for tags 0x9050, 0x94xx and 0x2010 is encrypted by a simple
  6271. substitution cipher, but the deciphered values are listed below.
  6272. },
  6273. 0x0000 => {
  6274. Condition => '$$self{Model} !~ /^(NEX-|Lunar|ILCE-|DSC-|Stellar)/',
  6275. Name => 'MaxAperture', # (at current focal length)
  6276. # seen values from 17 - 48
  6277. ValueConv => '2 ** (($val/8 - 1.06) / 2)',
  6278. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  6279. PrintConv => 'sprintf("%.1f",$val)',
  6280. PrintConvInv => '$val',
  6281. },
  6282. 0x0001 => {
  6283. Condition => '$$self{Model} !~ /^(NEX-|Lunar|ILCE-|DSC-|Stellar)/',
  6284. Name => 'MinAperture', # (at current focal length)
  6285. # seen values from 80 - 95
  6286. ValueConv => '2 ** (($val/8 - 1.06) / 2)',
  6287. ValueConvInv => 'int((log($val) * 2 / log(2) + 1) * 8 + 0.5)',
  6288. PrintConv => 'sprintf("%.0f",$val)',
  6289. PrintConvInv => '$val',
  6290. },
  6291. # 0x0002 and 0x0004 (int16u) for SLT:
  6292. # appears to be difference between used FNumber and MaxAperture, 256 being +1 APEX or stop
  6293. # however, not always valid e.g. bracketing, Shutter-prio e.a.
  6294. # difference between 0x0002 and 0x0004 mostly 0.0, 0.1 or 0.2 stops.
  6295. #### July 2015: ILCE-(7RM2|7SM2) offsets appear to be different ... exclude from existing tags
  6296. 0x0031 => { #JR
  6297. Condition => '$$self{Model} !~ /^(DSC-|Stellar|ILCE-(7RM2|7SM2))/',
  6298. Name => 'FlashStatus',
  6299. RawConv => '$$self{FlashFired} = $val',
  6300. PrintConv => {
  6301. 0 => 'No Flash present',
  6302. 2 => 'Flash Inhibited', # seen for ILCE-7/7R continuous, panorama, HDR mode
  6303. 64 => 'Built-in Flash present',
  6304. 65 => 'Built-in Flash Fired',
  6305. 66 => 'Built-in Flash Inhibited', # seen for panorama, HDR, burst mode
  6306. 128 => 'External Flash present', # seen for NEX-5N/5T
  6307. 129 => 'External Flash Fired', # seen for SLT-A99V, ILCE-7R, NEX-5N/5R
  6308. },
  6309. },
  6310. 0x0032 => { #13
  6311. Name => 'ImageCount',
  6312. # this seems to be valid for the A37,A57,A65,A77,A99, and possibly the NEX-5N/7
  6313. # but I haven't seen a count over 65536, so the Format is not confirmed - PH
  6314. # - not valid for the DSC-RX100 or RX1, so exclude all DSC models
  6315. Condition => '$$self{Model} !~ /^(DSC-|Stellar|ILCE-(7RM2|7SM2))/', #PH
  6316. Format => 'int32u',
  6317. Notes => 'total number of image exposures made by the camera',
  6318. RawConv => '$val & 0x00ffffff',
  6319. },
  6320. 0x003a => { # appr. same value as Exif ExposureTime, but longer in HDR-modes
  6321. Name => 'SonyExposureTime',
  6322. Condition => '$$self{Model} !~ /^(DSC-|Stellar|ILCE-(7RM2|7SM2))/',
  6323. Format => 'int16u',
  6324. ValueConv => '$val ? 2 ** (16 - $val/256) : 0',
  6325. ValueConvInv => '$val ? int((16 - log($val) / log(2)) * 256 + 0.5) : 0',
  6326. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  6327. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  6328. },
  6329. 0x003c => {
  6330. Name => 'SonyFNumber',
  6331. Condition => '$$self{Model} !~ /^(DSC-|Stellar|ILCE-(7RM2|7SM2))/',
  6332. Format => 'int16u',
  6333. ValueConv => '2 ** (($val/256 - 16) / 2)',
  6334. ValueConvInv => '(log($val)*2/log(2)+16)*256',
  6335. PrintConv => 'sprintf("%.1f",$val)',
  6336. PrintConvInv => '$val',
  6337. },
  6338. 0x003f => {
  6339. Name => 'ReleaseMode2',
  6340. Condition => '$$self{Model} !~ /^(DSC-|Stellar|ILCE-(7RM2|7SM2))/',
  6341. %releaseMode2,
  6342. },
  6343. 0x004c => { # only ILCE-7/7R/7S/7M2/5000/5100/6000/QX1 - but appears not valid when flash is used ...
  6344. Name => 'ImageCount2',
  6345. Condition => '($$self{Model} =~ /^(ILCE-(7(R|S|M2)?|[56]000|5100|QX1))\b/) and (($$self{FlashFired} & 0x01) != 1)',
  6346. Format => 'int32u',
  6347. RawConv => '$val & 0x00ffffff',
  6348. },
  6349. 0x0051 => { # only ILCE-7/7R/7S/7M2/5000/5100/6000/QX1, but hours usually different from SonyDateTime - UTC?
  6350. # appears not valid (all '0') when flash is used, panorama, hdr modes ...
  6351. Name => 'SonyDateTime2',
  6352. Condition => '$$self{Model} =~ /^(ILCE-(7(R|S|M2)?|[56]000|5100|QX1))\b/',
  6353. Groups => { 2 => 'Time' },
  6354. Shift => 'Time',
  6355. Format => 'undef[6]',
  6356. ValueConv => q{
  6357. my @v = unpack('C*', $val);
  6358. return undef unless $v[0] > 0;
  6359. return sprintf("20%.2d:%.2d:%.2d %.2d:%.2d:%.2d", @v)
  6360. },
  6361. ValueConvInv => q{
  6362. my @v = ($val =~ /\d+/g);
  6363. return undef unless @v == 6 and ($v[0]-=2000) >= 0;
  6364. return pack('C*', @v);
  6365. },
  6366. PrintConv => '$self->ConvertDateTime($val)',
  6367. PrintConvInv => '$self->InverseDateTime($val,0)',
  6368. },
  6369. 0x0067 => {
  6370. Name => 'ReleaseMode2',
  6371. Condition => '$$self{Model} !~ /^(DSC-|Stellar|SLT-A(65|77)V?|Lunar|NEX-(5N|7|VG20E)|ILCE-(7RM2|7SM2))/',
  6372. %releaseMode2,
  6373. },
  6374. 0x007c => { #JR valid for ILCE and most NEX
  6375. Name => 'InternalSerialNumber', # (NC)
  6376. Condition => '$$self{Model} !~ /^(DSC-|Stellar|Lunar|NEX-(5N|7|VG20E)|SLT-|HV|ILCA-|ILCE-(7RM2|7SM2))/',
  6377. Format => 'int8u[4]',
  6378. PrintConv => 'unpack "H*", pack "C*", split " ", $val',
  6379. },
  6380. 0x00f0 => { #JR valid for SLT/ILCA models
  6381. Name => 'InternalSerialNumber', # (NC)
  6382. Condition => '$$self{Model} =~ /^(SLT-|HV|ILCA-)/',
  6383. Format => 'int8u[5]',
  6384. PrintConv => 'unpack "H*", pack "C*", split " ", $val',
  6385. PrintConvInv => 'join " ", unpack "C*", pack "H*", $val',
  6386. },
  6387. ##### ILCE-(7RM2|7SM2): offsets +8
  6388. 0x0039 => {
  6389. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6390. Name => 'FlashStatus',
  6391. RawConv => '$$self{FlashFired} = $val',
  6392. PrintConv => {
  6393. 0 => 'No Flash present',
  6394. 2 => 'Flash Inhibited', # seen for ILCE-7/7R continuous, panorama, HDR mode
  6395. 64 => 'Built-in Flash present',
  6396. 65 => 'Built-in Flash Fired',
  6397. 66 => 'Built-in Flash Inhibited', # seen for panorama, HDR, burst mode
  6398. 128 => 'External Flash present', # seen for NEX-5N/5T
  6399. 129 => 'External Flash Fired', # seen for SLT-A99V, ILCE-7R, NEX-5N/5R
  6400. },
  6401. },
  6402. 0x003a => {
  6403. Name => 'ImageCount',
  6404. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6405. Format => 'int32u',
  6406. Notes => 'total number of image exposures made by the camera',
  6407. RawConv => '$val & 0x00ffffff',
  6408. },
  6409. ##### ILCE-(7RM2|7SM2): offsets +12 (x0c):
  6410. 0x0046 => { # appr. same value as Exif ExposureTime, but longer in HDR-modes
  6411. Name => 'SonyExposureTime',
  6412. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6413. Format => 'int16u',
  6414. ValueConv => '$val ? 2 ** (16 - $val/256) : 0',
  6415. ValueConvInv => '$val ? int((16 - log($val) / log(2)) * 256 + 0.5) : 0',
  6416. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  6417. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  6418. },
  6419. 0x0048 => {
  6420. Name => 'SonyFNumber',
  6421. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6422. Format => 'int16u',
  6423. ValueConv => '2 ** (($val/256 - 16) / 2)',
  6424. ValueConvInv => '(log($val)*2/log(2)+16)*256',
  6425. PrintConv => 'sprintf("%.1f",$val)',
  6426. PrintConvInv => '$val',
  6427. },
  6428. 0x004b => {
  6429. Name => 'ReleaseMode2',
  6430. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6431. %releaseMode2,
  6432. },
  6433. 0x0058 => { # only ILCE-(7RM2|7SM2) - but appears not valid when flash is used ...
  6434. Name => 'ImageCount2',
  6435. Condition => '($$self{Model} =~ /^(ILCE-(7RM2|7SM2))\b/) and (($$self{FlashFired} & 0x01) != 1)',
  6436. Format => 'int32u',
  6437. RawConv => '$val & 0x00ffffff',
  6438. },
  6439. 0x005d => { # only ILCE-(7RM2|7SM2), but only minutes-seconds ???
  6440. Name => 'SonyDateTime2',
  6441. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))\b/',
  6442. Groups => { 2 => 'Time' },
  6443. Shift => 'Time',
  6444. Format => 'undef[6]',
  6445. ValueConv => q{
  6446. my @v = unpack('C*', $val);
  6447. # return undef unless $v[0] > 0;
  6448. return sprintf("20%.2d:%.2d:%.2d %.2d:%.2d:%.2d", @v)
  6449. },
  6450. ValueConvInv => q{
  6451. my @v = ($val =~ /\d+/g);
  6452. return undef unless @v == 6 and ($v[0]-=2000) >= 0;
  6453. return pack('C*', @v);
  6454. },
  6455. PrintConv => '$self->ConvertDateTime($val)',
  6456. PrintConvInv => '$self->InverseDateTime($val,0)',
  6457. },
  6458. 0x0073 => {
  6459. Name => 'ReleaseMode2',
  6460. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6461. %releaseMode2,
  6462. },
  6463. 0x0088 => {
  6464. Name => 'InternalSerialNumber', # (NC)
  6465. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6466. Format => 'int8u[6]',
  6467. PrintConv => 'unpack "H*", pack "C*", split " ", $val',
  6468. },
  6469. ##### ILCE-(7RM2|7SM2): same offsets for lens info tags
  6470. # 0x0104 - same as 0x0105, but has value 3 for 50mm F1.4 ZA, DT 18-135mm and for 70-400mm G II: meaning ??
  6471. 0x0105 => {
  6472. Name => 'LensMount',
  6473. DataMember => 'LensMount',
  6474. RawConv => '$$self{LensMount} = $val; $$self{Model} =~ /^(DSC-|Stellar)/ ? undef : $val',
  6475. PrintConv => {
  6476. 0 => 'Unknown',
  6477. 1 => 'A-mount',
  6478. 2 => 'E-mount',
  6479. },
  6480. },
  6481. 0x0106 => {
  6482. Name => 'LensFormat',
  6483. Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  6484. PrintConv => {
  6485. 0 => 'Unknown',
  6486. 1 => 'APS-C',
  6487. 2 => 'Full-frame',
  6488. },
  6489. },
  6490. 0x0107 => {
  6491. Name => 'LensType2',
  6492. Condition => '$$self{LensMount} == 2',
  6493. Format => 'int16u',
  6494. SeparateTable => 1,
  6495. PrintConv => \%sonyLensTypes2,
  6496. },
  6497. # 0x0108 - 128 for Sony E-mount lenses, 0 for all other
  6498. 0x0109 => {
  6499. Name => 'LensType',
  6500. Condition => '$$self{LensMount} == 1',
  6501. Priority => 0, #PH (just to be safe)
  6502. Format => 'int16u', #PH
  6503. Notes => 'SLT models, and NEX with A-mount lenses',
  6504. SeparateTable => 1,
  6505. # has a value of 0 for E-mount lenses (values 0x80xx)
  6506. ValueConvInv => '($val & 0xff00) == 0x8000 ? 0 : int($val)',
  6507. PrintConv => \%sonyLensTypes,
  6508. },
  6509. # 0x0115 and 0x0116, or 0x0116 and 0x0117:
  6510. # give the same info as the first and last bytes of LensSpec,
  6511. # but also for older Sony and Minolta lenses where all LensSpec bytes are 0.
  6512. 0x0115 => {
  6513. Name => 'LensSpecFeatures',
  6514. Condition => '$$self{Model} =~ /^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/',
  6515. Format => 'undef[2]',
  6516. ValueConv => 'join " ", unpack "H2H2", $val',
  6517. ValueConvInv => sub {
  6518. my @a = split(" ", shift);
  6519. return @a == 2 ? pack 'CC', hex($a[0]), hex($a[1]) : undef;
  6520. },
  6521. PrintConv => \&PrintLensSpec,
  6522. PrintConvInv => 'Image::ExifTool::Sony::PrintInvLensSpec($val, $self, 1)',
  6523. },
  6524. 0x0116 => {
  6525. Name => 'LensSpecFeatures',
  6526. Condition => '$$self{Model} !~ /^(DSC-|Stellar|SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/',
  6527. Format => 'undef[2]',
  6528. ValueConv => 'join " ", unpack "H2H2", $val',
  6529. ValueConvInv => sub {
  6530. my @a = split(" ", shift);
  6531. return @a == 2 ? pack 'CC', hex($a[0]), hex($a[1]) : undef;
  6532. },
  6533. PrintConv => \&PrintLensSpec,
  6534. PrintConvInv => 'Image::ExifTool::Sony::PrintInvLensSpec($val, $self, 1)',
  6535. },
  6536. # 0x0122 => {Name=>'9050_LensType',Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/'},
  6537. # 0x0123 => {Name=>'9050_LensType',Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(58|99V?)|HV|ILCA-77M2|NEX-(3N|5R|5T|6|VG30E|VG900)|ILCE-(3000|3500|5000|5100|6000|7|7R|7S|7M2|QX1))/'},
  6538. # 0x012d => {Name=>'9050_LensType',Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/'},
  6539. # 0x012e => {Name=>'9050_LensType',Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(58|99V?)|HV|ILCA-77M2|NEX-(3N|5R|5T|6|VG30E|VG900)|ILCE-(3000|3500|5000|5100|6000|7|7R|7S|7M2|QX1))/'},
  6540. # ImageCount3 = ImageCount for SLT-A58, ILCE, ILCA, NEX-3N
  6541. # ImageCount-1 for SLT-A37,A57,A65,A77,A99, NEX-F3,5N,5R,5T,6,7, sometimes 0
  6542. # ImageCount-2 for NEX-VG, and often 0; "ImageCount-2" also seen on a few A99V images
  6543. # The offset for ImageCount3 changes with firmware version for the ILCE-7/7R/7S/7M2, so don't decode it for now:
  6544. # ILCE-7M2/7S: 0x01a0 (firmware 1.0x, 1.1x), 0x01b6 (firmware 1.20, 1.21, 2.00)
  6545. # ILCE-7/7R: 0x01aa (firmware 1.0x, 1.1x), 0x01c0 (firmware 1.20, 1.21, 2.00)
  6546. 0x01a0 => {
  6547. Name => 'ImageCount3',
  6548. Format => 'int32u',
  6549. RawConv => '$val == 0 ? undef : $val',
  6550. Condition => '$$self{Model} =~ /^(ILCE-(5100|QX1)|ILCA-77M2)/',
  6551. },
  6552. 0x01aa => {
  6553. Name => 'ImageCount3',
  6554. Format => 'int32u',
  6555. RawConv => '$val == 0 ? undef : $val',
  6556. Condition => '$$self{Model} =~ /^(SLT-A(58|99V?)|HV|NEX-(3N|5R|5T|6|VG900|VG30E)|ILCE-([356]000|3500))\b/',
  6557. },
  6558. 0x01bd => {
  6559. Name => 'ImageCount3',
  6560. Format => 'int32u',
  6561. RawConv => '$val == 0 ? undef : $val',
  6562. Condition => '$$self{Model} =~ /^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/'
  6563. },
  6564. 0x01cb => {
  6565. Name => 'ImageCount3',
  6566. Format => 'int32u',
  6567. RawConv => '$val == 0 ? undef : $val',
  6568. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))/',
  6569. },
  6570. # 0x0222 => {Name=>'9050_LensType2',Format=>'int16u',Condition =>'$$self{Model}=~/^(ILCE-(5100|7S|7M2|QX1))/'},
  6571. # 0x0224 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(ILCE-(5100|7S|7M2|QX1)|ILCA-77M2)/'},
  6572. # 0x0229 => {Name=>'9050_LensType2',Format=>'int16u',Condition =>'$$self{Model}=~/^(NEX-(5R|5T|6|VG30E|VG900))/'},
  6573. # 0x022b => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(NEX-(5R|5T|6|VG30E|VG900))/'},
  6574. # 0x022c => {Name=>'9050_LensType2',Format=>'int16u',Condition =>'$$self{Model}=~/^(ILCE-(3000|3500|5000|6000|7|7R)|NEX-3N)\b/'},
  6575. # 0x022e => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(ILCE-(3000|3500|5000|6000|7|7R)|NEX-3N|SLT-A(58|99V?)|HV)\b/'},
  6576. # 0x0231 => {Name=>'9050_LensSpecFeatures',Format=>'undef[2]',Condition=>'$$self{Model}=~/^(ILCE-(7S|7M2|5100|QX1)|ILCA-77M2)/'},
  6577. # 0x0238 => {Name=>'9050_LensSpecFeatures',Format=>'undef[2]',Condition=>'$$self{Model}=~/^(NEX-(5R|5T|6|VG30E|VG900))/'},
  6578. # 0x023b => {Name=>'9050_LensSpecFeatures',Format=>'undef[2]',Condition=>'$$self{Model}=~/^(SLT-A(58|99V?)|HV|ILCE-(3000|3500|5000|6000|7|7R)|NEX-3N)\b/'},
  6579. # 0x023c => {Name=>'9050_LensType2',Format=>'int16u',Condition =>'$$self{Model}=~/^(Lunar|NEX-(F3|5N|7|VG20E))/'},
  6580. # 0x023e => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E)|ILCE-(5100|7S|7M2|QX1)|ILCA-77M2)/'},
  6581. # 0x0245 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(NEX-(5R|5T|6|VG30E|VG900))/'},
  6582. # 0x0248 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(58|99V?)|HV|ILCE-(3000|3500|5000|6000|7|7R)|NEX-3N)\b/'},
  6583. # 0x0249 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(ILCE-(5100|7S|7M2|QX1)|ILCA-77M2)/'},
  6584. # 0x024a => {Name=>'9050_LensSpecFeatures',Format=>'undef[2]',Condition=>'$$self{Model}=~/^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/'},
  6585. # 0x0250 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(NEX-(5R|5T|6|VG30E|VG900))/'},
  6586. # 0x0253 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(58|99V?)|HV|ILCE-(3000|3500|5000|6000|7|7R|7S|7M2)|NEX-3N)\b/'},
  6587. # 0x0257 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/'},
  6588. # 0x0262 => {Name=>'9050_LensType', Format=>'int16u',Condition =>'$$self{Model}=~/^(SLT-A(37|57|65|77)V?|Lunar|NEX-(F3|5N|7|VG20E))/'},
  6589. # 0x031b => {%gain2010,Condition=>'$$self{Model}=~/^(DSC-RX100M3|ILCA-77M2|ILCE-(5100|7S|7M2|QX1))/'},
  6590. # 0x032c => {%gain2010,Condition=>'$$self{Model}=~/^(NEX-(5R|5T|6|VG30E|VG900))/'},
  6591. # 0x032f => {%gain2010,Condition=>'$$self{Model}=~/^(DSC-RX10|SLT-A(58|99V?)|HV|ILCE-(3000|3500|5000|6000|7|7R)|NEX-3N)\b/'},
  6592. # 0x0350 => {%gain2010,Condition=>'$$self{Model}=~/^(SLT-A(37|57)|NEX-F3)/'},
  6593. # 0x037b => {%gain2010,Condition=>'$$self{Model}=~/^(SLT-A(65|77)V?|Lunar|NEX-(7|VG20E))/'},
  6594. );
  6595. %Image::ExifTool::Sony::Tag9400a = ( #JR
  6596. PROCESS_PROC => \&ProcessEnciphered,
  6597. WRITE_PROC => \&WriteEnciphered,
  6598. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6599. FORMAT => 'int8u',
  6600. NOTES => 'Valid for many DSC, NEX and SLT models',
  6601. WRITABLE => 1,
  6602. FIRST_ENTRY => 0,
  6603. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6604. 0x0008 => { %sequenceImageNumber }, #PH
  6605. 0x000c => { %sequenceFileNumber }, #PH
  6606. 0x0010 => { %releaseMode2 },
  6607. 0x0012 => {
  6608. Name => 'DigitalZoom',
  6609. Condition => '$$self{Model} !~ /^(SLT-(A65|A77)V?|NEX-(5N|7|VG20E)|Lunar|DSC-(HX10V|HX20V|HX200V|TX20|TX55|TX300V|WX30|WX70))\b/',
  6610. PrintConv => {
  6611. 0 => 'No',
  6612. 1 => 'Yes',
  6613. },
  6614. },
  6615. # 0x0013 - Flash fired 0=no, 1=yes
  6616. # 0x0014 - related to flash / RedEyeReduction ?
  6617. # 0x0015 - CameraType: 1=HDR, 2=DSC, 3=SLT/NEX
  6618. 0x001a => { #PH
  6619. Name => 'ShotNumberSincePowerUp',
  6620. Format => 'int32u',
  6621. },
  6622. # 0x001e - increments by 4 or 6 or 8 each shutter release press since power up
  6623. # 0x001f - 0=most pictures, 1='Self-timer/Self-portrait', 2='Self-portrait (2 people)',
  6624. # 3='Continuous Self-timer', 26='Sweep Panorama' (PH, RX100)
  6625. # 0x0021 - maybe related to Image Stabilization or Smile Shutter ?
  6626. 0x0022 => {
  6627. Name => 'SequenceLength',
  6628. PrintConv => {
  6629. 0 => 'Continuous', # (RX100 too)
  6630. 1 => '1 shot',
  6631. 2 => '2 shots', # (Background defocus, 3D Image)
  6632. 3 => '3 shots', # (HDR, WB Bracketing) (RX100, also continuous bracket)
  6633. 4 => '4 shots', # seen for DSC-WX300 in Superior-Auto Anti-Motion-Blur
  6634. 5 => '5 shots', # (PH, RX100)
  6635. 6 => '6 shots', # (Multi Frame NR, Anti Motion blur, Hand-held Twilight)
  6636. 10 => '10 shots', # (HX9V Burst)
  6637. 100 => 'Continuous - iSweep Panorama', # (HX9V)
  6638. 200 => 'Continuous - Sweep Panorama',
  6639. },
  6640. },
  6641. # 0x0027 - 1=single exposure, 2=multi-exposure (eg. pano,some superior auto) (PH, RX100)
  6642. 0x0028 => {
  6643. Name => 'CameraOrientation', # (also RX100 - PH)
  6644. PrintConv => {
  6645. 1 => 'Horizontal (normal)',
  6646. 3 => 'Rotate 180',
  6647. 6 => 'Rotate 90 CW',
  6648. 8 => 'Rotate 270 CW',
  6649. },
  6650. },
  6651. 0x0029 => {
  6652. Name => 'Quality2', # (also RX100 - PH)
  6653. PrintConv => {
  6654. 0 => 'JPEG',
  6655. 1 => 'RAW',
  6656. 2 => 'RAW + JPEG',
  6657. 3 => 'JPEG + MPO', # 3D images
  6658. },
  6659. },
  6660. # 0x002b - FacesDetected_OK 0=no, 1=yes appears valid for SLT, but not for NEX and DSC-HX9V
  6661. # 0x0030 - long exposure noise reduction used 0=no, 1=yes (PH, RX100)
  6662. # 0x0031 - smile shutter used 0=no, 1=yes (PH, RX100)
  6663. # 0x0033 - 0 for DSC-HX9V, 8 for SLT, NEX
  6664. # 0x0034 and 0x0038 - different offset for HX9V and SLT/NEX, but similar numbers, non-zero when flash fired
  6665. 0x0044 => {
  6666. Condition => '$$self{Model} =~ /^(SLT-|HV|NEX-|Lunar|DSC-RX|Stellar)/', # not valid for most other DSC and HDR models
  6667. Name => 'SonyImageHeight',
  6668. Format => 'int16u',
  6669. PrintConv => '$val > 0 ? 8*$val : "n.a."',
  6670. },
  6671. 0x0052 => {
  6672. Name => 'ModelReleaseYear',
  6673. Condition => '$$self{Model} =~ /^(SLT-|HV|NEX-|Lunar|DSC-RX|Stellar)/', # not valid for most other DSC and HDR models
  6674. Format => 'int8u',
  6675. PrintConv => 'sprintf("20%.2d", $val)',
  6676. },
  6677. );
  6678. %Image::ExifTool::Sony::Tag9400b = ( #JR
  6679. PROCESS_PROC => \&ProcessEnciphered,
  6680. WRITE_PROC => \&WriteEnciphered,
  6681. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6682. FORMAT => 'int8u',
  6683. NOTES => q{
  6684. Valid for NEX-3N, ILCE-3000/3500, SLT-A58, DSC-WX60, DSC-WX300, DSC-RX100M2,
  6685. DSC-HX50V, DSC-QX10/QX100.
  6686. },
  6687. WRITABLE => 1,
  6688. FIRST_ENTRY => 0,
  6689. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6690. 0x0008 => { %sequenceImageNumber }, #PH
  6691. 0x000c => { %sequenceFileNumber }, #PH
  6692. 0x0010 => { %releaseMode2 },
  6693. 0x0012 => {
  6694. Name => 'DigitalZoom',
  6695. PrintConv => {
  6696. 0 => 'No',
  6697. 1 => 'Yes',
  6698. },
  6699. },
  6700. # 0x0013 - Flash fired 0=no, 1=yes
  6701. # 0x0014 - related to flash / RedEyeReduction ?
  6702. # 0x0015 - CameraType: 1=HDR, 2=DSC, 3=SLT/NEX
  6703. 0x0016 => { #PH
  6704. Name => 'ShotNumberSincePowerUp',
  6705. Format => 'int32u',
  6706. },
  6707. 0x001e => {
  6708. Name => 'SequenceLength',
  6709. PrintConv => {
  6710. 0 => 'Continuous',
  6711. 1 => '1 shot',
  6712. 2 => '2 shots',
  6713. 3 => '3 shots',
  6714. 4 => '4 shots',
  6715. 5 => '5 shots',
  6716. 6 => '6 shots',
  6717. 10 => '10 shots',
  6718. 100 => 'Continuous - iSweep Panorama',
  6719. 200 => 'Continuous - Sweep Panorama',
  6720. },
  6721. },
  6722. 0x0024 => {
  6723. Name => 'CameraOrientation',
  6724. PrintConv => {
  6725. 1 => 'Horizontal (normal)',
  6726. 3 => 'Rotate 180',
  6727. 6 => 'Rotate 90 CW',
  6728. 8 => 'Rotate 270 CW',
  6729. },
  6730. },
  6731. 0x0025 => {
  6732. Name => 'Quality2',
  6733. PrintConv => {
  6734. 0 => 'JPEG',
  6735. 1 => 'RAW',
  6736. 2 => 'RAW + JPEG',
  6737. 3 => 'JPEG + MPO', # 3D images
  6738. },
  6739. },
  6740. # 0x0027 - FacesDetected_OK 0=no, 1=yes
  6741. # 0x002c - long exposure noise reduction used 0=no, 1=yes (PH, RX100)
  6742. 0x003f => {
  6743. Name => 'SonyImageHeight',
  6744. Format => 'int16u',
  6745. PrintConv => '$val > 0 ? 8*$val : "n.a."',
  6746. },
  6747. 0x0046 => { # but Panorama images give incorrect result
  6748. Name => 'ModelReleaseYear',
  6749. Format => 'int8u',
  6750. PrintConv => 'sprintf("20%.2d", $val)',
  6751. },
  6752. );
  6753. %Image::ExifTool::Sony::Tag9400c = ( #JR
  6754. PROCESS_PROC => \&ProcessEnciphered,
  6755. WRITE_PROC => \&WriteEnciphered,
  6756. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6757. FORMAT => 'int8u',
  6758. WRITABLE => 1,
  6759. NOTES => q{
  6760. Valid for DSC-HX400V/HX60V/QX30/RX10/RX100M3/WX220/WX350,
  6761. ILCE-7/7R/7S/7M2/5000/5100/6000/QX1, ILCA-77M2.
  6762. },
  6763. FIRST_ENTRY => 0,
  6764. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6765. 0x0009 => { %releaseMode2 },
  6766. 0x000a => {
  6767. Name => 'ShotNumberSincePowerUp',
  6768. Format => 'int32u',
  6769. },
  6770. 0x0012 => { %sequenceImageNumber },
  6771. 0x0016 => {
  6772. Name => 'SequenceLength',
  6773. PrintConv => {
  6774. 0 => 'Continuous',
  6775. 1 => '1 shot',
  6776. 2 => '2 shots',
  6777. 3 => '3 shots',
  6778. 4 => '4 shots',
  6779. 5 => '5 shots',
  6780. 6 => '6 shots',
  6781. 10 => '10 shots',
  6782. 100 => 'Continuous - iSweep Panorama',
  6783. 200 => 'Continuous - Sweep Panorama',
  6784. },
  6785. },
  6786. 0x001a => { %sequenceFileNumber },
  6787. 0x001e => {
  6788. Name => 'SequenceLength',
  6789. PrintConv => {
  6790. 0 => 'Continuous',
  6791. 1 => '1 file',
  6792. 2 => '2 files',
  6793. 3 => '3 files',
  6794. 5 => '5 files',
  6795. 10 => '10 files', # seen for DSC-WX500 with burst of 10 shots
  6796. },
  6797. },
  6798. 0x0029 => {
  6799. Name => 'CameraOrientation',
  6800. PrintConv => {
  6801. 1 => 'Horizontal (normal)',
  6802. 3 => 'Rotate 180',
  6803. 6 => 'Rotate 90 CW',
  6804. 8 => 'Rotate 270 CW',
  6805. },
  6806. },
  6807. 0x002a => {
  6808. Name => 'Quality2',
  6809. PrintConv => {
  6810. 0 => 'JPEG',
  6811. 1 => 'RAW',
  6812. 2 => 'RAW + JPEG',
  6813. 3 => 'JPEG + MPO', # 3D images
  6814. },
  6815. },
  6816. 0x0047 => {
  6817. Name => 'SonyImageHeight',
  6818. Format => 'int16u',
  6819. PrintConv => '$val > 0 ? 8*$val : "n.a."',
  6820. },
  6821. 0x0053 => {
  6822. Name => 'ModelReleaseYear',
  6823. Format => 'int8u',
  6824. PrintConv => 'sprintf("20%.2d", $val)',
  6825. },
  6826. );
  6827. # PH (RX100)
  6828. %Image::ExifTool::Sony::Tag9402 = (
  6829. PROCESS_PROC => \&ProcessEnciphered,
  6830. WRITE_PROC => \&WriteEnciphered,
  6831. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6832. FORMAT => 'int8u',
  6833. WRITABLE => 1,
  6834. FIRST_ENTRY => 0,
  6835. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6836. DATAMEMBER => [ 0x02 ],
  6837. PRIORITY => 0,
  6838. 0x02 => {
  6839. Name => 'TempTest1',
  6840. DataMember => 'TempTest1',
  6841. Hidden => 1,
  6842. RawConv => '$$self{TempTest1}=$val; $$self{OPTIONS}{Unknown}<2 ? undef : $val',
  6843. },
  6844. 0x04 => {
  6845. Name => 'AmbientTemperature',
  6846. # this (and many other values) are only valid if 0x02 is 255 (why?)
  6847. Condition => '$$self{TempTest1} == 255',
  6848. Format => 'int8s', # (verified for negative temperature)
  6849. PrintConv => '"$val C"',
  6850. PrintConvInv => '$val=~s/ ?C//; $val',
  6851. },
  6852. 0x16 => { #JR
  6853. Name => 'FocusMode',
  6854. Mask => 0x7f, # (often +128, not sure what upper bit is for)
  6855. PrintConv => {
  6856. 0 => 'Manual',
  6857. 2 => 'AF-S',
  6858. 3 => 'AF-C',
  6859. 4 => 'AF-A', # seen in ILCE-6000 images
  6860. 6 => 'DMF',
  6861. # 7 => 'AF-D', # not for DSC, NEX, ILCE ...
  6862. },
  6863. },
  6864. 0x17 => {
  6865. Name => 'AFAreaMode',
  6866. PrintConv => {
  6867. 0 => 'Multi',
  6868. 1 => 'Center',
  6869. 2 => 'Spot', # (NC) seen for DSC-WX300
  6870. 3 => 'Flexible Spot',
  6871. 10 => 'Selective (for Miniature effect)', # seen for DSC-HX30V,TX30,WX60,WX100
  6872. 11 => 'Zone', #JR (NC) seen in ILCE-7R images
  6873. 12 => 'Expanded Flexible Spot', #JR (NC) first seen for HX90V, which is first DSC to have this mode ...
  6874. 14 => 'Tracking',
  6875. 15 => 'Face Tracking',
  6876. 255 => 'Manual',
  6877. },
  6878. },
  6879. # 0x24, 0x26: factor 10 for NEX and ILCE, factor 100 for DSC
  6880. # 0x24, 0x26, 0x28, 0x2a: inconsistent for A-mount lenses on NEX/ILCE: some correct, some 0, some incorrect ...
  6881. # 0x28 - not valid for DSC-[HTW]X models, or DSC-RX100
  6882. # 0x24 => { # same values as Exif FocalLength
  6883. # Name => 'FocalLength',
  6884. # Format => 'int16u',
  6885. # RawConv => '$val || undef',
  6886. # ValueConv => '$val / ($$self{Model}=~/DSC/ ? 100 : 10)',
  6887. # ValueConvInv => '$val * ($$self{Model}=~/DSC/ ? 100 : 10)',
  6888. # PrintConv => 'sprintf("%.1f mm",$val)',
  6889. # PrintConvInv => '$val =~ s/ ?mm//; $val',
  6890. # },
  6891. # 0x26 => { # usually identical to 0x24 or 0
  6892. # Name => 'FocalLength',
  6893. # Format => 'int16u',
  6894. # ValueConv => '$val / ($$self{Model}=~/DSC/ ? 100 : 10)',
  6895. # ValueConvInv => '$val * ($$self{Model}=~/DSC/ ? 100 : 10)',
  6896. # PrintConv => 'sprintf("%.1f mm",$val)',
  6897. # PrintConvInv => '$val =~ s/ ?mm//; $val',
  6898. # },
  6899. # 0x28 => { # values slightly different from Exif FocalLength
  6900. # Name => 'FocalLength2',
  6901. # Format => 'int16u',
  6902. # RawConv => '$val || undef',
  6903. # ValueConv => '$val / 10',
  6904. # ValueConvInv => '$val * 10',
  6905. # PrintConv => 'sprintf("%.1f mm",$val)',
  6906. # PrintConvInv => '$val =~ s/ ?mm//; $val',
  6907. # },
  6908. # 0x2a => { # usually identical to 0x28 or 0
  6909. # Name => 'FocalLength2',
  6910. # Format => 'int16u',
  6911. # ValueConv => '$val / 10',
  6912. # ValueConvInv => '$val * 10',
  6913. # PrintConv => 'sprintf("%.1f mm",$val)',
  6914. # PrintConvInv => '$val =~ s/ ?mm//; $val',
  6915. # },
  6916. # 0x002c => {
  6917. # # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  6918. # Name => 'FocusPosition2',
  6919. # Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  6920. # },
  6921. 0x002d => { # usually same as 0x002c, but some differences
  6922. # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  6923. Name => 'FocusPosition2',
  6924. Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  6925. },
  6926. # 0x8a - int32u: some sort of accumulated time or something since power up
  6927. # (doesn't increment during continuous shooting and at some other times)
  6928. );
  6929. # PH (RX100)
  6930. %Image::ExifTool::Sony::Tag9403 = (
  6931. PROCESS_PROC => \&ProcessEnciphered,
  6932. WRITE_PROC => \&WriteEnciphered,
  6933. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6934. FORMAT => 'int8u',
  6935. WRITABLE => 1,
  6936. FIRST_ENTRY => 0,
  6937. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6938. DATAMEMBER => [ 0x04 ],
  6939. 0x04 => {
  6940. # seen values 0,2,3,18,32,49,50,83,148
  6941. # CameraTemperature is valid for all values except 0,148
  6942. Name => 'TempTest2',
  6943. DataMember => 'TempTest2',
  6944. Hidden => 1,
  6945. RawConv => '$$self{TempTest2}=$val; $$self{OPTIONS}{Unknown}<2 ? undef : $val',
  6946. },
  6947. 0x05 => {
  6948. Name => 'CameraTemperature', # (maybe SensorTemperature? - heats up when taking movies)
  6949. Condition => '$$self{TempTest2} and $$self{TempTest2} < 100',
  6950. Format => 'int8s', # have seen as low as -1 for AmbientTemperature of -18
  6951. PrintConv => '"$val C"',
  6952. PrintConvInv => '$val=~s/ ?C//; $val',
  6953. },
  6954. # 0x0f - same as 0x05
  6955. # 0x18 - maybe another temperature?
  6956. );
  6957. # Tag9404 (ref JR)
  6958. %Image::ExifTool::Sony::Tag9404a = (
  6959. PROCESS_PROC => \&ProcessEnciphered,
  6960. WRITE_PROC => \&WriteEnciphered,
  6961. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6962. FORMAT => 'int8u',
  6963. WRITABLE => 1,
  6964. FIRST_ENTRY => 0,
  6965. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6966. 0x0019 => {
  6967. Name => 'LensZoomPosition',
  6968. Format => 'int16u',
  6969. Condition => '$$self{Model} !~ /^SLT-/',
  6970. PrintConv => 'sprintf("%.0f%%",$val/10.24)',
  6971. PrintConvInv => '$val=~s/ ?%$//; $val * 10.24',
  6972. },
  6973. );
  6974. %Image::ExifTool::Sony::Tag9404b= (
  6975. PROCESS_PROC => \&ProcessEnciphered,
  6976. WRITE_PROC => \&WriteEnciphered,
  6977. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  6978. FORMAT => 'int8u',
  6979. WRITABLE => 1,
  6980. FIRST_ENTRY => 0,
  6981. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  6982. 0x001e => {
  6983. Name => 'LensZoomPosition',
  6984. Format => 'int16u',
  6985. Condition => '$$self{Model} !~ /^(SLT-|HV|ILCA-)/',
  6986. PrintConv => 'sprintf("%.0f%%",$val/10.24)',
  6987. PrintConvInv => '$val=~s/ ?%$//; $val * 10.24',
  6988. },
  6989. 0x0020 => {
  6990. # seen values from 80 - 255 (= infinity) -- see Composite:FocusDistance2 below
  6991. Name => 'FocusPosition2',
  6992. Condition => '$$self{Model} =~ /^(SLT-|HV|ILCA-)/',
  6993. },
  6994. );
  6995. # Tag9405 (ref JR)
  6996. %Image::ExifTool::Sony::Tag9405a = (
  6997. PROCESS_PROC => \&ProcessEnciphered,
  6998. WRITE_PROC => \&WriteEnciphered,
  6999. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7000. FORMAT => 'int8u',
  7001. WRITABLE => 1,
  7002. FIRST_ENTRY => 0,
  7003. PRIORITY => 0,
  7004. DATAMEMBER => [ 0x0604 ],
  7005. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7006. NOTES => 'Valid for SLT, NEX, ILCE-3000/3500 and several DSC models.',
  7007. 0x0601 => {
  7008. Name => 'DistortionCorrection',
  7009. PrintConv => {
  7010. 0 => 'None',
  7011. 1 => 'Applied',
  7012. },
  7013. },
  7014. # 0x0602 - same as 0x0604, but has value 3 for 50mm F1.4 ZA, DT 18-135mm and for 70-400mm G II: meaning ??
  7015. 0x0603 => {
  7016. Name => 'LensFormat',
  7017. Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  7018. PrintConv => {
  7019. 0 => 'Unknown',
  7020. 1 => 'APS-C',
  7021. 2 => 'Full-frame',
  7022. },
  7023. },
  7024. 0x0604 => {
  7025. Name => 'LensMount',
  7026. DataMember => 'LensMount',
  7027. RawConv => '$$self{LensMount} = $val; $$self{Model} =~ /^(DSC-|Stellar)/ ? undef : $val',
  7028. PrintConv => {
  7029. 0 => 'Unknown',
  7030. 1 => 'A-mount',
  7031. 2 => 'E-mount',
  7032. # 6 - seen for A58 panorama image
  7033. },
  7034. },
  7035. 0x0605 => {
  7036. Name => 'LensType2',
  7037. Condition => '$$self{LensMount} == 2',
  7038. Format => 'int16u',
  7039. Notes => 'E-mount lenses',
  7040. SeparateTable => 1,
  7041. PrintConv => \%sonyLensTypes2,
  7042. },
  7043. 0x0608 => {
  7044. Name => 'LensType',
  7045. Condition => '$$self{LensMount} == 1',
  7046. Format => 'int16u',
  7047. Notes => 'A-mount lenses on SLT and NEX',
  7048. SeparateTable => 1,
  7049. PrintConv => \%sonyLensTypes,
  7050. },
  7051. 0x06ca => {
  7052. Name => 'LensParameters',
  7053. Condition => '$$self{Model} !~ /^(DSC-|Stellar)/',
  7054. Format => 'int16s[16]',
  7055. Unknown => 1,
  7056. PrintConv => 'sprintf("%5d" . " %5d" x 15, split(" ",$val))',
  7057. },
  7058. );
  7059. # Tag9405b (ref JR)
  7060. %Image::ExifTool::Sony::Tag9405b = (
  7061. PROCESS_PROC => \&ProcessEnciphered,
  7062. WRITE_PROC => \&WriteEnciphered,
  7063. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7064. FORMAT => 'int8u',
  7065. WRITABLE => 1,
  7066. FIRST_ENTRY => 0,
  7067. PRIORITY => 0,
  7068. DATAMEMBER => [ 0x005e ],
  7069. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7070. NOTES => q{
  7071. Valid for DSC-HX400V/HX60V/QX30/RX10/RX100M3/WX220/WX350,
  7072. ILCE-7/7R/7S/7M2/5000/5100/6000/QX1, ILCA-77M2.
  7073. },
  7074. 0x0004 => {
  7075. Name => 'SonyISO',
  7076. Format => 'int16u',
  7077. ValueConv => '3.125*(2**(21-($val/256)))',
  7078. PrintConv => 'sprintf("%.0f",$val)',
  7079. },
  7080. 0x0006 => {
  7081. Name => 'BaseISO',
  7082. Format => 'int16u',
  7083. ValueConv => '3.125*(2**(21-($val/256)))',
  7084. PrintConv => 'sprintf("%.0f",$val)',
  7085. },
  7086. 0x000a => { %gain2010 },
  7087. 0x000e => { # appr. same value as Exif ExposureTime, but shorter in HDR-modes
  7088. Name => 'SonyExposureTime2',
  7089. Format => 'int16u',
  7090. ValueConv => '$val ? 2 ** (16 - $val/256) : 0',
  7091. ValueConvInv => '$val ? int((16 - log($val) / log(2)) * 256 + 0.5) : 0',
  7092. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"',
  7093. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  7094. },
  7095. 0x0010 => {
  7096. Name => 'ExposureTime',
  7097. Format => 'rational32u',
  7098. PrintConv => '$val ? Image::ExifTool::Exif::PrintExposureTime($val) : "Bulb"', # (Bulb NC)
  7099. PrintConvInv => 'lc($val) eq "bulb" ? 0 : Image::ExifTool::Exif::ConvertFraction($val)',
  7100. },
  7101. 0x0014 => { # but often odd results for DSC models: exclude
  7102. Name => 'SonyFNumber',
  7103. Format => 'int16u',
  7104. Condition => '$$self{Model} !~ /^DSC-/',
  7105. ValueConv => '2 ** (($val/256 - 16) / 2)',
  7106. ValueConvInv => '(log($val)*2/log(2)+16)*256',
  7107. PrintConv => 'sprintf("%.1f",$val)',
  7108. PrintConvInv => '$val',
  7109. },
  7110. 0x0016 => {
  7111. Name => 'SonyMaxApertureValue', # (at current focal length)
  7112. Format => 'int16u',
  7113. ValueConv => '2 ** (($val/256 - 16) / 2)',
  7114. ValueConvInv => '(log($val)*2/log(2)+16)*256',
  7115. PrintConv => 'sprintf("%.1f",$val)',
  7116. PrintConvInv => '$val',
  7117. },
  7118. 0x0024 => { %sequenceImageNumber },
  7119. 0x0034 => { %releaseMode2 },
  7120. 0x0042 => {
  7121. Name => 'HighISONoiseReduction',
  7122. PrintConv => {
  7123. 0 => 'Off',
  7124. 1 => 'Low',
  7125. 2 => 'Normal',
  7126. 3 => 'High',
  7127. },
  7128. },
  7129. 0x0044 => {
  7130. Name => 'LongExposureNoiseReduction',
  7131. PrintConv => {
  7132. 0 => 'Off',
  7133. 1 => 'On', # (unused or dark subject)
  7134. },
  7135. },
  7136. 0x0046 => { %pictureEffect2010 },
  7137. 0x0048 => { %exposureProgram2010 },
  7138. 0x004a => {
  7139. Name => 'CreativeStyle',
  7140. PrintConv => {
  7141. 0 => 'Standard',
  7142. 1 => 'Vivid',
  7143. 2 => 'Neutral',
  7144. 3 => 'Portrait',
  7145. 4 => 'Landscape',
  7146. 5 => 'B&W',
  7147. 6 => 'Clear',
  7148. 7 => 'Deep',
  7149. 8 => 'Light',
  7150. 9 => 'Sunset',
  7151. 10 => 'Night View/Portrait',
  7152. 11 => 'Autumn Leaves',
  7153. 13 => 'Sepia',
  7154. },
  7155. },
  7156. 0x0052 => {
  7157. Name => 'Sharpness',
  7158. Format => 'int8s',
  7159. PrintConv => '$val > 0 ? "+$val" : $val',
  7160. PrintConvInv => '$val',
  7161. },
  7162. 0x005b => {
  7163. Name => 'DistortionCorrection',
  7164. PrintConv => {
  7165. 0 => 'None',
  7166. 1 => 'Applied',
  7167. },
  7168. },
  7169. # 0x005c - same as 0x005e, but has value 3 for 50mm F1.4 ZA, DT 18-135mm and for 70-400mm G II: meaning ??
  7170. 0x005d => {
  7171. Name => 'LensFormat',
  7172. Condition => '$$self{Model} !~ /^DSC-/',
  7173. PrintConv => {
  7174. 0 => 'Unknown',
  7175. 1 => 'APS-C',
  7176. 2 => 'Full-frame',
  7177. },
  7178. },
  7179. 0x005e => {
  7180. Name => 'LensMount',
  7181. DataMember => 'LensMount',
  7182. RawConv => '$$self{LensMount} = $val; $$self{Model} =~ /^DSC-/ ? undef : $val',
  7183. PrintConv => {
  7184. 0 => 'Unknown',
  7185. 1 => 'A-mount',
  7186. 2 => 'E-mount',
  7187. },
  7188. },
  7189. 0x0060 => {
  7190. Name => 'LensType2',
  7191. Condition => '$$self{LensMount} == 2',
  7192. Format => 'int16u',
  7193. Notes => 'E-mount lenses',
  7194. SeparateTable => 1,
  7195. PrintConv => \%sonyLensTypes2,
  7196. },
  7197. 0x0062 => {
  7198. Name => 'LensType',
  7199. Condition => '$$self{LensMount} == 1',
  7200. Format => 'int16u',
  7201. Notes => 'A-mount lenses on SLT and NEX',
  7202. SeparateTable => 1,
  7203. PrintConv => \%sonyLensTypes,
  7204. },
  7205. 0x0064 => {
  7206. Name => 'LensParameters',
  7207. Condition => '$$self{Model} !~ /^DSC-/',
  7208. Format => 'int16s[16]',
  7209. Unknown => 1,
  7210. PrintConv => 'sprintf("%5d" . " %5d" x 15, split(" ",$val))',
  7211. },
  7212. 0x0342 => {
  7213. Name => 'LensZoomPosition',
  7214. Condition => '$$self{Model} !~ /^(ILCA-|ILCE-(7RM2|7SM2)|DSC-(HX90V|RX10M2|RX100M4|WX500))/',
  7215. Format => 'int16u',
  7216. PrintConv => 'sprintf("%.0f%%",$val/10.24)',
  7217. PrintConvInv => '$val=~s/ ?%$//; $val * 10.24',
  7218. },
  7219. 0x035a => {
  7220. Name => 'LensZoomPosition',
  7221. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2)|DSC-(HX90V|RX10M2|RX100M4|WX500))/',
  7222. Format => 'int16u',
  7223. PrintConv => 'sprintf("%.0f%%",$val/10.24)',
  7224. PrintConvInv => '$val=~s/ ?%$//; $val * 10.24',
  7225. },
  7226. );
  7227. # Tag9406 (ref JR)
  7228. %Image::ExifTool::Sony::Tag9406 = (
  7229. PROCESS_PROC => \&ProcessEnciphered,
  7230. WRITE_PROC => \&WriteEnciphered,
  7231. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7232. FORMAT => 'int8u',
  7233. WRITABLE => 1,
  7234. FIRST_ENTRY => 0,
  7235. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7236. # 0x0000: 1 for A37, A57, A65, A77, NEX-5N, 7, F3, VG20
  7237. # 2 for A58/99V, NEX-3N/5R/5T/6/VG30/VG900, ILCE-3000/7/7R/5000/6000
  7238. # 0x0001+0x0002: Int16u, seen 580 - 770: similar to "BatteryUnknown" ??
  7239. # 0x0005: int8u, seen 73 - 117: maybe Fahrenheit? Higher than "AmbientTemperature", but same trend.
  7240. 0x0005 => {
  7241. Name => 'BatteryTemperature',
  7242. ValueConv => '($val - 32) / 1.8', # convert to Celsius
  7243. ValueConvInv => '$val * 1.8 + 32',
  7244. PrintConv => 'sprintf("%.1f C",$val)',
  7245. PrintConvInv => '$val=~s/\s*C//; $val',
  7246. },
  7247. # 0x0006: usually 0, seen non-zero values only for A99V and ILCE-7/7R: BatteryLevel Grip ?
  7248. 0x0006 => {
  7249. Name => 'BatteryLevelGrip1',
  7250. Condition => '$$valPt !~ /^\x00/', # only valid when not 0
  7251. PrintConv => '"$val%"',
  7252. PrintConvInv => '$val=~s/\s*\%//; $val',
  7253. },
  7254. # 0x0007: seen values from 8 - 105, decreasing in sequences of images: BatteryLevel
  7255. 0x0007 => {
  7256. Name => 'BatteryLevel',
  7257. PrintConv => '"$val%"',
  7258. PrintConvInv => '$val=~s/\s*\%//; $val',
  7259. },
  7260. # 0x0008: usually 255 or 0 (ILCE-7/7R), seen other values only for A99V and ILCE-7/7R when 0x0006 not 0.
  7261. # A99V with grip can have 3 batteries: => Grip 2;
  7262. # but ILCE-7/7R with grip can have max 2, and as all ILCE-7/7R samples give >100 values, exclude...
  7263. 0x0008 => {
  7264. Name => 'BatteryLevelGrip2',
  7265. Condition => '$$valPt !~ /^[\x00\xff]/ and $$self{Model} !~ /^(ILCE-(7|7R))$/', # only when not 0 or 255 and not for ILCE-7/7R
  7266. PrintConv => '"$val%"',
  7267. PrintConvInv => '$val=~s/\s*\%//; $val',
  7268. },
  7269. # 0x0009-0x001a: looks like 9 Int16u values
  7270. # 0x0022: 0 or 1 for A99, NEX-5R, 6
  7271. # 0x0025: 0 or 1 for other SLT and NEX (0x0022, 0x0023, 0x0024 = 255)
  7272. );
  7273. # Tag940a (ref PH, decoded mainly from A77)
  7274. %Image::ExifTool::Sony::Tag940a = (
  7275. PROCESS_PROC => \&ProcessEnciphered,
  7276. WRITE_PROC => \&WriteEnciphered,
  7277. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7278. FORMAT => 'int8u',
  7279. WRITABLE => 1,
  7280. FIRST_ENTRY => 0,
  7281. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7282. NOTES => 'These tags are currently extracted for SLT models only.',
  7283. # 0x00 - 10(A65,A77,NEX-5N,7,VG20E), 11(A37,A57,A99,NEX-5R,6,F3,RX1,RX100),
  7284. # 9(HX9V), 4,68,86,110(panoramas) - ref JR
  7285. 0x04 => {
  7286. Name => 'AFPointsSelected',
  7287. Format => 'int32u',
  7288. PrintConvColumns => 2,
  7289. PrintConv => {
  7290. # verified for A77 firmware 1.03 and 1.07 and A99 firmware 1.00,
  7291. # but there were inconsistencies with my A77 firmware 1.04 samples - PH
  7292. 0 => '(none)',
  7293. 0x00007801 => 'Center Zone',
  7294. 0x0001821c => 'Right Zone',
  7295. 0x000605c0 => 'Left Zone',
  7296. 0x7fffffff => '(all)',
  7297. # 0xffffffff - 'n/a' - RX1 and NEX models always give this
  7298. # (on Wide AFAreaMode, outer focus points are dropped
  7299. # at progressively higher digital zoom ratios, ref JR)
  7300. BITMASK => {
  7301. 0 => 'Center', # (1.04 gave this for Upper-middle and Near Left)
  7302. 1 => 'Top', # (1.04 didn't give this value)
  7303. 2 => 'Upper-right', # (1.04 OK)
  7304. 3 => 'Right', # (1.04 didn't give this value)
  7305. 4 => 'Lower-right', # (1.04 gave this for Bottom)
  7306. 5 => 'Bottom', # (1.04 gave this for Lower-middle)
  7307. 6 => 'Lower-left', # (1.04 gave this for Left and Lower Far Left)
  7308. 7 => 'Left', # (1.04 gave this for Far Left)
  7309. 8 => 'Upper-left', # (1.04 OK)
  7310. 9 => 'Far Right', # (1.04 gave this for Upper Far Right and Right)
  7311. 10 => 'Far Left', # (1.04 didn't give this value)
  7312. 11 => 'Upper-middle', # (1.04 gave this for Top)
  7313. 12 => 'Near Right', # (1.04 gave this for Center)
  7314. 13 => 'Lower-middle', # (1.04 gave this for Lower-left and Near Right)
  7315. 14 => 'Near Left', # (1.04 didn't give this value)
  7316. 15 => 'Upper Far Right',# (1.04 didn't give this value)
  7317. 16 => 'Lower Far Right',# (1.04 OK, but gave this for Far Right and Lower-right too)
  7318. 17 => 'Lower Far Left', # (1.04 didn't give this value)
  7319. 18 => 'Upper Far Left', # (1.04 OK)
  7320. # higher bits may be used in panorama images - ref JR
  7321. },
  7322. },
  7323. },
  7324. # 0x0a - int16u: 0,1,2,3
  7325. # 0xa6 - 8 bytes face detection info ?; starts with 1, otherwise all 0
  7326. );
  7327. # Tag940c (ref JR)
  7328. %Image::ExifTool::Sony::Tag940c = (
  7329. PROCESS_PROC => \&ProcessEnciphered,
  7330. WRITE_PROC => \&WriteEnciphered,
  7331. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7332. FORMAT => 'int8u',
  7333. WRITABLE => 1,
  7334. FIRST_ENTRY => 0,
  7335. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7336. DATAMEMBER => [ 0x0008 ],
  7337. NOTES => 'NEX and ILCE models only.',
  7338. # 0x0001 - 0 for all NEX and ILCE-3000/3500, 20 for all other ILCE (17 for ILCE samples from Sony.net)
  7339. # 0x0008 - LensMount, but different values from Tag9405-0x0105 and Tag9050-0x0604.
  7340. # don't know what difference is between values '1' and '5' ...
  7341. 0x0008 => {
  7342. Name => 'LensMount2', # ? maybe some other meaning ? (A-mount adapter-only images give 0)
  7343. RawConv => '$$self{LensMount} = $val',
  7344. PrintConv => {
  7345. 0 => 'Unknown',
  7346. 1 => 'A-mount (1)',
  7347. 4 => 'E-mount',
  7348. 5 => 'A-mount (5)',
  7349. },
  7350. },
  7351. # 0x0009 - LensType3:
  7352. # This tag appears to also indicate adapter info, similar to CameraSettings3-0x03f7 for the original NEX-3/5.
  7353. # (Tag9405-0x0605 and Tag9050-0x0107 LensType2 always give '0' for adapters/A-mount lenses.)
  7354. # - seen a few instances of 0x0009 indicating an E-mount lens, but 0xb027 LensType indicating an A-mount lens:
  7355. # possibly due to adapter info not being read/reset correctly ?
  7356. 0x0009 => {
  7357. Name => 'LensType3',
  7358. RawConv => '(($$self{LensMount} != 0) or ($val > 0 and $val < 32784)) ? $val : undef',
  7359. Format => 'int16u',
  7360. SeparateTable => 1,
  7361. PrintConv => \%sonyLensTypes2,
  7362. },
  7363. 0x000b => {
  7364. Name => 'CameraE-mountVersion',
  7365. Format => 'int16u',
  7366. PrintConv => 'sprintf("%x.%.2x",$val>>8,$val&0xff)',
  7367. PrintConvInv => 'my @a=split(/\./,$val);(hex($a[0])<<8)|hex($a[1])',
  7368. # camera Firmware versions:
  7369. # 1.00 - 1.04: seen in CameraSettings3 0x03f3 for NEX-3/5/5C/C3/VG10E
  7370. # 1.14: NEX-5N/5R/6/7/F3/VG20E/VG30E/VG900 v1.00, NEX-5N v1.01, NEX-3N v0.90
  7371. # 1.20: NEX-3N v1.00, NEX-6 v1.01, NEX-7 v1.02, ILCE-3000 v1.00, ILCE-3500 v1.01
  7372. # 1.30: NEX-5T v1.00, NEX-6 v1.02/v1.03, NEX-7 v1.03
  7373. # 1.31: ILCE-7/7R v0.95/v1.00/v1.01, ILCE-5000
  7374. # 1.40: ILCE-7/7R v1.02/v1.10, ILCE-7S v1.00, ILCE-5100/6000/QX1
  7375. # 1.50: ILCE-7/7R/7S v1.20/v2.00, ILCE-7M2/7RM2/7SM2
  7376. },
  7377. 0x000d => {
  7378. Name => 'LensE-mountVersion',
  7379. Format => 'int16u',
  7380. PrintConv => 'sprintf("%x.%.2x",$val>>8,$val&0xff)',
  7381. PrintConvInv => 'my @a=split(/\./,$val);(hex($a[0])<<8)|hex($a[1])',
  7382. # lens models:
  7383. # 0.00: Unknown lenses/adapters
  7384. # 1.00: SEL18200LE, Sigma DN, Tamron Di III, Zeiss Touit
  7385. # 1.07: (Ver.01) original E-lenses (SEL16F28, SEL18200, SEL1855, SEL24F18Z, SEL30M35, SEL50F18, SEL55210) and LA-EA1
  7386. # 1.08: LA-EA1 (Ver.02), Metabones Smart
  7387. # 1.14: LA-EA2
  7388. # 1.20: (Ver.02) firmware-updated E-lenses (SEL1855, SEL24F18Z, SEL30M35, SEL50F18, SEL55210),
  7389. # newer E-lenses (SEL1018, SEL1670Z, SEL20F28, SEL35F18, SELP1650, SELP18105G, SELP18200) or LA-EA3
  7390. # 1.30: LA-EA4
  7391. # 1.31: original FE-lenses (SEL2470Z, SEL2870, SEL35F28Z, SEL55F18Z), SEL1850
  7392. # 1.35: SEL70200G, SEL55210 (Black?, seen with ILCE-3500)
  7393. # 1.40: SEL1635Z, SEL24240, SEL35F14Z, SELP28135G, Zeiss Loxia 35mm/50mm
  7394. # 1.50: SEL28F20, SEL90M28G, Zeiss Batis 25mm/85mm, Zeiss Loxia 21mm
  7395. },
  7396. 0x0015 => {
  7397. Name => 'LensFirmwareVersion',
  7398. Format => 'int8u',
  7399. PrintConv => 'sprintf("Ver.%.2x",$val)',
  7400. PrintConvInv => '$val=~/Ver\.//; hex($val)',
  7401. # 0x00: Sony Ver.00
  7402. # 0x01: Sony Ver.01
  7403. # 0x02: Sony Ver.02
  7404. # 0x16: Metabones V0.16
  7405. # 0x19: Metabones V0.19
  7406. # 0x22: Metabones V0.22
  7407. # 0x24: Metabones V0.24
  7408. # 0x30: Metabones V0.30
  7409. # 0x32: Metabones V0.32
  7410. # 0x41: Metabones V0.41 (ILCE-7RM2 with Metabones Smart IV)
  7411. },
  7412. # 0x0016 - 0x003f: non-0 data present when: 0x0001>0 AND 0x0008=4(E-mount) AND 0x000f<255
  7413. );
  7414. # AFInfo (SLT models only) (ref PH, decoded mainly from A77)
  7415. %Image::ExifTool::Sony::AFInfo = (
  7416. PROCESS_PROC => \&ProcessEnciphered,
  7417. WRITE_PROC => \&WriteEnciphered,
  7418. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7419. FORMAT => 'int8u',
  7420. WRITABLE => 1,
  7421. FIRST_ENTRY => 0,
  7422. PRIORITY => 0,
  7423. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7424. DATAMEMBER => [ 0x02 ],
  7425. IS_SUBDIR => [ 0x11 ],
  7426. NOTES => 'These tags are currently extracted for SLT models only.',
  7427. # first 4 bytes (deciphered) (ref JR):
  7428. # 0 1 1 0 for A37, A57, A58
  7429. # 2 1 1 0 for A65V
  7430. # 2 1 2 0 for A77V
  7431. # 0 1 2 0 for A99V
  7432. # 1 1 3 0 for ILCA-77M2
  7433. # 0 0 0 0 for NEX and ILCE-3000/3500
  7434. # 1 0 0 0 for ILCE-5000/5100/6000/7/7M2/7R/7S/QX1
  7435. # 6 0 0 0 for ILCE-7RM2/7SM2
  7436. # 0 2 0 0 for NEX/ILCE with LA-EA2/EA4 Phase-AF adapter
  7437. # 2 0 0 0 seen for a few NEX-5N images
  7438. # 2 2 0 0 seen for a few NEX-5N/7 images with LA-EA2 adapter
  7439. 0x02 => {
  7440. Name => 'AFType',
  7441. RawConv => '$$self{AFType} = $val',
  7442. PrintConv => {
  7443. # 0 => '?? n.a.', # seen on some A99V images with non-AF (Samyang) lens
  7444. 1 => '15-point',
  7445. 2 => '19-point',
  7446. 3 => '79-point', # (NC) seen for ILCA-77M2
  7447. },
  7448. },
  7449. ### decoding for SLT; ILCA-77M2 (AFType == 3) uses different offsets: see below
  7450. 0x04 => {
  7451. Name => 'AFStatusActiveSensor',
  7452. Condition => '$$self{Model} !~ /^ILCA-/',
  7453. %Image::ExifTool::Minolta::afStatusInfo,
  7454. },
  7455. 0x07 => [ # the active AF sensor
  7456. {
  7457. Name => 'AFPoint',
  7458. Condition => '$$self{AFType} == 1',
  7459. Notes => 'models with 15-point AF',
  7460. PrintConvColumns => 2,
  7461. PrintConv => \%afPoint15,
  7462. },{
  7463. Name => 'AFPoint',
  7464. Condition => '$$self{AFType} == 2',
  7465. Notes => 'models with 19-point AF',
  7466. PrintConvColumns => 2,
  7467. PrintConv => \%afPoint19,
  7468. },
  7469. ],
  7470. 0x08 => [ # the AF sensor in focus at focus time (shutter release half press)
  7471. {
  7472. Name => 'AFPointInFocus',
  7473. Condition => '$$self{AFType} == 1',
  7474. Notes => 'models with 15-point AF',
  7475. PrintConvColumns => 2,
  7476. PrintConv => {
  7477. %afPoint15,
  7478. 255 => '(none)',
  7479. },
  7480. },{
  7481. Name => 'AFPointInFocus',
  7482. Condition => '$$self{AFType} == 2',
  7483. Notes => 'models with 19-point AF',
  7484. PrintConvColumns => 2,
  7485. PrintConv => {
  7486. %afPoint19,
  7487. 255 => '(none)',
  7488. },
  7489. },
  7490. ],
  7491. 0x09 => [ # the AF sensor in focus at shutter release (shutter release full press)
  7492. {
  7493. Name => 'AFPointAtShutterRelease',
  7494. Condition => '$$self{AFType} == 1',
  7495. Notes => 'models with 15-point AF',
  7496. PrintConvColumns => 2,
  7497. PrintConv => {
  7498. %afPoint15,
  7499. 30 => '(out of focus)',
  7500. },
  7501. },{
  7502. Name => 'AFPointAtShutterRelease',
  7503. Condition => '$$self{AFType} == 2',
  7504. Notes => 'models with 19-point AF',
  7505. PrintConvColumns => 2,
  7506. PrintConv => {
  7507. %afPoint19,
  7508. 30 => '(out of focus)',
  7509. },
  7510. },
  7511. ],
  7512. 0x0a => {
  7513. Name => 'AFAreaMode',
  7514. Condition => '$$self{Model} !~ /^ILCA-/',
  7515. PrintConv => {
  7516. 0 => 'Wide',
  7517. 1 => 'Spot',
  7518. 2 => 'Local',
  7519. 3 => 'Zone',
  7520. },
  7521. },
  7522. 0x0b => {
  7523. Name => 'FocusMode',
  7524. Condition => '$$self{Model} !~ /^ILCA-/',
  7525. PrintConvColumns => 2,
  7526. # validated for A77 firmware 1.03, 1.04 and 1.07 and A99
  7527. # - not confirmed for A37,A57 and A65 which also write this tag
  7528. PrintConv => {
  7529. 0 => 'Manual',
  7530. 2 => 'AF-S',
  7531. 3 => 'AF-C',
  7532. 4 => 'AF-A',
  7533. 6 => 'DMF',
  7534. 7 => 'AF-D', # (unique to A99)
  7535. },
  7536. },
  7537. 0x11 => [ #JR
  7538. {
  7539. Name => 'AFStatus15',
  7540. Condition => '$$self{AFType} == 1',
  7541. Format => 'int16s[18]',
  7542. SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFStatus15' },
  7543. },{
  7544. Name => 'AFStatus19',
  7545. Condition => '$$self{AFType} == 2',
  7546. Format => 'int16s[30]',
  7547. SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFStatus19' },
  7548. },
  7549. ],
  7550. # 0x004d - 18 or 30 int16 values
  7551. # 0x0089 - 18 or 30 int16 values
  7552. # 0x00b1 - 18 or 30 int16 values
  7553. # 0x0121 - 18 or 30 int16s values, similar to 0x11 AFStatus
  7554. # 0x016e - SLT: 4 bytes indicating 'AFPointsUsed', identical to first 4 bytes of 0x2020 for A58/A99V
  7555. 0x016e => {
  7556. Name => 'AFPointsUsed',
  7557. Condition => '$$self{Model} !~ /^ILCA-/',
  7558. Notes => 'SLT models only',
  7559. Format => 'int32u',
  7560. PrintConvColumns => 2,
  7561. PrintConv => {
  7562. 0 => '(none)',
  7563. BITMASK => {
  7564. 0 => 'Center',
  7565. 1 => 'Top',
  7566. 2 => 'Upper-right',
  7567. 3 => 'Right',
  7568. 4 => 'Lower-right',
  7569. 5 => 'Bottom',
  7570. 6 => 'Lower-left',
  7571. 7 => 'Left',
  7572. 8 => 'Upper-left',
  7573. 9 => 'Far Right',
  7574. 10 => 'Far Left',
  7575. 11 => 'Upper-middle',
  7576. 12 => 'Near Right',
  7577. 13 => 'Lower-middle',
  7578. 14 => 'Near Left',
  7579. 15 => 'Upper Far Right',
  7580. 16 => 'Lower Far Right',
  7581. 17 => 'Lower Far Left',
  7582. 18 => 'Upper Far Left',
  7583. },
  7584. },
  7585. },
  7586. # 0x017b and 0x017c also have to do with AFMicroAdj (ref JR)
  7587. 0x017d => { #PH (verified for the SLT-A77/A99; other SLT models don't have this setting - ref JR)
  7588. # (different from AFMicroAdjValue because it is 0 when the adjustment is off)
  7589. Name => 'AFMicroAdj',
  7590. Condition => '$$self{Model} !~ /^ILCA-/',
  7591. Format => 'int8s',
  7592. },
  7593. 0x017e => { #JR
  7594. Name => 'ExposureProgram',
  7595. Condition => '$$self{Model} !~ /^ILCA-/',
  7596. Priority => 0,
  7597. SeparateTable => 'ExposureProgram3',
  7598. PrintConv => \%sonyExposureProgram3,
  7599. },
  7600. # 0x01b8 - 65 AF Info blocks of 180 bytes each for SLT (ref JR)
  7601. # In each block, the 9th, 10th and 11th byte appear to relate to AFPoint as at offsets 0x07, 0x08, 0x09 above..
  7602. # Possibly, these blocks relate to sequential focusing attempts and/or object tracking,
  7603. # the first byte being an Index or Counter.
  7604. # The last block before the block with index 0, appears to relate to the AF data at ShutterRelease.
  7605. # 0xf38,0x1208,0x14d8,0x158c,0x1640,(and more) - 0 if AFMicroAdj is On, 1 if Off
  7606. # 0x1ab6 - 0x80 if AFMicroAdj is On, 0 if Off
  7607. # tags also related to AFPoint (PH, A77):
  7608. # 0x11ec, 0x122a, 0x1408, 0x1446, 0x14bc, 0x1f86,
  7609. # 0x14fa, 0x1570, 0x1572, 0x15ae, 0x1f48
  7610. ### decoding for ILCA-77M2, AFType == 3
  7611. 0x0005 => { #JR
  7612. Name => 'FocusMode',
  7613. Condition => '$$self{Model} =~ /^ILCA-/',
  7614. Notes => 'ILCA models only',
  7615. Writable => 'int8u',
  7616. Priority => 0,
  7617. PrintConv => {
  7618. 0 => 'Manual',
  7619. 2 => 'AF-S',
  7620. 3 => 'AF-C',
  7621. 4 => 'AF-A',
  7622. # 6 => 'DMF', # not yet seen
  7623. # 7 => 'AF-D', # not yet seen
  7624. },
  7625. },
  7626. # 0x0010 - for ILCA-77M2: 10 bytes identical to 0x2020, and probably indicating 'AFPointsUsed' (ref JR)
  7627. 0x0010 => {
  7628. Name => 'AFPointsUsed',
  7629. Condition => '$$self{Model} =~ /^ILCA-/',
  7630. Format => 'int8u[10]',
  7631. BitsPerWord => 8,
  7632. BitsTotal => 80,
  7633. PrintConv => {
  7634. 0 => '(none)',
  7635. BITMASK => { %afPoints79 },
  7636. },
  7637. },
  7638. # 0x0037, 0x0038, 0x0039 similar to 0x07, 0x08, 0x09, but using numbers from 0-94 for ILCA-77M2
  7639. 0x0037 => { # the active AF sensor
  7640. Name => 'AFPoint',
  7641. Condition => '$$self{AFType} == 3',
  7642. PrintConv => {
  7643. %afPoints79_940e,
  7644. 255 => '(none)',
  7645. },
  7646. },
  7647. 0x0038 => { # the AF sensor in focus at focus time (shutter release half press)
  7648. Name => 'AFPointInFocus',
  7649. Condition => '$$self{AFType} == 3',
  7650. PrintConv => {
  7651. %afPoints79_940e,
  7652. 255 => '(none)',
  7653. },
  7654. },
  7655. 0x0039 => { # the AF sensor in focus at shutter release (shutter release full press)
  7656. Name => 'AFPointAtShutterRelease',
  7657. Condition => '$$self{AFType} == 3',
  7658. PrintConv => {
  7659. %afPoints79_940e,
  7660. 95 => '(none)',
  7661. },
  7662. },
  7663. 0x003a => { #JR
  7664. Name => 'AFAreaMode',
  7665. Condition => '$$self{Model} =~ /^ILCA-/',
  7666. PrintConv => {
  7667. 0 => 'Wide',
  7668. 1 => 'Center',
  7669. 2 => 'Flexible Spot',
  7670. 3 => 'Zone',
  7671. 4 => 'Expanded Flexible Spot', # (NC)
  7672. },
  7673. },
  7674. 0x003b => {
  7675. Name => 'AFStatusActiveSensor',
  7676. Condition => '$$self{Model} =~ /^ILCA-/',
  7677. %Image::ExifTool::Minolta::afStatusInfo,
  7678. },
  7679. 0x0043 => {
  7680. Name => 'ExposureProgram',
  7681. Condition => '$$self{Model} =~ /^ILCA-/',
  7682. Priority => 0,
  7683. SeparateTable => 'ExposureProgram3',
  7684. PrintConv => \%sonyExposureProgram3,
  7685. },
  7686. # 0x004e and 0x004f also have to do with AFMicroAdj (ref JR)
  7687. 0x0050 => { #PH (ILCA-A77M2, to be confirmed for other ILCA models)
  7688. Name => 'AFMicroAdj',
  7689. Condition => '$$self{Model} =~ /^ILCA-/',
  7690. Format => 'int8s',
  7691. },
  7692. # 0x007d - AFStatus79 - 95 int16s values for the ILCA-77M2 79 AF points + 15 cross + 1 F2.8
  7693. 0x007d => {
  7694. Name => 'AFStatus79',
  7695. Condition => '$$self{AFType} == 3',
  7696. Format => 'int16s[95]',
  7697. SubDirectory => { TagTable => 'Image::ExifTool::Sony::AFStatus79' },
  7698. },
  7699. # 0x013b - 95 int8u values
  7700. # 0x01ab - 95 int8u values
  7701. # 0x021b - 95 int16s values, similar to 0x007d AFStatus79
  7702. # 0x04c0 - 45 AF Info blocks of 244 bytes each for ILCA
  7703. );
  7704. %Image::ExifTool::Sony::Tag940e = ( #JR
  7705. PROCESS_PROC => \&ProcessEnciphered,
  7706. WRITE_PROC => \&WriteEnciphered,
  7707. CHECK_PROC => \&Image::ExifTool::CheckBinaryData,
  7708. FORMAT => 'int8u',
  7709. FIRST_ENTRY => 0,
  7710. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7711. NOTES => 'E-mount models.',
  7712. # (see comment in AFInfo for deciphered values of first 4 bytes for various models)
  7713. # 0x0004 - if 0x0001 == 2: LA-EA2/EA4 15-point SLT Phase-detect AF adapter used:
  7714. # start of 164-byte AF Info Blocks, possibly the 11th byte might be the AFPoint.
  7715. # ILCE-7M2: 40 Blocks of 164 bytes (probably also for 7RM2: tbc)
  7716. # other NEX/ILCE: 74 blocks of 164 bytes
  7717. # 0x1a06 onwards - first seen for ILCE-7RM2: appears to be some kind of metering image
  7718. 0x1a06 => { Name => 'TiffMeteringImageWidth', Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))\b/' },
  7719. 0x1a07 => { Name => 'TiffMeteringImageHeight', Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))\b/' },
  7720. 0x1a08 => { # (2640 bytes: 1 set of 44x30 int16u values)
  7721. Name => 'TiffMeteringImage',
  7722. Condition => '$$self{Model} =~ /^(ILCE-(7RM2|7SM2))\b/',
  7723. Format => 'undef[2640]',
  7724. Notes => q{
  7725. 13(?)-bit intensity data from 1320 (1200) metering segments, extracted as a
  7726. 16-bit TIFF image
  7727. },
  7728. ValueConv => sub {
  7729. my ($val, $et) = @_;
  7730. return undef unless length $val >= 2640;
  7731. return \ "Binary data 2640 bytes" unless $et->Options('Binary');
  7732. my @dat = unpack('v*', $val);
  7733. # TIFF header for a 16-bit RGB 10dpi 44x30 image
  7734. $val = MakeTiffHeader(44,30,3,16,10);
  7735. # re-order data to RGB pixels - use same value for R, G and B
  7736. my ($i, @val);
  7737. for ($i=0; $i<44*30; ++$i) {
  7738. # data is 13-bit (max 8191), shift left to fill 16 bits
  7739. push @val, int(5041.1*log($dat[$i]+1)/log(2)), int(5041.1*log($dat[$i]+1)/log(2)), int(5041.1*log($dat[$i]+1)/log(2));
  7740. }
  7741. $val .= pack('v*', @val); # add TIFF strip data
  7742. return \$val;
  7743. },
  7744. },
  7745. );
  7746. # AF Point Status (ref JR)
  7747. %Image::ExifTool::Sony::AFStatus15 = (
  7748. %binaryDataAttrs,
  7749. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7750. NOTES => 'AF Status information for models with 15-point AF.',
  7751. 0x00 => { Name => 'AFStatusUpper-left', %Image::ExifTool::Minolta::afStatusInfo },
  7752. 0x02 => { Name => 'AFStatusLeft', %Image::ExifTool::Minolta::afStatusInfo },
  7753. 0x04 => { Name => 'AFStatusLower-left', %Image::ExifTool::Minolta::afStatusInfo },
  7754. 0x06 => { Name => 'AFStatusFarLeft', %Image::ExifTool::Minolta::afStatusInfo },
  7755. 0x08 => { Name => 'AFStatusTopHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7756. 0x0a => { Name => 'AFStatusNearRight', %Image::ExifTool::Minolta::afStatusInfo },
  7757. 0x0c => { Name => 'AFStatusCenterHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7758. 0x0e => { Name => 'AFStatusNearLeft', %Image::ExifTool::Minolta::afStatusInfo },
  7759. 0x10 => { Name => 'AFStatusBottomHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7760. 0x12 => { Name => 'AFStatusTopVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7761. 0x14 => { Name => 'AFStatusCenterVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7762. 0x16 => { Name => 'AFStatusBottomVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7763. 0x18 => { Name => 'AFStatusFarRight', %Image::ExifTool::Minolta::afStatusInfo },
  7764. 0x1a => { Name => 'AFStatusUpper-right', %Image::ExifTool::Minolta::afStatusInfo },
  7765. 0x1c => { Name => 'AFStatusRight', %Image::ExifTool::Minolta::afStatusInfo },
  7766. 0x1e => { Name => 'AFStatusLower-right', %Image::ExifTool::Minolta::afStatusInfo },
  7767. 0x20 => { Name => 'AFStatusUpper-middle', %Image::ExifTool::Minolta::afStatusInfo },
  7768. 0x22 => { Name => 'AFStatusLower-middle', %Image::ExifTool::Minolta::afStatusInfo },
  7769. );
  7770. # AF Point Status (ref JR)
  7771. %Image::ExifTool::Sony::AFStatus19 = (
  7772. %binaryDataAttrs,
  7773. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7774. NOTES => 'AF Status information for models with 19-point AF.',
  7775. 0x00 => { Name => 'AFStatusUpperFarLeft', %Image::ExifTool::Minolta::afStatusInfo },
  7776. 0x02 => { Name => 'AFStatusUpper-leftHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7777. 0x04 => { Name => 'AFStatusFarLeftHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7778. 0x06 => { Name => 'AFStatusLeftHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7779. 0x08 => { Name => 'AFStatusLowerFarLeft', %Image::ExifTool::Minolta::afStatusInfo },
  7780. 0x0a => { Name => 'AFStatusLower-leftHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7781. 0x0c => { Name => 'AFStatusUpper-leftVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7782. 0x0e => { Name => 'AFStatusLeftVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7783. 0x10 => { Name => 'AFStatusLower-leftVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7784. 0x12 => { Name => 'AFStatusFarLeftVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7785. 0x14 => { Name => 'AFStatusTopHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7786. 0x16 => { Name => 'AFStatusNearRight', %Image::ExifTool::Minolta::afStatusInfo },
  7787. 0x18 => { Name => 'AFStatusCenterHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7788. 0x1a => { Name => 'AFStatusNearLeft', %Image::ExifTool::Minolta::afStatusInfo },
  7789. 0x1c => { Name => 'AFStatusBottomHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7790. 0x1e => { Name => 'AFStatusTopVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7791. 0x20 => { Name => 'AFStatusUpper-middle', %Image::ExifTool::Minolta::afStatusInfo },
  7792. 0x22 => { Name => 'AFStatusCenterVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7793. 0x24 => { Name => 'AFStatusLower-middle', %Image::ExifTool::Minolta::afStatusInfo },
  7794. 0x26 => { Name => 'AFStatusBottomVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7795. 0x28 => { Name => 'AFStatusUpperFarRight', %Image::ExifTool::Minolta::afStatusInfo },
  7796. 0x2a => { Name => 'AFStatusUpper-rightHorizontal',%Image::ExifTool::Minolta::afStatusInfo },
  7797. 0x2c => { Name => 'AFStatusFarRightHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7798. 0x2e => { Name => 'AFStatusRightHorizontal', %Image::ExifTool::Minolta::afStatusInfo },
  7799. 0x30 => { Name => 'AFStatusLowerFarRight', %Image::ExifTool::Minolta::afStatusInfo },
  7800. 0x32 => { Name => 'AFStatusLower-rightHorizontal',%Image::ExifTool::Minolta::afStatusInfo },
  7801. 0x34 => { Name => 'AFStatusFarRightVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7802. 0x36 => { Name => 'AFStatusUpper-rightVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7803. 0x38 => { Name => 'AFStatusRightVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7804. 0x3a => { Name => 'AFStatusLower-rightVertical', %Image::ExifTool::Minolta::afStatusInfo },
  7805. );
  7806. # AF Point Status (ref JR)
  7807. %Image::ExifTool::Sony::AFStatus79 = (
  7808. %binaryDataAttrs,
  7809. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  7810. NOTES => 'AF Status information for models with 79-point AF.',
  7811. #
  7812. # ILCA-77M2 AF sensor layout:
  7813. # A5* A6* A7*
  7814. # B2 B3 B4 B5 B6 B7 B8 B9 B10
  7815. # C1 C2 C3 C4 C5* C6* C7* C8 C9 C10 C11
  7816. # D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11
  7817. # E1 E2 E3 E4 E5* E6* E7* E8 E9 E10 E11
  7818. # F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11
  7819. # G1 G2 G3 G4 G5* G6* G7* G8 G9 G10 G11
  7820. # H2 H3 H4 H5 H6 H7 H8 H9 H10
  7821. # I5* I6* I7*
  7822. # left section, from top to bottom, from right to left
  7823. 0x00 => { Name => 'AFStatus_00_B4', %Image::ExifTool::Minolta::afStatusInfo },
  7824. 0x02 => { Name => 'AFStatus_01_C4', %Image::ExifTool::Minolta::afStatusInfo },
  7825. 0x04 => { Name => 'AFStatus_02_D4', %Image::ExifTool::Minolta::afStatusInfo },
  7826. 0x06 => { Name => 'AFStatus_03_E4', %Image::ExifTool::Minolta::afStatusInfo },
  7827. 0x08 => { Name => 'AFStatus_04_F4', %Image::ExifTool::Minolta::afStatusInfo },
  7828. 0x0a => { Name => 'AFStatus_05_G4', %Image::ExifTool::Minolta::afStatusInfo },
  7829. 0x0c => { Name => 'AFStatus_06_H4', %Image::ExifTool::Minolta::afStatusInfo },
  7830. 0x0e => { Name => 'AFStatus_07_B3', %Image::ExifTool::Minolta::afStatusInfo },
  7831. 0x10 => { Name => 'AFStatus_08_C3', %Image::ExifTool::Minolta::afStatusInfo },
  7832. 0x12 => { Name => 'AFStatus_09_D3', %Image::ExifTool::Minolta::afStatusInfo },
  7833. 0x14 => { Name => 'AFStatus_10_E3', %Image::ExifTool::Minolta::afStatusInfo },
  7834. 0x16 => { Name => 'AFStatus_11_F3', %Image::ExifTool::Minolta::afStatusInfo },
  7835. 0x18 => { Name => 'AFStatus_12_G3', %Image::ExifTool::Minolta::afStatusInfo },
  7836. 0x1a => { Name => 'AFStatus_13_H3', %Image::ExifTool::Minolta::afStatusInfo },
  7837. 0x1c => { Name => 'AFStatus_14_B2', %Image::ExifTool::Minolta::afStatusInfo },
  7838. 0x1e => { Name => 'AFStatus_15_C2', %Image::ExifTool::Minolta::afStatusInfo },
  7839. 0x20 => { Name => 'AFStatus_16_D2', %Image::ExifTool::Minolta::afStatusInfo },
  7840. 0x22 => { Name => 'AFStatus_17_E2', %Image::ExifTool::Minolta::afStatusInfo },
  7841. 0x24 => { Name => 'AFStatus_18_F2', %Image::ExifTool::Minolta::afStatusInfo },
  7842. 0x26 => { Name => 'AFStatus_19_G2', %Image::ExifTool::Minolta::afStatusInfo },
  7843. 0x28 => { Name => 'AFStatus_20_H2', %Image::ExifTool::Minolta::afStatusInfo },
  7844. 0x2a => { Name => 'AFStatus_21_C1', %Image::ExifTool::Minolta::afStatusInfo },
  7845. 0x2c => { Name => 'AFStatus_22_D1', %Image::ExifTool::Minolta::afStatusInfo },
  7846. 0x2e => { Name => 'AFStatus_23_E1', %Image::ExifTool::Minolta::afStatusInfo },
  7847. 0x30 => { Name => 'AFStatus_24_F1', %Image::ExifTool::Minolta::afStatusInfo },
  7848. 0x32 => { Name => 'AFStatus_25_G1', %Image::ExifTool::Minolta::afStatusInfo },
  7849. # center section, cross-sensors *, from right to left, from top to bottom
  7850. # These are presumably Vertical, as all others are default Horizontal (ref Sony ILCA-77M2 brochure).
  7851. 0x34 => { Name => 'AFStatus_26_A7_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7852. 0x36 => { Name => 'AFStatus_27_A6_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7853. 0x38 => { Name => 'AFStatus_28_A5_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7854. 0x3a => { Name => 'AFStatus_29_C7_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7855. 0x3c => { Name => 'AFStatus_30_C6_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7856. 0x3e => { Name => 'AFStatus_31_C5_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7857. 0x40 => { Name => 'AFStatus_32_E7_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7858. 0x42 => { Name => 'AFStatus_33_E6_Center_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7859. 0x44 => { Name => 'AFStatus_34_E5_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7860. 0x46 => { Name => 'AFStatus_35_G7_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7861. 0x48 => { Name => 'AFStatus_36_G6_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7862. 0x4a => { Name => 'AFStatus_37_G5_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7863. 0x4c => { Name => 'AFStatus_38_I7_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7864. 0x4e => { Name => 'AFStatus_39_I6_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7865. 0x50 => { Name => 'AFStatus_40_I5_Vertical', %Image::ExifTool::Minolta::afStatusInfo },
  7866. # center section, all sensors, from top to bottom, from right to left
  7867. 0x52 => { Name => 'AFStatus_41_A7', %Image::ExifTool::Minolta::afStatusInfo },
  7868. 0x54 => { Name => 'AFStatus_42_B7', %Image::ExifTool::Minolta::afStatusInfo },
  7869. 0x56 => { Name => 'AFStatus_43_C7', %Image::ExifTool::Minolta::afStatusInfo },
  7870. 0x58 => { Name => 'AFStatus_44_D7', %Image::ExifTool::Minolta::afStatusInfo },
  7871. 0x5a => { Name => 'AFStatus_45_E7', %Image::ExifTool::Minolta::afStatusInfo },
  7872. 0x5c => { Name => 'AFStatus_46_F7', %Image::ExifTool::Minolta::afStatusInfo },
  7873. 0x5e => { Name => 'AFStatus_47_G7', %Image::ExifTool::Minolta::afStatusInfo },
  7874. 0x60 => { Name => 'AFStatus_48_H7', %Image::ExifTool::Minolta::afStatusInfo },
  7875. 0x62 => { Name => 'AFStatus_49_I7', %Image::ExifTool::Minolta::afStatusInfo },
  7876. 0x64 => { Name => 'AFStatus_50_A6', %Image::ExifTool::Minolta::afStatusInfo },
  7877. 0x66 => { Name => 'AFStatus_51_B6', %Image::ExifTool::Minolta::afStatusInfo },
  7878. 0x68 => { Name => 'AFStatus_52_C6', %Image::ExifTool::Minolta::afStatusInfo },
  7879. 0x6a => { Name => 'AFStatus_53_D6', %Image::ExifTool::Minolta::afStatusInfo },
  7880. 0x6c => { Name => 'AFStatus_54_E6_Center', %Image::ExifTool::Minolta::afStatusInfo },
  7881. 0x6e => { Name => 'AFStatus_55_F6', %Image::ExifTool::Minolta::afStatusInfo },
  7882. 0x70 => { Name => 'AFStatus_56_G6', %Image::ExifTool::Minolta::afStatusInfo },
  7883. 0x72 => { Name => 'AFStatus_57_H6', %Image::ExifTool::Minolta::afStatusInfo },
  7884. 0x74 => { Name => 'AFStatus_58_I6', %Image::ExifTool::Minolta::afStatusInfo },
  7885. 0x76 => { Name => 'AFStatus_59_A5', %Image::ExifTool::Minolta::afStatusInfo },
  7886. 0x78 => { Name => 'AFStatus_60_B5', %Image::ExifTool::Minolta::afStatusInfo },
  7887. 0x7a => { Name => 'AFStatus_61_C5', %Image::ExifTool::Minolta::afStatusInfo },
  7888. 0x7c => { Name => 'AFStatus_62_D5', %Image::ExifTool::Minolta::afStatusInfo },
  7889. 0x7e => { Name => 'AFStatus_63_E5', %Image::ExifTool::Minolta::afStatusInfo },
  7890. 0x80 => { Name => 'AFStatus_64_F5', %Image::ExifTool::Minolta::afStatusInfo },
  7891. 0x82 => { Name => 'AFStatus_65_G5', %Image::ExifTool::Minolta::afStatusInfo },
  7892. 0x84 => { Name => 'AFStatus_66_H5', %Image::ExifTool::Minolta::afStatusInfo },
  7893. 0x86 => { Name => 'AFStatus_67_I5', %Image::ExifTool::Minolta::afStatusInfo },
  7894. # right section, from top to bottom, from right to left
  7895. 0x88 => { Name => 'AFStatus_68_C11', %Image::ExifTool::Minolta::afStatusInfo },
  7896. 0x8a => { Name => 'AFStatus_69_D11', %Image::ExifTool::Minolta::afStatusInfo },
  7897. 0x8c => { Name => 'AFStatus_70_E11', %Image::ExifTool::Minolta::afStatusInfo },
  7898. 0x8e => { Name => 'AFStatus_71_F11', %Image::ExifTool::Minolta::afStatusInfo },
  7899. 0x90 => { Name => 'AFStatus_72_G11', %Image::ExifTool::Minolta::afStatusInfo },
  7900. 0x92 => { Name => 'AFStatus_73_B10', %Image::ExifTool::Minolta::afStatusInfo },
  7901. 0x94 => { Name => 'AFStatus_74_C10', %Image::ExifTool::Minolta::afStatusInfo },
  7902. 0x96 => { Name => 'AFStatus_75_D10', %Image::ExifTool::Minolta::afStatusInfo },
  7903. 0x98 => { Name => 'AFStatus_76_E10', %Image::ExifTool::Minolta::afStatusInfo },
  7904. 0x9a => { Name => 'AFStatus_77_F10', %Image::ExifTool::Minolta::afStatusInfo },
  7905. 0x9c => { Name => 'AFStatus_78_G10', %Image::ExifTool::Minolta::afStatusInfo },
  7906. 0x9e => { Name => 'AFStatus_79_H10', %Image::ExifTool::Minolta::afStatusInfo },
  7907. 0xa0 => { Name => 'AFStatus_80_B9', %Image::ExifTool::Minolta::afStatusInfo },
  7908. 0xa2 => { Name => 'AFStatus_81_C9', %Image::ExifTool::Minolta::afStatusInfo },
  7909. 0xa4 => { Name => 'AFStatus_82_D9', %Image::ExifTool::Minolta::afStatusInfo },
  7910. 0xa6 => { Name => 'AFStatus_83_E9', %Image::ExifTool::Minolta::afStatusInfo },
  7911. 0xa8 => { Name => 'AFStatus_84_F9', %Image::ExifTool::Minolta::afStatusInfo },
  7912. 0xaa => { Name => 'AFStatus_85_G9', %Image::ExifTool::Minolta::afStatusInfo },
  7913. 0xac => { Name => 'AFStatus_86_H9', %Image::ExifTool::Minolta::afStatusInfo },
  7914. 0xae => { Name => 'AFStatus_87_B8', %Image::ExifTool::Minolta::afStatusInfo },
  7915. 0xb0 => { Name => 'AFStatus_88_C8', %Image::ExifTool::Minolta::afStatusInfo },
  7916. 0xb2 => { Name => 'AFStatus_89_D8', %Image::ExifTool::Minolta::afStatusInfo },
  7917. 0xb4 => { Name => 'AFStatus_90_E8', %Image::ExifTool::Minolta::afStatusInfo },
  7918. 0xb6 => { Name => 'AFStatus_91_F8', %Image::ExifTool::Minolta::afStatusInfo },
  7919. 0xb8 => { Name => 'AFStatus_92_G8', %Image::ExifTool::Minolta::afStatusInfo },
  7920. 0xba => { Name => 'AFStatus_93_H8', %Image::ExifTool::Minolta::afStatusInfo },
  7921. # central F2.8 sensor
  7922. 0xbc => { Name => 'AFStatus_94_E6_Center_F2-8', %Image::ExifTool::Minolta::afStatusInfo },
  7923. );
  7924. %Image::ExifTool::Sony::FaceInfo1 = (
  7925. %binaryDataAttrs,
  7926. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7927. 0x00 => {
  7928. Name => 'Face1Position',
  7929. Format => 'int16u[4]',
  7930. Notes => q{
  7931. top, left, height and width of detected face. Coordinates are relative to
  7932. the full-sized unrotated image, with increasing Y downwards
  7933. },
  7934. RawConv => '$$self{FacesDetected} < 1 ? undef : $val',
  7935. },
  7936. 0x20 => {
  7937. Name => 'Face2Position',
  7938. Format => 'int16u[4]',
  7939. RawConv => '$$self{FacesDetected} < 2 ? undef : $val',
  7940. },
  7941. 0x40 => {
  7942. Name => 'Face3Position',
  7943. Format => 'int16u[4]',
  7944. RawConv => '$$self{FacesDetected} < 3 ? undef : $val',
  7945. },
  7946. 0x60 => {
  7947. Name => 'Face4Position',
  7948. Format => 'int16u[4]',
  7949. RawConv => '$$self{FacesDetected} < 4 ? undef : $val',
  7950. },
  7951. 0x80 => {
  7952. Name => 'Face5Position',
  7953. Format => 'int16u[4]',
  7954. RawConv => '$$self{FacesDetected} < 5 ? undef : $val',
  7955. },
  7956. 0xa0 => {
  7957. Name => 'Face6Position',
  7958. Format => 'int16u[4]',
  7959. RawConv => '$$self{FacesDetected} < 6 ? undef : $val',
  7960. },
  7961. 0xc0 => {
  7962. Name => 'Face7Position',
  7963. Format => 'int16u[4]',
  7964. RawConv => '$$self{FacesDetected} < 7 ? undef : $val',
  7965. },
  7966. 0xe0 => {
  7967. Name => 'Face8Position',
  7968. Format => 'int16u[4]',
  7969. RawConv => '$$self{FacesDetected} < 8 ? undef : $val',
  7970. },
  7971. );
  7972. %Image::ExifTool::Sony::FaceInfo2 = (
  7973. %binaryDataAttrs,
  7974. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  7975. 0x00 => {
  7976. Name => 'Face1Position',
  7977. Format => 'int16u[4]',
  7978. Notes => q{
  7979. top, left, height and width of detected face. Coordinates are relative to
  7980. the full-sized unrotated image, with increasing Y downwards
  7981. },
  7982. RawConv => '$$self{FacesDetected} < 1 ? undef : $val',
  7983. },
  7984. 0x25 => {
  7985. Name => 'Face2Position',
  7986. Format => 'int16u[4]',
  7987. RawConv => '$$self{FacesDetected} < 2 ? undef : $val',
  7988. },
  7989. 0x4a => {
  7990. Name => 'Face3Position',
  7991. Format => 'int16u[4]',
  7992. RawConv => '$$self{FacesDetected} < 3 ? undef : $val',
  7993. },
  7994. 0x6f => {
  7995. Name => 'Face4Position',
  7996. Format => 'int16u[4]',
  7997. RawConv => '$$self{FacesDetected} < 4 ? undef : $val',
  7998. },
  7999. 0x94 => {
  8000. Name => 'Face5Position',
  8001. Format => 'int16u[4]',
  8002. RawConv => '$$self{FacesDetected} < 5 ? undef : $val',
  8003. },
  8004. 0xb9 => {
  8005. Name => 'Face6Position',
  8006. Format => 'int16u[4]',
  8007. RawConv => '$$self{FacesDetected} < 6 ? undef : $val',
  8008. },
  8009. 0xde => {
  8010. Name => 'Face7Position',
  8011. Format => 'int16u[4]',
  8012. RawConv => '$$self{FacesDetected} < 7 ? undef : $val',
  8013. },
  8014. 0x103 => {
  8015. Name => 'Face8Position',
  8016. Format => 'int16u[4]',
  8017. RawConv => '$$self{FacesDetected} < 8 ? undef : $val',
  8018. },
  8019. );
  8020. # panorama info for cameras such as the HX1, HX5, TX7 (ref 9/PH)
  8021. %Image::ExifTool::Sony::Panorama = (
  8022. %binaryDataAttrs,
  8023. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  8024. FORMAT => 'int32u',
  8025. NOTES => q{
  8026. Tags found in panorama images from various Sony DSC, NEX, SLT and DSLR
  8027. cameras. The width/height values of these tags are not affected by camera
  8028. rotation -- the width is always the longer dimension.
  8029. },
  8030. # 0: 257 for panorama images, 0 for all other images (ref JR)
  8031. 1 => 'PanoramaFullWidth', # (including black/grey borders)
  8032. 2 => 'PanoramaFullHeight',
  8033. 3 => {
  8034. Name => 'PanoramaDirection',
  8035. PrintConv => {
  8036. 0 => 'Left or Up',
  8037. 1 => 'Right or Down',
  8038. },
  8039. },
  8040. # crop area to remove black/grey borders from full image
  8041. 4 => 'PanoramaCropLeft',
  8042. 5 => 'PanoramaCropTop', #PH guess (NC)
  8043. 6 => 'PanoramaCropRight',
  8044. 7 => 'PanoramaCropBottom',
  8045. # 8: 1728 (HX1), 1824 (HX5/TX7) (value8/value9 = 16/9)
  8046. 8 => 'PanoramaFrameWidth', #PH guess (NC)
  8047. # 9: 972 (HX1), 1026 (HX5/TX7)
  8048. 9 => 'PanoramaFrameHeight', #PH guess (NC)
  8049. # 10: 3200-3800 (HX1), 4000-4900 (HX5/TX7)
  8050. 10 => 'PanoramaSourceWidth', #PH guess (NC)
  8051. # 11: 800-1800 (larger for taller panoramas)
  8052. 11 => 'PanoramaSourceHeight', #PH guess (NC)
  8053. # 12-15: 0
  8054. );
  8055. # tag table for SRF0 IFD (ref 1)
  8056. %Image::ExifTool::Sony::SRF = (
  8057. PROCESS_PROC => \&ProcessSRF,
  8058. GROUPS => { 0 => 'MakerNotes', 1 => 'SRF#', 2 => 'Camera' },
  8059. NOTES => q{
  8060. The maker notes in SRF (Sony Raw Format) images contain 7 IFD's with family
  8061. 1 group names SRF0 through SRF6. SRF0 and SRF1 use the tags in this table,
  8062. while SRF2 through SRF5 use the tags in the next table, and SRF6 uses
  8063. standard EXIF tags. All information other than SRF0 is encrypted, but
  8064. thanks to Dave Coffin the decryption algorithm is known. SRF images are
  8065. written by the Sony DSC-F828 and DSC-V3.
  8066. },
  8067. # tags 0-1 are used in SRF1
  8068. 0 => {
  8069. Name => 'SRF2Key',
  8070. Notes => 'key to decrypt maker notes from the start of SRF2',
  8071. RawConv => '$$self{SRF2Key} = $val',
  8072. },
  8073. 1 => {
  8074. Name => 'DataKey',
  8075. Notes => 'key to decrypt the rest of the file from the end of the maker notes',
  8076. RawConv => '$$self{SRFDataKey} = $val',
  8077. },
  8078. # SRF0 contains a single unknown tag with TagID 0x0003
  8079. );
  8080. # tag table for Sony RAW Format (ref 1)
  8081. %Image::ExifTool::Sony::SRF2 = (
  8082. PROCESS_PROC => \&ProcessSRF,
  8083. GROUPS => { 0 => 'MakerNotes', 1 => 'SRF#', 2 => 'Camera' },
  8084. NOTES => "These tags are found in the SRF2 through SRF5 IFD's.",
  8085. # the following tags are used in SRF2-5
  8086. 2 => 'SRF6Offset', #PH
  8087. # SRFDataOffset references 2220 bytes of unknown data for the DSC-F828 - PH
  8088. 3 => { Name => 'SRFDataOffset', Unknown => 1 }, #PH
  8089. 4 => { Name => 'RawDataOffset' }, #PH
  8090. 5 => { Name => 'RawDataLength' }, #PH
  8091. 0x0043 => 'MaxApertureAtMaxFocal', #14
  8092. 0x0044 => 'MaxApertureAtMinFocal', #14
  8093. 0x0045 => { #14
  8094. Name => 'MinFocalLength',
  8095. PrintConv => '"$val mm"',
  8096. },
  8097. 0x0046 => { #14
  8098. Name => 'MaxFocalLength',
  8099. PrintConv => '"$val mm"',
  8100. },
  8101. 0x00c0 => 'WBRedDaylight', #14
  8102. 0x00c1 => 'WBGreenDaylight', #14
  8103. 0x00c2 => 'WBBlueDaylight', #14
  8104. 0x00c3 => 'WBRedCloudy', #14
  8105. 0x00c4 => 'WBGreenCloudy', #14
  8106. 0x00c5 => 'WBBlueCloudy', #14
  8107. 0x00c9 => 'WBRedTungsten', #14
  8108. 0x00ca => 'WBGreenTungsten', #14
  8109. 0x00cb => 'WBBlueTungsten', #14
  8110. 0x00cc => 'WBRedFlash', #14
  8111. 0x00cd => 'WBGreenFlash', #14
  8112. 0x00ce => 'WBBlueFlash', #14
  8113. 0x00d0 => 'WBRedAsShot', #14
  8114. 0x00d1 => 'WBGreenAsShot', #14
  8115. 0x00d2 => 'WBBlueAsShot', #14
  8116. );
  8117. # tag table for Sony RAW 2 Format Private IFD (ref 1)
  8118. %Image::ExifTool::Sony::SR2Private = (
  8119. PROCESS_PROC => \&ProcessSR2,
  8120. WRITE_PROC => \&WriteSR2,
  8121. GROUPS => { 0 => 'MakerNotes', 1 => 'SR2', 2 => 'Camera' },
  8122. NOTES => q{
  8123. The SR2 format uses the DNGPrivateData tag to reference a private IFD
  8124. containing these tags. SR2 images are written by the Sony DSC-R1, but
  8125. this information is also written to ARW images by other models.
  8126. },
  8127. 0x7200 => {
  8128. Name => 'SR2SubIFDOffset',
  8129. # (adjusting offset messes up calculations for AdobeSR2 in DNG images)
  8130. # Flags => 'IsOffset',
  8131. # (can't set OffsetPair or else DataMember won't be set when writing)
  8132. # OffsetPair => 0x7201,
  8133. DataMember => 'SR2SubIFDOffset',
  8134. RawConv => '$$self{SR2SubIFDOffset} = $val',
  8135. },
  8136. 0x7201 => {
  8137. Name => 'SR2SubIFDLength',
  8138. # (can't set OffsetPair or else DataMember won't be set when writing)
  8139. # OffsetPair => 0x7200,
  8140. DataMember => 'SR2SubIFDLength',
  8141. RawConv => '$$self{SR2SubIFDLength} = $val',
  8142. },
  8143. 0x7221 => {
  8144. Name => 'SR2SubIFDKey',
  8145. Format => 'int32u',
  8146. Notes => 'key to decrypt SR2SubIFD',
  8147. DataMember => 'SR2SubIFDKey',
  8148. RawConv => '$$self{SR2SubIFDKey} = $val',
  8149. PrintConv => 'sprintf("0x%.8x", $val)',
  8150. },
  8151. 0x7240 => { #PH
  8152. Name => 'IDC_IFD',
  8153. Groups => { 1 => 'SonyIDC' },
  8154. Condition => '$$valPt !~ /^\0\0\0\0/', # (just in case this could be zero)
  8155. Flags => 'SubIFD',
  8156. SubDirectory => {
  8157. DirName => 'SonyIDC',
  8158. TagTable => 'Image::ExifTool::SonyIDC::Main',
  8159. Start => '$val',
  8160. },
  8161. },
  8162. 0x7241 => { #PH
  8163. Name => 'IDC2_IFD',
  8164. Groups => { 1 => 'SonyIDC' },
  8165. Condition => '$$valPt !~ /^\0\0\0\0/', # may be zero if dir doesn't exist
  8166. Flags => 'SubIFD',
  8167. SubDirectory => {
  8168. DirName => 'SonyIDC2',
  8169. TagTable => 'Image::ExifTool::SonyIDC::Main',
  8170. Start => '$val',
  8171. Base => '$start',
  8172. MaxSubdirs => 20, # (A900 has 10 null entries, but IDC writes only 1)
  8173. RelativeBase => 1, # needed to write SubIFD with relative offsets
  8174. },
  8175. },
  8176. 0x7250 => { #1
  8177. Name => 'MRWInfo',
  8178. Condition => '$$valPt !~ /^\0\0\0\0/', # (just in case this could be zero)
  8179. SubDirectory => {
  8180. TagTable => 'Image::ExifTool::MinoltaRaw::Main',
  8181. },
  8182. },
  8183. );
  8184. %Image::ExifTool::Sony::SR2SubIFD = (
  8185. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  8186. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  8187. GROUPS => { 0 => 'MakerNotes', 1 => 'SR2SubIFD', 2 => 'Camera' },
  8188. SET_GROUP1 => 1, # set group1 name to directory name for all tags in table
  8189. NOTES => 'Tags in the encrypted SR2SubIFD',
  8190. 0x7300 => 'BlackLevel', #14 (R1)
  8191. 0x7302 => 'WB_GRBGLevelsAuto', #14 (R1)
  8192. 0x7303 => 'WB_GRBGLevels', #1 (R1 "as shot", ref 14)
  8193. 0x7310 => 'BlackLevel', #14 (divide by 4)
  8194. 0x7313 => 'WB_RGGBLevels', #6
  8195. 0x7480 => 'WB_RGBLevelsDaylight', #14 (R1)
  8196. 0x7481 => 'WB_RGBLevelsCloudy', #14 (R1)
  8197. 0x7482 => 'WB_RGBLevelsTungsten', #14 (R1)
  8198. 0x7483 => 'WB_RGBLevelsFlash', #14 (R1)
  8199. 0x7484 => 'WB_RGBLevels4500K', #14 (R1)
  8200. 0x7486 => 'WB_RGBLevelsFluorescent', #14 (R1)
  8201. 0x74a0 => 'MaxApertureAtMaxFocal', #PH
  8202. 0x74a1 => 'MaxApertureAtMinFocal', #PH
  8203. 0x74a2 => { #14 (R1)
  8204. Name => 'MaxFocalLength',
  8205. PrintConv => '"$val mm"',
  8206. },
  8207. 0x74a3 => { #14 (R1)
  8208. Name => 'MinFocalLength',
  8209. PrintConv => '"$val mm"',
  8210. },
  8211. 0x74c0 => { #PH
  8212. Name => 'SR2DataIFD',
  8213. Groups => { 1 => 'SR2DataIFD' }, # (needed to set SubIFD DirName)
  8214. Flags => 'SubIFD',
  8215. SubDirectory => {
  8216. TagTable => 'Image::ExifTool::Sony::SR2DataIFD',
  8217. Start => '$val',
  8218. MaxSubdirs => 20, # an A700 ARW has 14 of these! - PH
  8219. },
  8220. },
  8221. 0x7800 => 'ColorMatrix', #14 (divide by 1024)
  8222. 0x7820 => 'WB_RGBLevelsDaylight', #6 (or 5300K, ref 14)
  8223. 0x7821 => 'WB_RGBLevelsCloudy', #6 (or 6100K, ref 14)
  8224. 0x7822 => 'WB_RGBLevelsTungsten', #6
  8225. 0x7823 => 'WB_RGBLevelsFlash', #14
  8226. 0x7824 => 'WB_RGBLevels4500K', #14
  8227. 0x7825 => 'WB_RGBLevelsShade', #6 (or 7500K, ref 14)
  8228. 0x7826 => 'WB_RGBLevelsFluorescent', #6 (~4000K)
  8229. 0x7827 => 'WB_RGBLevelsFluorescentP1', #14 (~5000K)
  8230. 0x7828 => 'WB_RGBLevelsFluorescentP2', #14 (~6500K) (was Flash, ref 6)
  8231. 0x7829 => 'WB_RGBLevelsFluorescentM1', #14 (~3500K)
  8232. 0x782a => 'WB_RGBLevels8500K', #14
  8233. 0x782b => 'WB_RGBLevels6000K', #14
  8234. 0x782c => 'WB_RGBLevels3200K', #14
  8235. 0x782d => 'WB_RGBLevels2500K', #14
  8236. 0x787f => 'WhiteLevel', #14 (divide by 4)
  8237. 0x7980 => 'ChromaticAberrationCorrParams', #forum6509 (Sony A7 ARW)
  8238. 0x7982 => 'DistortionCorrParams', #forum6509 (Sony A7 ARW)
  8239. );
  8240. %Image::ExifTool::Sony::SR2DataIFD = (
  8241. WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
  8242. CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
  8243. GROUPS => { 0 => 'MakerNotes', 1 => 'SR2DataIFD', 2 => 'Camera' },
  8244. SET_GROUP1 => 1, # set group1 name to directory name for all tags in table
  8245. # 0x7313 => 'WB_RGGBLevels', (duplicated in all SR2DataIFD's)
  8246. 0x7770 => { #PH
  8247. Name => 'ColorMode',
  8248. Priority => 0,
  8249. },
  8250. );
  8251. # extract information from "SONY PIC\0" maker notes (ref PH)
  8252. %Image::ExifTool::Sony::PIC = (
  8253. PROCESS_PROC => \&ProcessSonyPIC,
  8254. GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
  8255. NOTES => q{
  8256. The TextInfo data is extracted as a block to preserve the formatting, and
  8257. some of the more interesting information is extracted as separate tags.
  8258. },
  8259. TextInfo1 => { Binary => 1 },
  8260. TextInfo2 => { Binary => 1 },
  8261. # tags extracted from TextInfo blocks (ID's must end with ':')
  8262. 'Temp:' => {
  8263. Name => 'CameraTemperature',
  8264. RawConv => '$val =~ /^-?\d+/ ? $val : undef',
  8265. PrintConv => '"$val C"',
  8266. },
  8267. 'Temp:Clbt:' => { Name => 'BoardTemperature', PrintConv => '"$val C"' }, #(NC)
  8268. 'Capt:' => { Name => 'SensorTemperature', PrintConv => '"$val C"' }, #(NC)
  8269. 'VR Enable C:' => {
  8270. Name => 'VibrationReduction',
  8271. PrintConv => { 0 => 'Off', 1 => 'On' }, #(NC)
  8272. },
  8273. 'FWVer:' => 'FirmwareVersion',
  8274. 'BC:' => {
  8275. Name => 'Barcode',
  8276. Condition => 'not $$self{VALUE}{Barcode}',
  8277. ValueConv => '$val=~s/IP1.*//; $val',
  8278. },
  8279. 'barcode:' => 'Barcode',
  8280. 'BarCode:' => {
  8281. Name => 'Barcode',
  8282. ValueConv => 'length($val) > 12 ? substr($val,0,12) : $val',
  8283. },
  8284. # 'EvA:' - exposure compensation * 10 (ref JR)
  8285. # for documentation only -- this IFD is handled manually
  8286. IFD => {
  8287. Name => 'PIC_IFD',
  8288. SubDirectory => { TagTable => 'Image::ExifTool::Sony::Main' },
  8289. },
  8290. );
  8291. # tags found in DSC-F1 PMP header (ref 10)
  8292. %Image::ExifTool::Sony::PMP = (
  8293. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  8294. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  8295. FIRST_ENTRY => 0,
  8296. NOTES => q{
  8297. These tags are written in the proprietary-format header of PMP images from
  8298. the DSC-F1.
  8299. },
  8300. 8 => { #PH
  8301. Name => 'JpgFromRawStart',
  8302. Format => 'int32u',
  8303. Notes => q{
  8304. OK, not really a RAW file, but this mechanism is used to allow extraction of
  8305. the JPEG image from a PMP file
  8306. },
  8307. },
  8308. 12 => { Name => 'JpgFromRawLength', Format => 'int32u' },
  8309. 22 => { Name => 'SonyImageWidth', Format => 'int16u' },
  8310. 24 => { Name => 'SonyImageHeight', Format => 'int16u' },
  8311. 27 => {
  8312. Name => 'Orientation',
  8313. PrintConv => {
  8314. 0 => 'Horizontal (normal)',
  8315. 1 => 'Rotate 270 CW',#11
  8316. 2 => 'Rotate 180',
  8317. 3 => 'Rotate 90 CW',#11
  8318. },
  8319. },
  8320. 29 => {
  8321. Name => 'ImageQuality',
  8322. PrintConv => {
  8323. 8 => 'Snap Shot',
  8324. 23 => 'Standard',
  8325. 51 => 'Fine',
  8326. },
  8327. },
  8328. # 40 => ImageWidth again (int16u)
  8329. # 42 => ImageHeight again (int16u)
  8330. 52 => { Name => 'Comment', Format => 'string[19]' },
  8331. 76 => {
  8332. Name => 'DateTimeOriginal',
  8333. Description => 'Date/Time Original',
  8334. Format => 'int8u[6]',
  8335. Groups => { 2 => 'Time' },
  8336. ValueConv => q{
  8337. my @a = split ' ', $val;
  8338. $a[0] += $a[0] < 70 ? 2000 : 1900;
  8339. sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', @a);
  8340. },
  8341. PrintConv => '$self->ConvertDateTime($val)',
  8342. },
  8343. 84 => {
  8344. Name => 'ModifyDate',
  8345. Format => 'int8u[6]',
  8346. Groups => { 2 => 'Time' },
  8347. ValueConv => q{
  8348. my @a = split ' ', $val;
  8349. $a[0] += $a[0] < 70 ? 2000 : 1900;
  8350. sprintf('%.4d:%.2d:%.2d %.2d:%.2d:%.2d', @a);
  8351. },
  8352. PrintConv => '$self->ConvertDateTime($val)',
  8353. },
  8354. 102 => {
  8355. Name => 'ExposureTime',
  8356. Format => 'int16s',
  8357. RawConv => '$val <= 0 ? undef : $val',
  8358. ValueConv => '2 ** (-$val / 100)',
  8359. PrintConv => 'Image::ExifTool::Exif::PrintExposureTime($val)',
  8360. },
  8361. 106 => { # (NC -- not written by DSC-F1)
  8362. Name => 'FNumber',
  8363. Format => 'int16s',
  8364. RawConv => '$val <= 0 ? undef : $val',
  8365. ValueConv => '$val / 100', # (likely wrong)
  8366. },
  8367. 108 => { # (NC -- not written by DSC-F1)
  8368. Name => 'ExposureCompensation',
  8369. Format => 'int16s',
  8370. RawConv => '($val == -1 or $val == -32768) ? undef : $val',
  8371. ValueConv => '$val / 100', # (probably wrong too)
  8372. },
  8373. 112 => { # (NC -- not written by DSC-F1)
  8374. Name => 'FocalLength',
  8375. Format => 'int16s',
  8376. Groups => { 2 => 'Camera' },
  8377. RawConv => '$val <= 0 ? undef : $val',
  8378. ValueConv => '$val / 100',
  8379. PrintConv => 'sprintf("%.1f mm",$val)',
  8380. },
  8381. 118 => {
  8382. Name => 'Flash',
  8383. Groups => { 2 => 'Camera' },
  8384. PrintConv => { 0 => 'No Flash', 1 => 'Fired' },
  8385. },
  8386. );
  8387. # Composite Sony tags
  8388. %Image::ExifTool::Sony::Composite = (
  8389. GROUPS => { 2 => 'Camera' },
  8390. FocusDistance => {
  8391. Require => {
  8392. 0 => 'Sony:FocusPosition',
  8393. 1 => 'FocalLength',
  8394. },
  8395. Notes => 'distance in metres = FocusPosition * FocalLength / 1000',
  8396. ValueConv => '$val >= 128 ? "inf" : $val * $val[1] / 1000',
  8397. PrintConv => '$val eq "inf" ? $val : "$val m"',
  8398. },
  8399. FocusDistance2 => {
  8400. # For DSLR-A550 and newer, NEX/ILCE/SLT/ILCA (only A65V/A77V are missing ...):
  8401. # seen FocusPosition2 with values from 80 - 255 (and 21 for Touit 12mm...)
  8402. # Formula from minolta.pm (WBInfoA100 - 0x49bb) gives mostly correct/acceptable distance indications.
  8403. # (http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3688.0.html)
  8404. # if this value is the 35mm equivalent magnification, then the formula could
  8405. # be (1.5 * 2**($val/16-5)+1) * FocalLength, but this tends to underestimate
  8406. # distance by about 18% (ref 20) (255=inf)
  8407. # modified 16-10-2014 based on A99V measurements: use FocalLengthIn35mmFormat and leave out the "1.5*" factor.
  8408. Require => {
  8409. 0 => 'Sony:FocusPosition2',
  8410. 1 => 'FocalLengthIn35mmFormat',
  8411. },
  8412. ValueConv => q{
  8413. return undef unless $val;
  8414. return 'inf' if $val >= 255;
  8415. return (2**($val/16-5) + 1) * $val[1] / 1000;
  8416. },
  8417. PrintConv => '$val eq "inf" ? $val : sprintf("%.2f m",$val)',
  8418. },
  8419. );
  8420. # add our composite tags
  8421. Image::ExifTool::AddCompositeTags('Image::ExifTool::Sony');
  8422. sub SortLensTypes
  8423. {
  8424. return $a <=> $b unless $a =~ /\./ and $b =~ /\./;
  8425. my @a = split /\./, $a;
  8426. my @b = split /\./, $b;
  8427. # must compare the decimal part separately to sort in proper order
  8428. return $a[0] <=> $b[0] || $a[1] <=> $b[1];
  8429. }
  8430. # fill in Sony LensType lookup based on Minolta values
  8431. {
  8432. my $minoltaTypes = \%Image::ExifTool::Minolta::minoltaLensTypes;
  8433. %sonyLensTypes = %$minoltaTypes;
  8434. my $other = $$minoltaTypes{OTHER};
  8435. delete $$minoltaTypes{Notes}; # (temporarily)
  8436. delete $$minoltaTypes{OTHER}; # (temporarily)
  8437. my $id;
  8438. # 5-digit lens ID's are missing the last digit (usually "1") in the metadata for
  8439. # some Sony models, so generate corresponding 4-digit entries for these cameras
  8440. foreach $id (sort SortLensTypes keys %$minoltaTypes) {
  8441. next if $id < 10000;
  8442. my $sid = int($id/10);
  8443. my $i;
  8444. my $lens = $$minoltaTypes{$id};
  8445. if ($sonyLensTypes{$sid}) {
  8446. # put lens name with "or" first in list
  8447. if ($lens =~ / or /) {
  8448. my $tmp = $sonyLensTypes{$sid};
  8449. $sonyLensTypes{$sid} = $lens;
  8450. $lens = $tmp;
  8451. }
  8452. for (;;) {
  8453. $i = ($i || 0) + 1;
  8454. $sid = int($id/10) . ".$i";
  8455. last unless $sonyLensTypes{$sid};
  8456. }
  8457. }
  8458. $sonyLensTypes{$sid} = $lens;
  8459. }
  8460. $$minoltaTypes{Notes} = $sonyLensTypes{Notes}; # (restore original Notes)
  8461. $$minoltaTypes{OTHER} = $other;
  8462. }
  8463. #------------------------------------------------------------------------------
  8464. # Process "SONY PIC\0" maker notes (DSC-H200/J10/W370/W510, MHS-TS20, ref PH)
  8465. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  8466. # Returns: 1
  8467. sub ProcessSonyPIC($$$)
  8468. {
  8469. my ($et, $dirInfo, $tagTablePtr) = @_;
  8470. my $dataPt = $$dirInfo{DataPt};
  8471. my $start = $$dirInfo{DirStart} || 0;
  8472. my $len = $$dirInfo{DirLen} || (length($$dataPt) - $start);
  8473. my $data = substr($$dataPt, $start, $len);
  8474. # H200 panorama images have an IFD at offset 12 (non-panoramas have 0's here)
  8475. # - assume other images could too, but do a bit of validation to check
  8476. # - MHS-TS20 images have some other data here
  8477. if ($len >= 26) {
  8478. my $count = Get16u($dataPt, $start + 12);
  8479. if ($count > 256) {
  8480. SwapByteOrder();
  8481. $count = Get16u($dataPt, $start + 12);
  8482. }
  8483. if ($count and $count < 256) {
  8484. my $format = Get16u($dataPt, $start + 16);
  8485. if ($format >= 1 and $format <= 10) {
  8486. $$dirInfo{DirStart} = $start + 12;
  8487. $$dirInfo{DirLen} = $len - 12;
  8488. my $sonyTable = GetTagTable('Image::ExifTool::Sony::Main');
  8489. Image::ExifTool::Exif::ProcessExif($et, $dirInfo, $sonyTable);
  8490. }
  8491. }
  8492. }
  8493. # Do a brute force search for text data:
  8494. # For the DSC-J10/W370/W510 the first text block is at offset 0x1ec and
  8495. # starts with "BarCode:". For the H200 it is at 0x1f0 and starts with "BC:".
  8496. # For the TS20 it is at 0x5b and starts with "V400 AELOG\nbarcode:".
  8497. # The second text block starts with "AFLOG" (Auto-Focus log) and is at
  8498. # 0x600 for all models, except for the TS20 it is at 0x45b.
  8499. my $i = 0;
  8500. while ($data =~ /(\w[\x09\x0a\x0d\x20-\x7e]+)/sg) {
  8501. next unless length $1 > 32;
  8502. my ($tag, $val) = ('TextInfo' . (++$i), $1);
  8503. $$tagTablePtr{$tag} or AddTagToTable($tagTablePtr, $tag, { Name => $tag, Binary => 1 });
  8504. $et->HandleTag($tagTablePtr, $tag, $val);
  8505. # extract interesting tags separately (might want to speed this up)
  8506. foreach $tag (sort { lc $a cmp lc $b } keys %$tagTablePtr) {
  8507. next unless $tag =~ /:$/ and $val =~ /\b$tag\s*([^\s;,:]+)/;
  8508. $et->HandleTag($tagTablePtr, $tag, $1);
  8509. }
  8510. }
  8511. return 1;
  8512. }
  8513. #------------------------------------------------------------------------------
  8514. # Make TIFF header for raw data
  8515. # Inputs: 0) width, 1) height, 2) num colour components, 3) bits, 4) resolution
  8516. # Returns: TIFF header
  8517. # Notes: Multi-byte data must be little-endian
  8518. sub MakeTiffHeader($$$$;$)
  8519. {
  8520. my ($w, $h, $cols, $bits, $res) = @_;
  8521. $res or $res = 72;
  8522. my $saveOrder = GetByteOrder();
  8523. SetByteOrder('II');
  8524. my $hdr =
  8525. "\x49\x49\x2a\0\x08\0\0\0\x0e\0" . # 0x00 14 menu entries:
  8526. "\xfe\x00\x04\0\x01\0\0\0\x00\0\0\0" . # 0x0a SubfileType = 0
  8527. "\x00\x01\x04\0\x01\0\0\0" . Set32u($w) . # 0x16 ImageWidth
  8528. "\x01\x01\x04\0\x01\0\0\0" . Set32u($h) . # 0x22 ImageHeight
  8529. "\x02\x01\x03\0" . Set32u($cols) . # 0x2e BitsPerSample
  8530. Set32u($cols == 1 ? $bits : 0xb6) .
  8531. "\x03\x01\x03\0\x01\0\0\0\x01\0\0\0" . # 0x3a Compression = 1
  8532. "\x06\x01\x03\0\x01\0\0\0" . # 0x46 PhotometricInterpretation
  8533. Set32u($cols == 1 ? 1 : 2) .
  8534. "\x11\x01\x04\0\x01\0\0\0\xcc\0\0\0" . # 0x52 StripOffsets = 0xcc
  8535. "\x15\x01\x03\0\x01\0\0\0" . Set32u($cols) .# 0x5e SamplesPerPixel
  8536. "\x16\x01\x04\0\x01\0\0\0" . Set32u($h) . # 0x6a RowsPerStrip
  8537. "\x17\x01\x04\0\x01\0\0\0" . # 0x76 StripByteCounts
  8538. Set32u($w * $h * $cols * int(($bits+7)/8)) .
  8539. "\x1a\x01\x05\0\x01\0\0\0\xbc\0\0\0" . # 0x82 XResolution
  8540. "\x1b\x01\x05\0\x01\0\0\0\xc4\0\0\0" . # 0x8e YResolution
  8541. "\x1c\x01\x03\0\x01\0\0\0\x01\0\0\0" . # 0x9a PlanarConfiguration = 1
  8542. "\x28\x01\x03\0\x01\0\0\0\x02\0\0\0" . # 0xa6 ResolutionUnit = 2
  8543. "\0\0\0\0" . # 0xb2 (no IFD1)
  8544. (Set16u($bits) x 3) . # 0xb6 BitsPerSample value
  8545. Set32u($res) . "\x01\0\0\0" . # 0xbc XResolution = 72
  8546. Set32u($res) . "\x01\0\0\0"; # 0xc4 YResolution = 72
  8547. SetByteOrder($saveOrder); # 0xcc (data goes here)
  8548. return $hdr;
  8549. }
  8550. #------------------------------------------------------------------------------
  8551. # LensSpec value conversions
  8552. # Inputs: 0) value
  8553. # Returns: converted value
  8554. # Notes: unpacks in format compatible with LensInfo, with extra flags bytes at start and end
  8555. sub ConvLensSpec($)
  8556. {
  8557. my $val = shift;
  8558. return \$val unless length($val) == 8;
  8559. my @a = unpack("H2H4H4H2H2H2",$val);
  8560. $a[1] += 0; $a[2] += 0; # remove leading zeros from focal lengths
  8561. $a[3] /= 10; $a[4] /= 10; # divide f-numbers by 10
  8562. return join ' ', @a;
  8563. }
  8564. sub ConvInvLensSpec($)
  8565. {
  8566. my $val = shift;
  8567. my @a=split(" ", $val);
  8568. return $val unless @a == 6;
  8569. $a[3] *= 10; $a[4] *= 10; # f-numbers are multiplied by 10
  8570. $_ = hex foreach @a; # convert from hex
  8571. return pack 'CnnCCC', @a;
  8572. }
  8573. #------------------------------------------------------------------------------
  8574. # Print Sony LensSpec value
  8575. # Inputs: 0) LensSpec numerical value
  8576. # Returns: converted LensSpec string (eg. "DT 18-55mm F3.5-5.6 SAM")
  8577. # Refs: http://equational.org/importphotos/alphalensinfo.html
  8578. # http://www.dyxum.com/dforum/the-lens-information-different-from-lensid_topic37682.html
  8579. my @lensFeatures = (
  8580. # lens features in the order they are added to the LensSpec string
  8581. # (high byte of Mask/Bits represents byte 0 of LensSpec, low byte is byte 7)
  8582. # Mask { Bits Name Bits Name } Prefix flag
  8583. # ------ ------ ----- ------ ----- -----------
  8584. [ 0x4000, { 0x4000 => 'PZ' }, 1 ],
  8585. [ 0x0300, { 0x0100 => 'DT', 0x0200 => 'FE', 0x0300 => 'E' }, 1 ], # (will come before preceding prefix), FE added (ref JR)
  8586. [ 0x00e0, { 0x0020 => 'STF', 0x0040 => 'Reflex', 0x0060 => 'Macro', 0x0080 => 'Fisheye' } ],
  8587. [ 0x000c, { 0x0004 => 'ZA', 0x0008 => 'G' } ],
  8588. [ 0x0003, { 0x0001 => 'SSM', 0x0002 => 'SAM' } ],
  8589. [ 0x8000, { 0x8000 => 'OSS' } ],
  8590. [ 0x2000, { 0x2000 => 'LE' } ], #JR
  8591. [ 0x0800, { 0x0800 => 'II' } ], #JR
  8592. );
  8593. sub PrintLensSpec($)
  8594. {
  8595. my $val = shift;
  8596. my ($rtnVal, $feature, $f1, $sf, $lf, $sa, $la, $f2);
  8597. # 0=flags1, 1=short focal, 2=long focal, 3=max aperture at short focal,
  8598. # 4=max aperture at long focal, 5=flags2
  8599. my @a = split ' ', $val;
  8600. if (@a == 2) { # LensSpecFeatures patch
  8601. ($f1, $f2) = @a;
  8602. $rtnVal = '';
  8603. } elsif (@a >= 6) {
  8604. ($f1, $sf, $lf, $sa, $la, $f2) = @a;
  8605. # crude validation of focal length and aperture values
  8606. if ($sf != 0 and $sa != 0 and ($lf == 0 or $lf >= $sf) and ($la == 0 or $la >= $sa)) {
  8607. # use focal and aperture range if this is a zoom lens
  8608. $sf .= '-' . $lf if $lf != $sf and $lf != 0;
  8609. $sa .= '-' . $la if $sa != $la and $la != 0;
  8610. $rtnVal = "${sf}mm F$sa"; # heart of LensSpec is a LensInfo string
  8611. }
  8612. }
  8613. if (defined $rtnVal) {
  8614. # loop through available lens features
  8615. my $flags = hex($f1 . $f2);
  8616. foreach $feature (@lensFeatures) {
  8617. my $bits = $$feature[0] & $flags;
  8618. next unless $bits or $$feature[1]{$bits};
  8619. # add feature name as a prefix or suffix to the LensSpec
  8620. my $str = $$feature[1]{$bits} || sprintf('Unknown(%.4x)',$bits);
  8621. $rtnVal = $rtnVal ? ($$feature[2] ? "$str $rtnVal" : "$rtnVal $str") : $str;
  8622. }
  8623. } else {
  8624. $rtnVal = "Unknown ($val)";
  8625. }
  8626. return $rtnVal;
  8627. }
  8628. # inverse conversion
  8629. sub PrintInvLensSpec($;$$)
  8630. {
  8631. my ($val, $self, $features) = @_;
  8632. return $1 if $val =~ /Unknown \((.*)\)/i;
  8633. my ($sf, $lf, $sa, $la) = Image::ExifTool::Exif::GetLensInfo($val);
  8634. my $str;
  8635. if ($features) {
  8636. $str = '';
  8637. } elsif ($sf) {
  8638. # fixed focal length and aperture have zero for 2nd number
  8639. $lf = 0 if $lf == $sf;
  8640. $la = 0 if $la == $sa;
  8641. $str = " $sf $lf $sa $la";
  8642. } else {
  8643. return undef;
  8644. }
  8645. my $flags = 0;
  8646. my ($feature, $bits);
  8647. foreach $feature (@lensFeatures) {
  8648. foreach $bits (keys %{$$feature[1]}) {
  8649. # set corresponding flag bits for each feature name found
  8650. my $name = $$feature[1]{$bits};
  8651. $val =~ /\b$name\b/i and $flags |= $bits;
  8652. }
  8653. }
  8654. return sprintf "%.2x$str %.2x", $flags>>8, $flags&0xff;
  8655. }
  8656. #------------------------------------------------------------------------------
  8657. # Read/Write MoreInfo information (tag 0x0020, count 20480)
  8658. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  8659. # Returns: 1 on success when reading, or new directory when writing (IsWriting set)
  8660. sub ProcessMoreInfo($$$)
  8661. {
  8662. my ($et, $dirInfo, $tagTablePtr) = @_;
  8663. $et or return 1; # allow dummy access to write routine
  8664. my $dataPt = $$dirInfo{DataPt};
  8665. my $start = $$dirInfo{DirStart} || 0;
  8666. my $dirLen = $$dirInfo{DirLen} || length($$dataPt);
  8667. my $isWriting = $$dirInfo{IsWriting};
  8668. my $rtnVal = $isWriting ? undef : 0;
  8669. return $rtnVal if $dirLen < 4;
  8670. my $num = Get16u($dataPt, $start); # number of entries
  8671. my $len = Get16u($dataPt, $start + 2); # total data length
  8672. if ($dirLen < 4 + $num * 4) {
  8673. $et->Warn('Truncated MoreInfo data', 1);
  8674. return $rtnVal;
  8675. }
  8676. if ($num > 50) {
  8677. $et->Warn('Possibly corrupted MoreInfo data', 1);
  8678. return $rtnVal;
  8679. }
  8680. $et->VerboseDir('MoreInfo', $num, $len) unless $isWriting;
  8681. if ($len > $dirLen) {
  8682. $et->Warn('MoreInfo data length too large', 1);
  8683. $len = $dirLen;
  8684. }
  8685. # loop through the MoreInfo index section to get the block offsets and tag ID's
  8686. # (in case they are out of order, even though this may never happen)
  8687. my ($i, @offset, @tagID, %blockSize);
  8688. for ($i=0; $i<$num; ++$i) {
  8689. my $entry = $start + 4 + $i * 4;
  8690. push @tagID, Get16u($dataPt, $entry);
  8691. push @offset, Get16u($dataPt, $entry + 2);
  8692. if ($offset[-1] > $len and $offset[-1] <= $dirLen) {
  8693. $et->Warn('MoreInfo data length too small', 1);
  8694. $len = $dirLen;
  8695. }
  8696. }
  8697. # generate a lookup table of block sizes
  8698. my @sorted = sort { $a <=> $b } @offset;
  8699. push @sorted, 0xffff; # (simplifies logic in loop below)
  8700. for ($i=0; $i<$num; ++$i) {
  8701. my $offset = $sorted[$i];
  8702. my $size = $sorted[$i+1] - $offset;
  8703. # note that block size will be negative for blocks with starting
  8704. # offsets greater than $dirLen, but we will ignore these below
  8705. $size = $len - $offset if $size > $len - $offset;
  8706. # (if blockSize is already defined for this offset, then there
  8707. # are 2 blocks with the same starting offset and the existing
  8708. # size must be zero. Since we can't know which block is
  8709. # actually non-zero size, the reasonable thing to do is
  8710. # assume that both have a size of zero)
  8711. $blockSize{$offset} = $size unless defined $blockSize{$offset};
  8712. }
  8713. # initialize successful return value
  8714. $rtnVal = $isWriting ? substr($$dataPt, $start, $dirLen) : 1;
  8715. # now process each block
  8716. my $unknown = $$et{OPTIONS}{Unknown};
  8717. for ($i=0; $i<$num; ++$i) {
  8718. next if $offset[$i] > $dirLen; # ignore bad offsets
  8719. my $tag = $tagID[$i];
  8720. if ($isWriting) {
  8721. # write new tags
  8722. my $tagInfo = $$tagTablePtr{$tag};
  8723. next unless ref $tagInfo eq 'HASH' and $$tagInfo{SubDirectory};
  8724. my $offset = $offset[$i];
  8725. my $size = $blockSize{$offset};
  8726. next unless $size; # ignore zero-length blocks
  8727. my %dirInfo = (
  8728. DirName => $$tagInfo{Name},
  8729. Parent => $$dirInfo{DirName},
  8730. DataPt => \$rtnVal,
  8731. DirStart => $offset,
  8732. DirLen => $size,
  8733. );
  8734. my $subTable = GetTagTable($$tagInfo{SubDirectory}{TagTable});
  8735. my $val = $et->WriteDirectory(\%dirInfo, $subTable);
  8736. # update this block in the returned MoreInfo data
  8737. substr($rtnVal, $offset, $size) = $val if defined $val;
  8738. next;
  8739. }
  8740. # generate binary tables for unknown tags if -U option used
  8741. if (not defined $$tagTablePtr{$tag} and $unknown > 1) {
  8742. my $name = sprintf('MoreInfo%.4x', $tag);
  8743. my $table = "Image::ExifTool::Sony::$name";
  8744. no strict 'refs';
  8745. %$table = (
  8746. PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
  8747. FIRST_ENTRY => 0,
  8748. GROUPS => { 0 => 'MakerNotes', 2 => 'Image' },
  8749. );
  8750. use strict 'refs';
  8751. my %tagInfo = (
  8752. Name => $name,
  8753. SubDirectory => { TagTable => $table },
  8754. );
  8755. AddTagToTable($tagTablePtr, $tag, \%tagInfo);
  8756. }
  8757. $et->HandleTag($tagTablePtr, $tag, undef,
  8758. Index => $i,
  8759. DataPt => $dataPt,
  8760. DataPos => $$dirInfo{DataPos},
  8761. Start => $start + $offset[$i],
  8762. Size => $blockSize{$offset[$i]},
  8763. );
  8764. }
  8765. return $rtnVal;
  8766. }
  8767. #------------------------------------------------------------------------------
  8768. # Read Sony DSC-F1 PMP file
  8769. # Inputs: 0) ExifTool object ref, 1) dirInfo ref
  8770. # Returns: 1 on success when reading, 0 if this isn't a valid PMP file
  8771. sub ProcessPMP($$)
  8772. {
  8773. my ($et, $dirInfo) = @_;
  8774. my $raf = $$dirInfo{RAF};
  8775. my $buff;
  8776. $raf->Read($buff, 128) == 128 or return 0;
  8777. # validate header length (124 bytes)
  8778. $buff =~ /^.{8}\0{3}\x7c.{112}\xff\xd8\xff\xdb$/s or return 0;
  8779. $et->SetFileType();
  8780. SetByteOrder('MM');
  8781. $et->FoundTag(Make => 'Sony');
  8782. $et->FoundTag(Model => 'DSC-F1');
  8783. # extract information from 124-byte header
  8784. my $tagTablePtr = GetTagTable('Image::ExifTool::Sony::PMP');
  8785. my %dirInfo = ( DataPt => \$buff, DirName => 'PMP' );
  8786. $et->ProcessDirectory(\%dirInfo, $tagTablePtr);
  8787. # process JPEG image
  8788. $raf->Seek(124, 0);
  8789. $$dirInfo{Base} = 124;
  8790. $et->ProcessJPEG($dirInfo);
  8791. return 1;
  8792. }
  8793. #------------------------------------------------------------------------------
  8794. # Set the ARW file type and decide between SubIFD and A100DataOffset
  8795. # Inputs: 0) ExifTool object ref, 1) reference to tag 0x14a raw data
  8796. # Returns: true if tag 0x14a is a SubIFD, false otherwise
  8797. sub SetARW($$)
  8798. {
  8799. my ($et, $valPt) = @_;
  8800. # assume ARW for now -- SR2's get identified when FileFormat is parsed
  8801. $et->OverrideFileType($$et{TIFF_TYPE} = 'ARW');
  8802. # this should always be a SubIFD for models other than the A100
  8803. return 1 unless $$et{Model} eq 'DSLR-A100' and length $$valPt == 4;
  8804. # for the A100, IFD0 tag 0x14a is either a pointer to the raw data if this is
  8805. # an original image, or a SubIFD offset if the image was edited by Sony IDC,
  8806. # so assume it points to the raw data if it isn't a valid IFD (this assumption
  8807. # will be checked later when we try to parse the SR2Private directory)
  8808. my %subdir = (
  8809. DirStart => Get32u($valPt, 0),
  8810. Base => 0,
  8811. RAF => $$et{RAF},
  8812. AllowOutOfOrderTags => 1, # doh!
  8813. );
  8814. return Image::ExifTool::Exif::ValidateIFD(\%subdir);
  8815. }
  8816. #------------------------------------------------------------------------------
  8817. # Finish writing ARW image, patching necessary Sony quirks, etc
  8818. # Inputs: 0) ExifTool ref, 1) dirInfo ref, 2) EXIF data ref, 3) image data reference
  8819. # Returns: undef on success, error string otherwise
  8820. # Notes: (it turns that all of this is for the A100 only)
  8821. sub FinishARW($$$$)
  8822. {
  8823. my ($et, $dirInfo, $dataPt, $imageData) = @_;
  8824. # pre-scan IFD0 to get IFD entry offsets for each tag
  8825. my $dataLen = length $$dataPt;
  8826. return 'Truncated IFD0' if $dataLen < 2;
  8827. my $n = Get16u($dataPt, 0);
  8828. return 'Truncated IFD0' if $dataLen < 2 + 12 * $n;
  8829. my ($i, %entry, $dataBlock, $pad, $dataOffset);
  8830. for ($i=0; $i<$n; ++$i) {
  8831. my $entry = 2 + $i * 12;
  8832. $entry{Get16u($dataPt, $entry)} = $entry;
  8833. }
  8834. # fix up SR2Private offset and A100DataOffset (A100 only)
  8835. if ($entry{0xc634} and $$et{MRWDirData}) {
  8836. return 'Unexpected MRW block' unless $$et{Model} eq 'DSLR-A100';
  8837. return 'Missing A100DataOffset' unless $entry{0x14a} and $$et{A100DataOffset};
  8838. # account for total length of image data
  8839. my $totalLen = 8 + $dataLen;
  8840. if (ref $imageData) {
  8841. foreach $dataBlock (@$imageData) {
  8842. my ($pos, $size, $pad) = @$dataBlock;
  8843. $totalLen += $size + $pad;
  8844. }
  8845. }
  8846. # align MRW block on an even 4-byte boundary
  8847. my $remain = $totalLen & 0x03;
  8848. $pad = 4 - $remain and $totalLen += $pad if $remain;
  8849. # set offset for the MRW directory data
  8850. Set32u($totalLen, $dataPt, $entry{0xc634} + 8);
  8851. # also pad MRWDirData data to an even 4 bytes (just to be safe)
  8852. $remain = length($$et{MRWDirData}) & 0x03;
  8853. $$et{MRWDirData} .= "\0" x (4 - $remain) if $remain;
  8854. $totalLen += length $$et{MRWDirData};
  8855. # fix up A100DataOffset
  8856. $dataOffset = $$et{A100DataOffset};
  8857. Set32u($totalLen, $dataPt, $entry{0x14a} + 8);
  8858. }
  8859. # patch double-referenced and incorrectly-sized A100 PreviewImage
  8860. if ($entry{0x201} and $$et{A100PreviewStart} and
  8861. $entry{0x202} and $$et{A100PreviewLength})
  8862. {
  8863. Set32u($$et{A100PreviewStart}, $dataPt, $entry{0x201} + 8);
  8864. Set32u($$et{A100PreviewLength}, $dataPt, $entry{0x202} + 8);
  8865. }
  8866. # write TIFF IFD structure
  8867. my $outfile = $$dirInfo{OutFile};
  8868. my $header = GetByteOrder() . Set16u(0x2a) . Set32u(8);
  8869. Write($outfile, $header, $$dataPt) or return 'Error writing';
  8870. # copy over image data
  8871. if (ref $imageData) {
  8872. $et->CopyImageData($imageData, $outfile) or return 'Error copying image data';
  8873. }
  8874. # write MRW data if necessary
  8875. if ($$et{MRWDirData}) {
  8876. Write($outfile, "\0" x $pad) if $pad; # write padding if necessary
  8877. Write($outfile, $$et{MRWDirData});
  8878. delete $$et{MRWDirData};
  8879. # set TIFF_END to copy over the MRW image data
  8880. $$et{TIFF_END} = $dataOffset if $dataOffset;
  8881. }
  8882. return undef;
  8883. }
  8884. #------------------------------------------------------------------------------
  8885. # Decrypt/Encrypt Sony data (ref 1) (reversible encryption)
  8886. # Inputs: 0) data reference, 1) start offset, 2) data length, 3) decryption key
  8887. # Returns: nothing (original data buffer is updated with decrypted data)
  8888. # Notes: data length should be a multiple of 4
  8889. sub Decrypt($$$$)
  8890. {
  8891. my ($dataPt, $start, $len, $key) = @_;
  8892. my ($i, $j, @pad);
  8893. my $words = int ($len / 4);
  8894. for ($i=0; $i<4; ++$i) {
  8895. my $lo = ($key & 0xffff) * 0x0edd + 1;
  8896. my $hi = ($key >> 16) * 0x0edd + ($key & 0xffff) * 0x02e9 + ($lo >> 16);
  8897. $pad[$i] = $key = (($hi & 0xffff) << 16) + ($lo & 0xffff);
  8898. }
  8899. $pad[3] = ($pad[3] << 1 | ($pad[0]^$pad[2]) >> 31) & 0xffffffff;
  8900. for ($i=4; $i<0x7f; ++$i) {
  8901. $pad[$i] = (($pad[$i-4]^$pad[$i-2]) << 1 |
  8902. ($pad[$i-3]^$pad[$i-1]) >> 31) & 0xffffffff;
  8903. }
  8904. my @data = unpack("x$start N$words", $$dataPt);
  8905. for ($i=0x7f,$j=0; $j<$words; ++$i,++$j) {
  8906. $data[$j] ^= $pad[$i & 0x7f] = $pad[($i+1) & 0x7f] ^ $pad[($i+65) & 0x7f];
  8907. }
  8908. substr($$dataPt, $start, $words*4) = pack('N*', @data);
  8909. }
  8910. #------------------------------------------------------------------------------
  8911. # Decipher/encipher Sony tag 0x94xx data (ref PH)
  8912. # Inputs: 0) data reference, 1) true to encipher the data
  8913. sub Decipher($;$)
  8914. {
  8915. my ($dataPt, $encipher) = @_;
  8916. # This is a simple substitution cipher, so use a hardcoded translation table for speed.
  8917. # The formula is: $c = ($b*$b*$b) % 249, where $c is the enciphered data byte
  8918. # (note that bytes with values 249-255 are not translated, and 0-1, 82-84,
  8919. # 165-167 and 248 have the same enciphered value)
  8920. if ($encipher) { # encipher
  8921. $$dataPt =~ tr/\x02-\xf7/\x08\x1b\x40\x7d\xd8\x5e\x0e\xe7\x04V\xea\xcd\x05\x8ap\xb6i\x88\x200\xbe\xd7\x81\xbb\x92\x0c\x28\xecl\xa0\x95Q\xd3\x2f\x5dj\x5c9\x07\xc5\x87L\x1a\xf0\xe2\xef\x24y\x02\xb7\xac\xe0\x60\x2bG\xba\x91\xcbu\x8e\x233\xc4\xe3\x96\xdc\xc2N\x7fb\xf6OeE\xeet\xcf\x138KRST\x5bn\x93\xd02\xb1aAW\xa9D\x27X\xdd\xc3\x10\xbc\xdbs\x83\x181\xd4\x15\xe5_\x7bF\xbf\xf3\xe8\xa4\x2d\x82\xb0\xbd\xaf\x8cZ\x1f\xda\x9fmJ\x3cIw\xccU\x11\x06\x3a\xb3\x7e\x9a\x14\xe4\x25\xc8\xe1v\x86\x1e\x3d\xe96\x1c\xa1\xd2\xb5P\xa2\xb8\x98H\xc7\x29f\x8b\x9e\xa5\xa6\xa7\xae\xc1\xe6\x2a\x85\x0b\xb4\x94\xaa\x03\x97z\xab7\x1dc\x165\xc6\xd6k\x84\x2eh\x3f\xb2\xce\x99\x19MB\xf7\x80\xd5\x0a\x17\x09\xdf\xadr4\xf2\xc0\x9d\x8f\x9c\xca\x26\xa8dY\x8d\x0d\xd1\xedg\x3ex\x22\x3b\xc9\xd9q\x90C\x89o\xf4\x2c\x0f\xa3\xf5\x12\xeb\x9b\x21\x7c\xb9\xde\xf1/;
  8922. } else { # decipher
  8923. $$dataPt =~ tr/\x08\x1b\x40\x7d\xd8\x5e\x0e\xe7\x04V\xea\xcd\x05\x8ap\xb6i\x88\x200\xbe\xd7\x81\xbb\x92\x0c\x28\xecl\xa0\x95Q\xd3\x2f\x5dj\x5c9\x07\xc5\x87L\x1a\xf0\xe2\xef\x24y\x02\xb7\xac\xe0\x60\x2bG\xba\x91\xcbu\x8e\x233\xc4\xe3\x96\xdc\xc2N\x7fb\xf6OeE\xeet\xcf\x138KRST\x5bn\x93\xd02\xb1aAW\xa9D\x27X\xdd\xc3\x10\xbc\xdbs\x83\x181\xd4\x15\xe5_\x7bF\xbf\xf3\xe8\xa4\x2d\x82\xb0\xbd\xaf\x8cZ\x1f\xda\x9fmJ\x3cIw\xccU\x11\x06\x3a\xb3\x7e\x9a\x14\xe4\x25\xc8\xe1v\x86\x1e\x3d\xe96\x1c\xa1\xd2\xb5P\xa2\xb8\x98H\xc7\x29f\x8b\x9e\xa5\xa6\xa7\xae\xc1\xe6\x2a\x85\x0b\xb4\x94\xaa\x03\x97z\xab7\x1dc\x165\xc6\xd6k\x84\x2eh\x3f\xb2\xce\x99\x19MB\xf7\x80\xd5\x0a\x17\x09\xdf\xadr4\xf2\xc0\x9d\x8f\x9c\xca\x26\xa8dY\x8d\x0d\xd1\xedg\x3ex\x22\x3b\xc9\xd9q\x90C\x89o\xf4\x2c\x0f\xa3\xf5\x12\xeb\x9b\x21\x7c\xb9\xde\xf1/\x02-\xf7/;
  8924. }
  8925. }
  8926. #------------------------------------------------------------------------------
  8927. # Process Sony 0x94xx cipherdata directory
  8928. # Inputs: 0) ExifTool object ref, 1) directory information ref, 2) tag table ref
  8929. # Returns: 1 on success
  8930. # Notes:
  8931. # 1) dirInfo may contain VarFormatData (reference to empty list) to return
  8932. # details about any variable-length-format tags in the table (used when writing)
  8933. # 2) A bug in ExifTool 9.04-9.10 could have double-enciphered these blocks
  8934. sub ProcessEnciphered($$$)
  8935. {
  8936. my ($et, $dirInfo, $tagTablePtr) = @_;
  8937. my $dataPt = $$dirInfo{DataPt};
  8938. my $dirStart = $$dirInfo{DirStart} || 0;
  8939. my $dirLen = $$dirInfo{DirLen} || (length($$dataPt) - $dirStart);
  8940. my $data = substr($$dataPt, $dirStart, $dirLen);
  8941. my %dirInfo = (
  8942. %$dirInfo,
  8943. DataPt => \$data,
  8944. DataPos => $$dirInfo{DataPos} + $dirStart,
  8945. DirStart => 0,
  8946. );
  8947. Decipher(\$data);
  8948. if ($$et{DoubleCipher}) {
  8949. Decipher(\$data);
  8950. $et->WarnOnce('Some Sony metadata is double-enciphered. Write any tag to fix',1);
  8951. }
  8952. if ($et->Options('Verbose') > 2) {
  8953. my $tagInfo = $$dirInfo{TagInfo} || { Name => 'data' };
  8954. my $str = $$et{DoubleCipher} ? 'ouble-d' : '';
  8955. $et->VerboseDir("D${str}eciphered $$tagInfo{Name}");
  8956. $et->VerboseDump(\$data,
  8957. Prefix => $$et{INDENT} . ' ',
  8958. DataPos => $$dirInfo{DirStart} + $$dirInfo{DataPos} + ($$dirInfo{Base} || 0),
  8959. );
  8960. }
  8961. return $et->ProcessBinaryData(\%dirInfo, $tagTablePtr);
  8962. }
  8963. #------------------------------------------------------------------------------
  8964. # Write Sony 0x94xx cipherdata directory
  8965. # Inputs: 0) ExifTool object ref, 1) source dirInfo ref, 2) tag table ref
  8966. # Returns: cipherdata block or undefined on error
  8967. sub WriteEnciphered($$$)
  8968. {
  8969. my ($et, $dirInfo, $tagTablePtr) = @_;
  8970. $et or return 1;
  8971. my $dataPt = $$dirInfo{DataPt};
  8972. my $dirStart = $$dirInfo{DirStart} || 0;
  8973. my $dirLen = $$dirInfo{DirLen} || (length($$dataPt) - $dirStart);
  8974. my $data = substr($$dataPt, $dirStart, $dirLen);
  8975. my $changed = $$et{CHANGED};
  8976. Decipher(\$data);
  8977. # fix double-enciphered data (due to bug in ExifTool 9.04-9.10)
  8978. if ($$et{DoubleCipher}) {
  8979. Decipher(\$data);
  8980. ++$$et{CHANGED};
  8981. $et->WarnOnce('Fixed double-enciphered Sony metadata',1);
  8982. }
  8983. my %dirInfo = (
  8984. %$dirInfo,
  8985. DataPt => \$data,
  8986. DataPos => $$dirInfo{DataPos} + $dirStart,
  8987. DirStart => 0,
  8988. );
  8989. $data = $et->WriteBinaryData(\%dirInfo, $tagTablePtr);
  8990. if ($changed == $$et{CHANGED}) {
  8991. # nothing changed, so recover original data
  8992. $data = substr($$dataPt, $dirStart, $dirLen);
  8993. } elsif (defined $data) {
  8994. Decipher(\$data,1); # re-encipher
  8995. }
  8996. return $data;
  8997. }
  8998. #------------------------------------------------------------------------------
  8999. # Process SRF maker notes
  9000. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  9001. # Returns: 1 on success
  9002. sub ProcessSRF($$$)
  9003. {
  9004. my ($et, $dirInfo, $tagTablePtr) = @_;
  9005. my $dataPt = $$dirInfo{DataPt};
  9006. my $start = $$dirInfo{DirStart};
  9007. my $verbose = $et->Options('Verbose');
  9008. # process IFD chain
  9009. my ($ifd, $success);
  9010. for ($ifd=0; ; ) {
  9011. # switch tag table for SRF2-5 and SRF6
  9012. if ($ifd == 2) {
  9013. $tagTablePtr = GetTagTable('Image::ExifTool::Sony::SRF2');
  9014. } elsif ($ifd == 6) {
  9015. # SRF6 uses standard EXIF tags
  9016. $tagTablePtr = GetTagTable('Image::ExifTool::Exif::Main');
  9017. }
  9018. my $srf = $$dirInfo{DirName} = "SRF$ifd";
  9019. $$et{SET_GROUP1} = $srf;
  9020. $success = Image::ExifTool::Exif::ProcessExif($et, $dirInfo, $tagTablePtr);
  9021. delete $$et{SET_GROUP1};
  9022. last unless $success;
  9023. #
  9024. # get pointer to next IFD
  9025. #
  9026. my $count = Get16u($dataPt, $$dirInfo{DirStart});
  9027. my $dirEnd = $$dirInfo{DirStart} + 2 + $count * 12;
  9028. last if $dirEnd + 4 > length($$dataPt);
  9029. my $nextIFD = Get32u($dataPt, $dirEnd);
  9030. last unless $nextIFD;
  9031. $nextIFD -= $$dirInfo{DataPos}; # adjust for position of makernotes data
  9032. $$dirInfo{DirStart} = $nextIFD;
  9033. #
  9034. # decrypt next IFD data if necessary
  9035. #
  9036. ++$ifd;
  9037. my ($key, $len);
  9038. if ($ifd == 1) {
  9039. # get the key to decrypt IFD1
  9040. my $cp = $start + 0x8ddc; # why?
  9041. my $ip = $cp + 4 * unpack("x$cp C", $$dataPt);
  9042. $key = unpack("x$ip N", $$dataPt);
  9043. $len = $cp + $nextIFD; # decrypt up to $cp
  9044. } elsif ($ifd == 2) {
  9045. # get the key to decrypt IFD2
  9046. $key = $$et{SRF2Key};
  9047. $len = length($$dataPt) - $nextIFD; # decrypt rest of maker notes
  9048. } else {
  9049. next; # no decryption needed
  9050. }
  9051. # decrypt data
  9052. Decrypt($dataPt, $nextIFD, $len, $key) if defined $key;
  9053. next unless $verbose > 2;
  9054. # display decrypted data in verbose mode
  9055. $et->VerboseDir("Decrypted SRF$ifd", 0, $nextIFD + $len);
  9056. $et->VerboseDump($dataPt,
  9057. Prefix => "$$et{INDENT} ",
  9058. Start => $nextIFD,
  9059. DataPos => $$dirInfo{DataPos},
  9060. );
  9061. }
  9062. }
  9063. #------------------------------------------------------------------------------
  9064. # Write SR2 data
  9065. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  9066. # Returns: 1 on success when reading, or SR2 directory or undef when writing
  9067. sub WriteSR2($$$)
  9068. {
  9069. my ($et, $dirInfo, $tagTablePtr) = @_;
  9070. $et or return 1; # allow dummy access
  9071. my $buff = '';
  9072. $$dirInfo{OutFile} = \$buff;
  9073. return ProcessSR2($et, $dirInfo, $tagTablePtr);
  9074. }
  9075. #------------------------------------------------------------------------------
  9076. # Read/Write SR2 IFD and its encrypted subdirectories
  9077. # Inputs: 0) ExifTool object ref, 1) dirInfo ref, 2) tag table ref
  9078. # Returns: 1 on success when reading, or SR2 directory or undef when writing
  9079. sub ProcessSR2($$$)
  9080. {
  9081. my ($et, $dirInfo, $tagTablePtr) = @_;
  9082. my $raf = $$dirInfo{RAF};
  9083. my $dataPt = $$dirInfo{DataPt};
  9084. my $dataPos = $$dirInfo{DataPos};
  9085. my $dataLen = $$dirInfo{DataLen} || length $$dataPt;
  9086. my $base = $$dirInfo{Base} || 0;
  9087. my $outfile = $$dirInfo{OutFile};
  9088. # clear SR2 member variables to be safe
  9089. delete $$et{SR2SubIFDOffset};
  9090. delete $$et{SR2SubIFDLength};
  9091. delete $$et{SR2SubIFDKey};
  9092. # make sure we have the first 4 bytes available to test directory type
  9093. my $buff;
  9094. if ($dataLen < 4 and $raf) {
  9095. my $pos = $dataPos + ($$dirInfo{DirStart}||0) + $base;
  9096. if ($raf->Seek($pos, 0) and $raf->Read($buff, 4) == 4) {
  9097. $dataPt = \$buff;
  9098. undef $$dirInfo{DataPt}; # must load data from file
  9099. $raf->Seek($pos, 0);
  9100. }
  9101. }
  9102. # this may either be a normal IFD, or a MRW data block
  9103. # (only original ARW images from the A100 use the MRW block)
  9104. my $dataOffset;
  9105. if ($dataPt and $$dataPt =~ /^\0MR[IM]/) {
  9106. my ($err, $srfPos, $srfLen, $dataOffset);
  9107. $dataOffset = $$et{A100DataOffset};
  9108. if ($dataOffset) {
  9109. # save information about the RAW data trailer so it will be preserved
  9110. $$et{KnownTrailer} = { Name => 'A100 RAW Data', Start => $dataOffset };
  9111. } else {
  9112. $err = 'A100DataOffset tag is missing from A100 ARW image';
  9113. }
  9114. $raf or $err = 'Unrecognized SR2 structure';
  9115. unless ($err) {
  9116. $srfPos = $raf->Tell();
  9117. $srfLen = $dataOffset - $srfPos;
  9118. unless ($srfLen > 0 and $raf->Read($buff, $srfLen) == $srfLen) {
  9119. $err = 'Error reading MRW directory';
  9120. }
  9121. }
  9122. if ($err) {
  9123. $outfile and $et->Error($err), return undef;
  9124. $et->Warn($err);
  9125. return 0;
  9126. }
  9127. my %dirInfo = ( DataPt => \$buff );
  9128. require Image::ExifTool::MinoltaRaw;
  9129. if ($outfile) {
  9130. # save MRW data to be written last
  9131. $$et{MRWDirData} = Image::ExifTool::MinoltaRaw::WriteMRW($et, \%dirInfo);
  9132. return $$et{MRWDirData} ? "\0\0\0\0\0\0" : undef;
  9133. } else {
  9134. if (not $outfile and $$et{HTML_DUMP}) {
  9135. $et->HDump($srfPos, $srfLen, '[A100 SRF Data]');
  9136. }
  9137. return Image::ExifTool::MinoltaRaw::ProcessMRW($et, \%dirInfo);
  9138. }
  9139. } elsif ($$et{A100DataOffset}) {
  9140. my $err = 'Unexpected A100DataOffset tag';
  9141. $outfile and $et->Error($err), return undef;
  9142. $et->Warn($err);
  9143. return 0;
  9144. }
  9145. my $verbose = $et->Options('Verbose');
  9146. my $result;
  9147. if ($outfile) {
  9148. $result = Image::ExifTool::Exif::WriteExif($et, $dirInfo, $tagTablePtr);
  9149. return undef unless $result;
  9150. $$outfile .= $result;
  9151. } else {
  9152. $result = Image::ExifTool::Exif::ProcessExif($et, $dirInfo, $tagTablePtr);
  9153. }
  9154. return $result unless $result and $$et{SR2SubIFDOffset};
  9155. # only take first offset value if more than one!
  9156. my @offsets = split ' ', $$et{SR2SubIFDOffset};
  9157. my $offset = shift @offsets;
  9158. my $length = $$et{SR2SubIFDLength};
  9159. my $key = $$et{SR2SubIFDKey};
  9160. my @subifdPos;
  9161. if ($offset and $length and defined $key) {
  9162. my $buff;
  9163. # read encrypted SR2SubIFD from file
  9164. if (($raf and $raf->Seek($offset+$base, 0) and
  9165. $raf->Read($buff, $length) == $length) or
  9166. # or read from data (when processing Adobe DNGPrivateData)
  9167. ($offset - $dataPos >= 0 and $offset - $dataPos + $length < $dataLen and
  9168. ($buff = substr($$dataPt, $offset - $dataPos, $length))))
  9169. {
  9170. Decrypt(\$buff, 0, $length, $key);
  9171. # display decrypted data in verbose mode
  9172. if ($verbose > 2 and not $outfile) {
  9173. $et->VerboseDir("Decrypted SR2SubIFD", 0, $length);
  9174. $et->VerboseDump(\$buff, Addr => $offset + $base);
  9175. }
  9176. my $num = '';
  9177. my $dPos = $offset;
  9178. for (;;) {
  9179. my %dirInfo = (
  9180. Base => $base,
  9181. DataPt => \$buff,
  9182. DataLen => length $buff,
  9183. DirStart => $offset - $dPos,
  9184. DirName => "SR2SubIFD$num",
  9185. DataPos => $dPos,
  9186. );
  9187. my $subTable = GetTagTable('Image::ExifTool::Sony::SR2SubIFD');
  9188. if ($outfile) {
  9189. my $fixup = new Image::ExifTool::Fixup;
  9190. $dirInfo{Fixup} = $fixup;
  9191. $result = $et->WriteDirectory(\%dirInfo, $subTable);
  9192. return undef unless $result;
  9193. # save position of this SubIFD
  9194. push @subifdPos, length($$outfile);
  9195. # add this directory to the returned data
  9196. $$fixup{Start} += length($$outfile);
  9197. $$outfile .= $result;
  9198. $$dirInfo{Fixup}->AddFixup($fixup);
  9199. } else {
  9200. $result = $et->ProcessDirectory(\%dirInfo, $subTable);
  9201. }
  9202. last unless @offsets;
  9203. $offset = shift @offsets;
  9204. $num = ($num || 1) + 1;
  9205. }
  9206. } else {
  9207. $et->Warn('Error reading SR2 data');
  9208. }
  9209. }
  9210. if ($outfile and @subifdPos) {
  9211. # the SR2SubIFD must be padded to a multiple of 4 bytes for the encryption
  9212. my $sr2Len = length($$outfile) - $subifdPos[0];
  9213. if ($sr2Len & 0x03) {
  9214. my $pad = 4 - ($sr2Len & 0x03);
  9215. $sr2Len += $pad;
  9216. $$outfile .= ' ' x $pad;
  9217. }
  9218. # save the new SR2SubIFD Length and Key to be used later for encryption
  9219. $$et{SR2SubIFDLength} = $sr2Len;
  9220. my $newKey = $$et{VALUE}{SR2SubIFDKey};
  9221. $$et{SR2SubIFDKey} = $newKey if defined $newKey;
  9222. # update SubIFD pointers manually and add to fixup, and set SR2SubIFDLength
  9223. my $n = Get16u($outfile, 0);
  9224. my ($i, %found);
  9225. for ($i=0; $i<$n; ++$i) {
  9226. my $entry = 2 + 12 * $i;
  9227. my $tagID = Get16u($outfile, $entry);
  9228. # only interested in SR2SubIFDOffset (0x7200) and SR2SubIFDLength (0x7201)
  9229. next unless $tagID == 0x7200 or $tagID == 0x7201;
  9230. $found{$tagID} = 1;
  9231. my $fmt = Get16u($outfile, $entry + 2);
  9232. if ($fmt != 0x04) { # must be int32u
  9233. $et->Error("Unexpected format ($fmt) for SR2SubIFD tag");
  9234. return undef;
  9235. }
  9236. if ($tagID == 0x7201) { # SR2SubIFDLength
  9237. Set32u($sr2Len, $outfile, $entry + 8);
  9238. next;
  9239. }
  9240. my $tag = 'SR2SubIFDOffset';
  9241. my $valuePtr = @subifdPos < 2 ? $entry+8 : Get32u($outfile, $entry+8);
  9242. my $pos;
  9243. foreach $pos (@subifdPos) {
  9244. Set32u($pos, $outfile, $valuePtr);
  9245. $$dirInfo{Fixup}->AddFixup($valuePtr, $tag);
  9246. undef $tag;
  9247. $valuePtr += 4;
  9248. }
  9249. }
  9250. unless ($found{0x7200} and $found{0x7201}) {
  9251. $et->Error('Missing SR2SubIFD tag');
  9252. return undef;
  9253. }
  9254. }
  9255. return $outfile ? $$outfile : $result;
  9256. }
  9257. 1; # end
  9258. __END__
  9259. =head1 NAME
  9260. Image::ExifTool::Sony - Sony EXIF maker notes tags
  9261. =head1 SYNOPSIS
  9262. This module is loaded automatically by Image::ExifTool when required.
  9263. =head1 DESCRIPTION
  9264. This module contains definitions required by Image::ExifTool to interpret
  9265. Sony maker notes EXIF meta information.
  9266. =head1 NOTES
  9267. Also see Minolta.pm since Sony DSLR models use structures originating from
  9268. Minolta.
  9269. =head1 AUTHOR
  9270. Copyright 2003-2016, Phil Harvey (phil at owl.phy.queensu.ca)
  9271. This library is free software; you can redistribute it and/or modify it
  9272. under the same terms as Perl itself.
  9273. =head1 REFERENCES
  9274. =over 4
  9275. =item L<http://www.cybercom.net/~dcoffin/dcraw/>
  9276. =item L<http://homepage3.nifty.com/kamisaka/makernote/makernote_sony.htm>
  9277. =item L<http://www.klingebiel.com/tempest/hd/pmp.html>
  9278. =item (...plus lots of testing with my RX100!)
  9279. =back
  9280. =head1 ACKNOWLEDGEMENTS
  9281. Thanks to Thomas Bodenmann, Philippe Devaux, Jens Duttke, Marcus
  9282. Holland-Moritz, Andrey Tverdokhleb, Rudiger Lange, Igal Milchtaich, Michael
  9283. Reitinger and Jos Roost for help decoding some tags.
  9284. =head1 SEE ALSO
  9285. L<Image::ExifTool::TagNames/Sony Tags>,
  9286. L<Image::ExifTool::TagNames/Minolta Tags>,
  9287. L<Image::ExifTool(3pm)|Image::ExifTool>
  9288. =cut