
SJc           @   sc"  d    Z  d   Z d d d f d d d f d d d	 f d
 d d f d d d f d d d f d d d f d d d f d
 d d f d d d f d d d f f Z hk d f d 6d f d  6d! f d" 6d# h d$ d 6d% d
 6d& d' 6d( d 6d) d* 6d+ d, 6d- d. 6d/ d 6d0 d1 6d2 d3 6d4 d5 6d6 d7 6d8 d9 6d: d; 6d< d= 6d> d? 6d@ dA 6dB dC 6dD dE 6dF dG 6dH dI 6dJ dK 6dL dM 6dN dO 6dP dQ 6dR dS 6dT dU 6dV dW 6dX dY 6dZ d[ 6f d\ 6d] f d^ 6d_ f d` 6da f db 6dc f dd 6de f df 6dg f dh 6di f dj 6dk f dl 6dm h dn d 6do d
 6dp d' 6dq d 6dr d* 6ds d, 6dt d. 6du d 6f dv 6dw f dx 6dy f dz 6d{ f d| 6d} f d~ 6d f d 6d f d 6d e  f d 6d h d d 6d d
 6d d' 6f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d h d d 6d d
 6f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d h	 d d 6d d 6d d
 6d d' 6d d 6d d* 6d d, 6d d. 6d d 6f d 6d f d 6d f d 6d f d 6d f d 6d e  f d 6d f d 6d f d 6d h d d 6d d 6d d
 6d d' 6d d 6d d* 6d d, 6f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d f d 6d h d d 6d d 6d d
 6d d' 6d d 6d d* 6f d 6d h d d 6d d 6d d
 6d d' 6d d1 6d d3 6d d 6d d 6d d 6d d6dd6dd6dd6dd	6d
d6dd6dd6dd6f d6d h dd 6dd 6dd* 6dd. 6dd1 6dd 6dd6dd6dd6dd6d d!6d"d#6d$d%6f d&6d'f d(6d)f d*6d+f d,6d-e f d.6d/f d06d1f d26d3f d46d5f d66d7f d86d9f d:6d;f d<6d=f d>6d?e  f d@6dAh dBd 6dCd
 6dDd[ 6f dE6dFf dG6dHf dI6dJf dK6dLf dM6dNf dO6dPf dQ6dRf dS6dTf dU6dVf dW6dXf dY6dZh d[d 6d\d
 6d]d' 6d^d 6d_d* 6d`d. 6dad 6f db6dch ddd 6ded
 6dfd' 6f dg6dhh did 6f dj6dkf dl6dmh dnd 6dod 6f dp6dqh drd 6dsd 6dtd
 6f du6dvh dwd 6d d 6f dx6dyf dz6d{f d|6d}h d~d 6dd 6dd
 6dd' 6f d6dh dd 6dd 6dd
 6dd' 6dd 6f d6dh dnd 6dd 6dd
 6f d6dh dnd 6dd 6dd
 6f d6dh dnd 6dd 6dd
 6f d6df d6df d6df d6df d6df d6Z h df d 6df d
 6df d6df d6df d6Z h df d 6df d 6df d
 6df d' 6df d 6df d* 6df d, 6df d. 6df d 6df d1 6df d3 6df d 6df d 6df d 6df d6df d6df d6df d6df d6df d	6df d6df d6df d6df d6df d6df d6df d6df d!6Z d.d,f Z d  Z hC de  f d 6de  f d
 6df d' 6df d 6df d* 6df d, 6df d. 6df d 6df d1 6df d 6df d 6de f d 6de f d6df d6df d6de f d6df d	6df d6de f d6df d6df d6df d6df d!6dAf d6df d6df d6df d6df d6df d6df d6df d6dh dd 6dd 6dd. 6dd 6dd1 6f d6dh dd 6dd 6dd 6dd6dd6f d6dh	 dd 6dd 6dd
 6dd6dd6d d6dd6dd6dd6f d6df d	6d
f d6df d6df d6df d6df d6df d6df d6dh dd6dd6dd6dd 6dd 6dd
 6f d 6d!f d"6df d#6d$f d%6d&f d'6d(f d)6d*f d 6d+h d$ d 6d% d
 6d& d' 6d( d 6d) d* 6d+ d, 6d- d. 6d/ d 6d0 d1 6d2 d3 6d4 d5 6d6 d7 6d8 d9 6d: d; 6d< d= 6d> d? 6d@ dA 6dB dC 6dD dE 6dF dG 6dH dI 6dJ dK 6dL dM 6dN dO 6dP dQ 6dR dS 6dT dU 6dV dW 6dX dY 6dZ d[ 6f d\ 6d,f d 6d-f d 6d.h d d 6d d
 6f d 6d/f d06d1f d26df d36d4f d56d6f d76d8f d96d:f d;6d<f d=6df d>6d?f d@6dAf dB6dCf dD6dEf dF6dGf d6Z h dh dHd 6dId
 6dJd' 6dKd 6dLd* 6dMd, 6f d' 6dh dNd 6dOd
 6f d 6dh dnd 6dPd 6dQd
 6dRd' 6dSd 6f d* 6dTh dUd 6dVd
 6dWd 6dXd* 6f d, 6dvh dwd 6dYd 6d d
 6dZd' 6d d 6d[d* 6d\d, 6f d. 6Z	 d]  Z
 h5 d^f d 6d_e
 f d 6d`h dad 6dbd
 6dcd' 6f d 6ddh dnd 6ddd 6ded
 6f d 6dfh dd 6dgd 6f dh6dif dj6dkf dl6dmf dn6dof dp6dqf dr6dse  f dt6dGf du6dvf d6df dw6d f d6dxf d6d f d6d f dy6df dz6dh dgd
 6dd' 6f dz6d{h dd 6d|d 6d}d 6d~d* 6f d6df d6df d6df d6dh dwd 6d d 6f d6df d6df d6df d6df d6dh dd 6dd 6f d6df d6df d6dh dd 6dnd 6dd
 6f d6df d6df d6df d6df d6df d6df d6df d6dh dd 6dd 6f d6d,f d6d-f d6dh dd 6dd 6f d6d!h dd 6dgd 6f d6df d6df d6df d6df d6df d6df d6df d6df d6Z h% dh dd 6dd 6f d 6d,f d  6d-f d" 6dqh d d 6dd
 6dd' 6dd 6dd* 6f d 6dh dd 6dgd 6f d 6d h dd
 6d d' 6dd* 6dd6ddh6dd6f d 6dh dd 6dgd 6f d6dh dd 6dd 6dd
 6dd' 6dd3 6f d6dh dd 6dd 6f d6dh dd 6dd 6f d6df d6df d6dh dwd 6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd  6dd" 6dd\ 6dd 6dd 6dd 6f d6df d6df d6df d6dh dd 6dd 6dd
 6dd' 6dd 6f d6df d 6df d6dAh dBd 6dCd 6dd
 6f d6dh d~d 6dwd, 6dd. 6dd 6dd1 6dd3 6dd 6dd 6dd6d	d6d
d	6dd6ddd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6f d6d!h dd 6d d 6d!d
 6d"d' 6d#d 6d$d* 6f d%6d&h dd 6dgd 6f d'6d(h dd 6dgd 6f d)6d*f d+6d,h dd-6dnd.6dd/6f d06d1h d2d 6d3d
 6d4d' 6d5d 6d6d 6f d76d8f d96d:f d;6d<f d=6d>f d?6d@h dAd 6dBd 6dCd
 6dDd' 6d d 6d d* 6f dE6dFh dAd 6dBd 6d6d
 6d d' 6dGd 6d d* 6f dH6dIf dJ6dKf dL6dMh dad 6dbd
 6dcd' 6dNd 6f dO6dPf dQ6Z h dRh dSd 6dd
 6dTd' 6dd 6dd* 6f d 6dh dUd 6dnd
 6dVd' 6f d
 6dWh ddd
 6dXd' 6dYd 6dZd* 6f d' 6dh dwd 6dgd
 6dd' 6d[d 6f d 6d\h d]d 6dnd 6d^d6f d* 6d_f d, 6dvh dwd 6d d
 6d d' 6d d 6d d* 6d d6f d. 6dh dnd 6dd 6dd
 6f d 6dh dnd 6dd 6dd
 6f d 6dh dnd 6dd 6dd
 6f d 6dTh dnd6dnd`6dda6dbdc6ddde6dfdg6f d6Z h dhe  f d 6df d6dh dd 6dd
 6dnd' 6dd 6dd* 6f d6dvh dwd 6d d 6d[d 6did6djd6dkd6dZd6dodu6f d6dNh dnd 6dd 6dd 6f dy6dlh dnd 6dd 6dd 6f dz6dh dwd 6dgd 6dd
 6d[d' 6f dm6dnf do6ddh dd 6dgd 6f dp6dh dwd 6d d 6f dq6drh dd 6dgd 6f ds6d1h	 dwd 6dd 6dd
 6dtd 6dud* 6dvd, 6dwd 6dxd 6dsd6f dy6dzh dd 6dgd 6f d{6d|h dd 6dgd 6f d}6d~h dd 6dgd 6f d6dh dd 6dgd 6f d6Z h df d, 6df d. 6df d 6df d1 6Z h dh ddd 6dnd
 6f d 6df d
 6dh dnd
 6dVd' 6dd* 6f d' 6dh dd 6dwd 6dgd
 6dd' 6dd 6dd* 6dd, 6dd6f d 6dh dd 6dd 6f d* 6dh dd 6dd 6dd
 6dd' 6dd 6dd* 6dd, 6f d. 6dh dd 6dd 6dd
 6f d3 6dh dd 6d d 6dd
 6dd' 6dd 6dud* 6dd, 6d6d. 6dd 6dtd1 6dd3 6dd 6f d 6dih dd 6dd 6dd
 6f d 6dh dd[ 6dnd 6dd 6f d 6dh dd[ 6dnd 6dd 6f d6dh dd[ 6dnd 6dd 6f d6dh dd 6dwd6dd6dd6dd6dd	6f d6d h dd' 6dd 6dd* 6f d6dh d d 6dwd 6dd' 6dd 6f d6dh dd6dd6dd6dd6dd6f d	6dqh dd 6dd 6dd
 6dd' 6d d 6dd* 6f d6df d6df d6df d6dh dd 6dd 6f d6dh dd6dd 6dd 6dd. 6dd 6f d!6dh dd 6dd 6f d%6Z h dvh dwd 6dd 6d[d
 6d d' 6d d 6d d* 6dod, 6f d. 6df d1 6df d6dh dd6dd6dd6dd6dd6dd6dd6dd6dd 6dd 6dd6dd6dd%6dd6dd6dd6dd6f d6d f d	6Z d  Z d  Z d  Z d f  d    YZ df  d    YZ df  d    YZ de e e d Z d  Z e dj ouddk Z ddk Z y5 e i e i d ddddddg  \ Z  Z! Wn  e i" j
 o e d
  n Xe! g  j o e d
  n e a# dZ$ e Z% e Z& x e  D] \ Z' Z( e' ddf j o e d  n e' ddf j o
 e a# n e' ddf j o
 e( Z$ n e' ddf j o
 e Z& n e' ddf j o
 e Z% n q Wxe! D]Z) y e* e) d Z+ Wn de) GHq@!n Xe) d GHe e+ de$ dt# de& de% Z, e, o dGHq@!n e, i-   Z. e. i/   xw e. D]o Z0 e0 d^df j o q!n y, de0 e e, e0 i1 d
 e, e0 i2 f GHWn  dGe0 GdGe, e0 GdGHn Xq!Wd^e, j o	 dGHn Hq@!Wn dS(	  c         C   sU   d } x< |  D]4 } d | j o! | d j  o | t  |  7} q q W| p |  S| S(   Nt    i    i   (   t   chr(   t   seqt   strt   c(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   make_stringW   s     c         C   s!   |  d d !} |  d }  t  |   S(   Ni    i   (   R   (   R   t   code(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   make_string_ucd   s    
i    t   Xt   Proprietaryi   t   Bt   Bytet   At   ASCIIi   t   St   Shorti   t   Lt   Longi   t   Rt   Ratiot   SBs   Signed Bytet   Ut	   Undefinedt   SSs   Signed Shortt   SLs   Signed Longt   SRs   Signed Ratiot
   ImageWidthi   t   ImageLengthi  t   BitsPerSamplei  t   Compressiont   Uncompresseds   CCITT 1Ds   T4/Group 3 Faxi   s   T6/Group 4 Faxt   LZWi   s   JPEG (old-style)i   t   JPEGi   s   Adobe Deflates   JBIG B&Wi	   s
   JBIG Colori
   t   Nexti  s   Epson ERF Compressedi  t   CCIRLEWi  t   PackBitsi  t   Thunderscani)  t   IT8CTPADi  t   IT8LWi  t   IT8MPi  t   IT8BLi  t	   PixarFilmi  t   PixarLogi  t   Deflatei  t   DCSi  t   JBIGie  t   SGILogit  t   SGILog24iu  s	   JPEG 2000i  s   Nikon NEF Compressedi  s   Kodak DCR Compressedi  s   Pentax PEF Compressedi  i  t   PhotometricInterpretationi  t   Thresholdingi  t	   FillOrderi
  t   DocumentNamei  t   ImageDescriptioni  t   Makei  t   Modeli  t   StripOffsetsi  t   Orientations   Horizontal (normal)s   Mirrored horizontals   Rotated 180s   Mirrored verticals'   Mirrored horizontal then rotated 90 CCWs   Rotated 90 CWs&   Mirrored horizontal then rotated 90 CWs   Rotated 90 CCWi  t   SamplesPerPixeli  t   RowsPerStripi  t   StripByteCountsi  t   XResolutioni  t   YResolutioni  t   PlanarConfigurationi  t   PageNamei  t   ResolutionUnits   Not Absolutes   Pixels/Inchs   Pixels/Centimeteri(  t   TransferFunctioni-  t   Softwarei1  t   DateTimei2  t   Artisti;  t
   WhitePointi>  t   PrimaryChromaticitiesi?  t   TransferRangeiV  t   JPEGProci   t   JPEGInterchangeFormati  t   JPEGInterchangeFormatLengthi  t   YCbCrCoefficientsi  t   YCbCrSubSamplingi  t   YCbCrPositioningt   Centereds   Co-sitedi  t   ReferenceBlackWhitei  t   RatingiFG  t   CFARepeatPatternDimi  t
   CFAPatterni  t   BatteryLeveli  t	   Copyrighti  t   ExposureTimei  t   FNumberi  s   IPTC/NAAi  t
   ExifOffsetii  t   InterColorProfileis  t   ExposureProgramt   Unidentifiedt   Manuals   Program Normals   Aperture Prioritys   Shutter Prioritys   Program Creatives   Program Actions   Portrait Modes   Landscape Modei"  t   SpectralSensitivityi$  t   GPSInfoi%  t   ISOSpeedRatingsi'  t   OECFi(  t   ExifVersioni   t   DateTimeOriginali  t   DateTimeDigitizedi  t   ComponentsConfigurationR    t   Yt   Cbt   Crt   Redt   Greent   Bluei  t   CompressedBitsPerPixeli  t   ShutterSpeedValuei  t   ApertureValuei  t   BrightnessValuei  t   ExposureBiasValuei  t   MaxApertureValuei  t   SubjectDistancei  t   MeteringModet   Averaget   CenterWeightedAveraget   Spott	   MultiSpott   Patterni  t   LightSourcet   Unknownt   Daylightt   Fluorescentt   Tungstens   Fine Weathert   Flasht   Shadei   s   Daylight Fluorescenti   s   Day White Fluorescenti   s   Cool White Fluorescenti   s   White Fluorescenti   s   Standard Light Ai   s   Standard Light Bi   s   Standard Light Ci   t   D55i   t   D65i   t   D75i   t   Otheri   i  t   Not   Fireds	   Fired (?)s	   Fired (!)s
   Fill Fireds   Fill Fired (?)s   Fill Fired (!)t   Offi   s   Auto Offi   s
   Auto Firedi   s   Auto Fired (?)i   s   Auto Fired (!)i   s   Not Availablei    i	  t   FocalLengthi
  t   SubjectAreai  t	   MakerNotei|  t   UserCommenti  t
   SubSecTimei  t   SubSecTimeOriginali  t   SubSecTimeDigitizedi  t   XPTitlei  t	   XPCommenti  t   XPAuthori  t
   XPKeywordsi  t	   XPSubjecti  t   FlashPixVersioni   t
   ColorSpacet   sRGBs	   Adobe RGBt   Uncalibratedi  t   ExifImageWidthi  t   ExifImageLengthi  t   InteroperabilityOffseti  t   FlashEnergyi  t   SpatialFrequencyResponsei  t   FocalPlaneXResolutioni  t   FocalPlaneYResolutioni  t   FocalPlaneResolutionUniti  t   SubjectLocationi  t   ExposureIndexi  t   SensingMethods   Not defineds   One-chip color areas   Two-chip color areas   Three-chip color areas   Color sequential areat	   Trilinears   Color sequential lineari  t
   FileSources   Film Scanners   Reflection Print Scanners   Digital Camerai   t	   SceneTypes   Directly Photographedi  t
   CVAPatterni  t   CustomRenderedt   Normalt   Customi  t   ExposureModes   Auto Exposures   Manual Exposures   Auto Bracketi  t   WhiteBalancet   Autoi  t   DigitalZoomRatioi  t   FocalLengthIn35mmFilmi  t   SceneCaptureTypet   Standardt	   Landscapet   Portraits   Night)i  t   GainControlt   Nones   Low gain ups   High gain ups   Low gain downs   High gain downi  t   Contrastt   Softt   Hardi  t
   Saturationi	  t	   Sharpnessi
  t   DeviceSettingDescriptioni  t   SubjectDistanceRangei  t   Gammai   t   PrintIMi  t   Paddingi  t   InteroperabilityIndext   InteroperabilityVersiont   RelatedImageFileFormati   t   RelatedImageWidthi  t   RelatedImageLengthi  t   GPSVersionIDt   GPSLatitudeReft   GPSLatitudet   GPSLongitudeReft   GPSLongitudet   GPSAltitudeReft   GPSAltitudet   GPSTimeStampt   GPSSatellitest	   GPSStatust   GPSMeasureModet   GPSDOPt   GPSSpeedReft   GPSSpeedt   GPSTrackReft   GPSTrackt   GPSImgDirectionReft   GPSImgDirectiont   GPSMapDatumt   GPSDestLatitudeReft   GPSDestLatitudet   GPSDestLongitudeReft   GPSDestLongitudet   GPSDestBearingRefi   t   GPSDestBearingt   GPSDestDistanceReft   GPSDestDistancei   t   GPSDatec         C   s  |  d d d d g j o d S|  d d d d g j o d S|  d d d d g j o d	 S|  d d d d g j o d
 S|  d d d d g j o d S|  d d d d g j o d S|  d d d d g j o d St  |   d j o d
 S|  d } | d j o d
 S| d j o d | } d } n d } |  d } | | } | | } | d j o | t |  d } n | d j o | d } n$ t | |  } | | i   d } | S(   Ni   i   i   i    s   -2/3 EVi   s   -1/2 EVi   s   -1/3 EVs   0 EVi   s   +1/3 EVi   s   +1/2 EVi   s   +2/3 EVi   i   t   -t   +t    t   EVs    EV(   t   lenR   R   t   __repr__(   R   t   at   ret_strt   bt   wholet   r(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   nikon_ev_bias  sB    





t   MakernoteVersiont
   ISOSettingt	   ColorModet   Qualityt   Whitebalancet   ImageSharpeningt	   FocusModet   FlashSettingt   AutoFlashModet   WhiteBalanceBiast   WhiteBalanceRBCoefft   ProgramShiftt   ExposureDifferencet   ISOSelectiont   NikonPreviewt   FlashCompensationt   ISOSpeedRequestedt   PhotoCornerCoordinatest   FlashBracketCompensationAppliedt   AEBracketCompensationAppliedt   ImageProcessingt   CropHiSpeedi   t   SerialNumberi   t   ImageAdjustmenti   t   ToneCompensationi   t   AuxiliaryLensi   t   LensTypei   t   LensMinMaxFocalMaxAperturei   t   ManualFocusDistancei   t   DigitalZoomFactori   t	   FlashModes   Did Not Fires   Fired, Manuals   Fired, Externals   Fired, Commander Mode s   Fired, TTL Modei   t   AFFocusPositiont   Centert   Topt   Bottomt   Lefti   t   Righti   i   t   BracketingModes   Single frame, no bracketings   Continuous, no bracketings   Timer, no bracketings!   Single frame, exposure bracketings   Continuous, exposure bracketings   Timer, exposure bracketings&   Single frame, white balance bracketingi@   s$   Continuous, white balance bracketingiA   s   Timer, white balance bracketingiB   i   t   AutoBracketReleasei   t
   LensFStopsi   t	   NEFCurve2i   i   t	   SceneModei   t   LightingTypei   t   ShotInfoi   t   HueAdjustmenti   s   B&Wis   -2is   -1it   0t   1t   2i   t   NoiseReductioni   i   t   ColorBalancei   t   LensDatai   t   RawImageCenteri   t
   DigitalICEt   PreviewCompressiont   PreviewImageStartt   PreviewImageLengtht   PreviewYCbCrPositioningt   SensorPixelSizei   s   Scene Assisti   i   t   ImageDataSizei   t
   ImageCounti   t   DeletedImageCounti   t   TotalShutterReleasesi   t   ImageOptimizationi   i   t   DigitalVariProgrami   t   ImageStabilizationi   s   Responsive AFi   t   HighISONoiseReductioni   t   DataDumps	   VGA Basics
   VGA Normals   VGA Fines
   SXGA Basics   SXGA Normals	   SXGA Finet   Colort
   Monochromes   Bright+s   Bright-s	   Contrast+s	   Contrast-t   CCDSpeeds   ISO 80s   ISO 160s   ISO 320s   ISO 100t   Presett   Incandescentt   Cloudys   Speed Lightc         C   s   h d d 6d d 6d d 6d d 6} h d	 d 6d
 d 6d d 6d d 6d d 6} |  d | j p |  d | j o |  Sd | |  d |  d | |  d f S(   NR   i    Rx   i   t   Fasti   t   Panoramai   s   Non-panoramics   Left to rights   Right to lefts   Bottom to tops   Top to bottomi   s   %s - sequence %d - %s(    (   t   vR   R   (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   olympus_special_modex  s    

"t   JPEGThumbnailt   SpecialModet   JPEGQualt   SQt   HQt   SHQt   Macrot
   SuperMacrot   BWModet   Oni  t   DigitalZoomi  t   FocalPlaneDiagonali  t   LensDistortionParamsi  t   SoftwareReleasei  t   PictureInfoi  t   CameraIDi	  i   t   PreCaptureFramesi  t   ISOValuei  i  t   FlashDevicet   Internalt   Externals   Internal + Externali  t   ExposureCompensationi  t   SensorTemperaturei  t   LensTemperaturei  i  t
   RedBalancei  t   BlueBalancei  i  t   FlashExposureCompi#  t   ExternalFlashBouncet   Yesi&  t   ExternalFlashZoomi'  t   ExternalFlashModei(  s   Contrast 	int16ut   Hight   Lowi)  t   SharpnessFactori*  t   ColorControli+  t	   ValidBitsi,  t   CoringFilteri-  t   OlympusImageWidthi.  t   OlympusImageHeighti/  t   CompressionRatioi4  t   PreviewImageValidi5  i6  i7  t   CCDScanModet
   Interlacedt   Progressivei9  i:  t   InfinityLensStepi;  t   NearLensStepi<  t	   Equipmenti   t   CameraSettingsi    t   RawDevelopmenti0   i@   t	   FocusInfoiP   s   RawInfo i 0  t   Programs   Aperture-priority AEs   Shutter speed priority AEs   Program-shiftt   AELocks   Center Weightedt   ESPs
   Pattern+AFi  s   Spot+Highlight controls   Spot+Shadow controli  t	   MacroModes	   Single AFs   Sequential shooting AFs   Continuous AFs   Multi AFt   MFi  t   FocusProcesss   AF Not Useds   AF Usedi  t   AFSearchs	   Not Readyt   Readyi  t   AFAreasi  t   FlashExposureCompensationi  t   WhiteBalance2s   7500K (Fine Weather with Shade)s   6000K (Cloudy)s   5300K (Fine Weather)s   3000K (Tungsten light)s   3600K (Tungsten light-like)s   6600K (Daylight fluorescent)i!   s!   4500K (Neutral white fluorescent)i"   s   4000K (Cool white fluorescent)i#   i0   s   Custom WB 1s   Custom WB 2s   Custom WB 3s   Custom WB 4s   Custom WB 5400Ks   Custom WB 2900Ks   Custom WB 8000Ki   t   WhiteBalanceTemperaturei  t   WhiteBalanceBracketi  t   CustomSaturationi  t   ModifiedSaturations   CM1 (Red Enhance)s   CM2 (Green Enhance)s   CM3 (Blue Enhance)s   CM4 (Skin Tones)i  t   ContrastSettingi  t   SharpnessSettingi  s   Pro Photo RGBi  t   Sports   Landscape+Portraits   Night sceneR3  s   Night+Portraitt	   Fireworkst   Sunsett	   Documentst   Museums
   Beach&Snowi   t   Candles   Underwater Wide1s   Underwater Macroi$   s   High Keyi'   s   Digital Image Stabilizationi(   s   Underwater Wide2i,   s   Low Keyi-   t   Childreni.   s   Nature Macroi	  s   Noise Reductions   Noise Filters   Noise Reduction + Noise Filters   Noise Filter (ISO Boost)s*   Noise Reduction + Noise Filter (ISO Boost)i
  t   DistortionCorrectioni  t   ShadingCompensationi  t   CompressionFactori  t	   Gradations   -1 -1 1s   0 -1 1s   1 -1 1i  t   PictureModet   Vividt   Naturalt   Mutedt   Monotonet   Sepiai   t   PictureModeSaturationi!  s   PictureModeHue?i"  t   PictureModeContrasti#  t   PictureModeSharpnessi$  t   PictureModeBWFilters   n/at   Neutralt   Yellowt   Orangei%  t   PictureModeTonet   Purplei&  t   Sequencei   t   PanoramaModei  t   ImageQuality2t   RAWi  t   ManometerReadingi	  t   RecordingModes   Single Shutters   Night Scenet   Economyt   Finet   FocusingModes
   Auto Focuss   Manual Focust   Infinitys   Red Eye Reductiont   FlashIntensityt   Weakt   Strongs   Object DistanceiP   id   s   +1.0i}   s   +3.0i   s   +2.0i   t   NoteVersions   DaylightColor-Fluorescents   DaywhiteColor-Fluorescents   White-Fluorescentt   Tonei  t   FlashStrengthi  i   i!  t   SlowSynci0  t   Sportst   Nights
   Program AEs   Aperture Priority AEs   Shutter Priority AEi1  t   MotorOrBracketi   t   BlurWarningi   t   FocusWarningi  t	   AEWarningi  t	   ImageTypet   FirmwareVersiont   ImageNumbert	   OwnerNamet	   Macromodet	   SelfTimert	   Superfines   Flash Not Fireds   Red-Eye Reductions   Slow Synchros   Auto + Red-Eye Reductions   On + Red-Eye Reductions   external flasht   ContinuousDriveModes   Single Or Timert
   Continuouss   One-Shots   AI Servos   AI Focust   Singlet	   ImageSizet   Larget   Mediumt   Smallt   EasyShootingModes	   Full Autos   Fast Shutters   Slow Shutters   Macro/Close-Ups	   Pan Focust   2xt   4xt   ISOs   See ISOSpeedRatings Tagt   50t   100t   200t   400t
   Evaluativet   Partials   Center-weightedt	   FocusTypes   Close-Up (Macro)s   Locked (Pan Mode)t   AFPointSelecteds	   None (MF)s   Auto-Selectedi0  i0  i0  i0  s   Easy Shootings   Tv-prioritys   Av-prioritys   A-DEPt!   LongFocalLengthOfLensInFocalUnitst"   ShortFocalLengthOfLensInFocalUnitst   FocalUnitsPerMMt   FlashActivityt   FlashDetailss   External E-TTLs   Internal Flashs   FP Sync Useds   2nd("Rear")-Curtain Sync Useds   FP Sync Enabledt   Sunnyt   SequenceNumbert   AFPointUsedt	   FlashBiass   -2 EVi  s   -1.67 EVi  s   -1.50 EVi  s   -1.33 EVi  s   -1 EVi  s   -0.67 EVi  s   -0.50 EVi  s   -0.33 EVi  s   0 EVs   0.33 EVs   0.50 EVs   0.67 EVs   1 EVs   1.33 EVs   1.50 EVs   1.67 EVi4   s   2 EVc         C   s/   d } x" |  D] } | d >t  |  B} q W| S(   Ni    i   (   t   ord(   R   t   xR   (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   s2n_motorola  s
     c         C   s?   d } d } x, |  D]$ } | t  |  | >B} | d } q W| S(   Ni    l    i   (   R  (   R   R  t   yR   (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt	   s2n_intel  s     c         C   s'   | d j o |  St  | |  |  Sd  S(   Ni    (   t   gcd(   R   R   (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR    s    c           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   | |  _  | |  _ d  S(   N(   t   numt   den(   t   selfR  R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   __init__  s    	c         C   s<   |  i    |  i d j o t |  i  Sd |  i |  i f S(   Ni   s   %d/%d(   t   reduceR  R   R  (   R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR     s    
c         C   sJ   t  |  i |  i  } | d j o$ |  i | |  _ |  i | |  _ n d  S(   Ni   (   R  R  R  (   R  t   div(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR    s    (   t   __name__t
   __module__R  R   R  (    (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR     s   		t   IFD_Tagc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s:   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ d  S(   N(   t	   printablet   tagt
   field_typet   field_offsett   field_lengtht   values(   R  R  R  R  R  R  R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR    s    					c         C   s   |  i  S(   N(   R  (   R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   __str__  s    c         C   s(   d |  i  t |  i d |  i |  i f S(   Ns   (0x%04X) %s=%s @ %di   (   R  t   FIELD_TYPESR  R  R  (   R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR     s    	(   R  R  R  R  R   (    (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR    s   		t   EXIF_headerc           B   sz   e  Z d  d  Z d  d  Z d   Z d   Z d   Z d   Z e d  d d  Z	 d	   Z
 d
   Z d   Z d   Z RS(   i    c         C   sC   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ h  |  _ d  S(   N(   t   filet   endiant   offsett	   fake_exift   strictt   debugt   tags(   R  R  R  R  R  R  R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR    s    						c         C   s   |  i  i |  i |  |  i  i |  } |  i d j o t |  } n t |  } | o3 d d | d >} | | @o | | d >} q n | S(   Nt   Il    i   i   (   R  t   seekR  t   readR  R  R  (   R  R  t   lengtht   signedt   slicet   valt   msb(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   s2n  s    c         C   sg   d } xZ t  |  D]L } |  i d j o | t | d @ } n t | d @ | } | d ?} q W| S(   NR    R  i   i   (   t   rangeR  R   (   R  R  R  t   st   dummy(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   n2s  s     c         C   s   |  i  d d  S(   Ni   (   R  (   R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt	   first_IFD  s    c         C   s.   |  i  | d  } |  i  | d d | d  S(   Ni   i   i   (   R  (   R  t   ifdt   entries(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   next_IFD  s    c         C   sA   |  i    } g  } x( | o  | i |  |  i |  } q W| S(   N(   R  t   appendR  (   R  t   iR   (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt	   list_IFDs  s     t   UNDEFc         C   s  |  i  | d  } xt |  D]} | d d | } |  i  | d  }	 | i |	  }
 |
 o |
 d } n d |	 } t o
 |	 t j pD|  i  | d d  } d | j  o t t  j  n p+ |  i p q q t d | |	 f   n t | d } |  i  | d d  } | d } | | d j o` | oC |  i  | d  } | | |  i	 d } |  i
 o | d } qq|  i  | d  } n | } | d j oi | d j oR | d j  oE |  i i |  i	 |  |  i i |  } | i   i d
 d  } qd } n g  } | d j } | d j  o x t |  D]t } | d j o5 t |  i  | d |  |  i  | d d |   } n |  i  | | |  } | i |  | | } q8Wn | d j o! | d j o t | d  } n t |  } |
 ow t |
  d j o` t |
 d  o |
 d |  } qhd } x2 | D]& } | |
 d i | t |   7} q:Wqln t | |	 | | | | |  |  i | d | <|  i o( d | t |  i | d |  f GHqn | | j o Pq q Wd  S(   Ni   i   i    s
   Tag 0x%04Xs   unknown type %d in tag 0x%04Xi   i   i   i   t    R    i   i	   i
   i  i   i   R   s    debug:   %s: %si   (   i   i   i	   i
   (   i   i
   (   R  R  t   gett   detailedt   IGNORE_TAGSR   R  R  t
   ValueErrorR  R  R  R  R  t   stript   replaceR   R  R   t   callablet   reprR  R  R  (   R  R  t   ifd_namet   dictt   relativet   stop_tagR  R  t   entryR  t	   tag_entryt   tag_nameR  t   typelent   countR  t
   tmp_offsetR  R  R  R  t   valueR  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   dump_IFD  s~     
$



   ,	
&c      	   C   sy  |  i  | d  } |  i d j o
 d } n d } |  i i |  i |  | |  i i | d d  d 7} xLt |  D]>} | d d | } |  i  | d  } |  i  | d d  } t | d } |  i  | d d  }	 |  i  | d	 d  }
 | d d
 } | d j o | } |	 | } n |	 | d j o t |  } | |  |  i	 | d  | | d } | d j o | } d } n |  i i |  i |
  | |  i i |	 |  7} qx qx W|  i
 d i } |  i
 d i } x t t |   D]w } |  i	 t |  |  } | |  | | | | } | | 7} |  i i |  i | |  | |  i i | |  7} qW| |  i
 d <d  S(   Ni   t   Mt   MM *   s   II*    i   t       i    i   i   i   i  s   Thumbnail StripOffsetss   Thumbnail StripByteCountst   TIFFThumbnail(   R  R  R  R  R  R  R  R  R   R  R  R  (   R  t	   thumb_ifdR  t   tiffR  R  R  R  R  R  t   oldofft   ptrt	   strip_offt	   strip_lent   newofft   old_offsetst
   old_countsR  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   extract_TIFF_thumbnaili  sH    
" &
" 
c         C   s  |  i  d } |  i  d i } d | j oE| i d d !d d d d	 d
 d d g j o4 |  i o	 d GHn |  i | i d d d t n | i d d !d d d d	 d
 d d g j o |  i o	 d GHn | i d d !d d g j o- | i d d !d d g j o t d   n |  i | i d d d d t d d n- |  i o	 d GHn |  i | i d d t d  S| i	 d  o! |  i | i d d d t
 n d | j p d | j o |  i | i d d t d  S| d j oZ |  i } d |  _ |  i } |  i | i 7_ |  i d d d t | |  _ | |  _ d  S| d  j o~ |  i | i d d t x] d! t f d" t f f D]C } |  i  i | d  o& |  i |  i  | d i | d  q~q~Wd  Sd  S(#   Ns   EXIF MakerNotes
   Image Maket   NIKONi    i   iN   ii   ik   io   in   i   s$   Looks like a type 1 Nikon MakerNote.i   R   R  i   s+   Looks like a labeled type 2 Nikon MakerNotei   i   i*   l   * l    s%   Missing marker tag '42' in MakerNote.i
   R  s.   Looks like an unlabeled type 2 Nikon MakerNotet   OLYMPUSt   CASIOt   Casiot   FUJIFILMR  t   Canons   MakerNote Tag 0x0001s   MakerNote Tag 0x0004(   R  R  R  R  R  R  t   MAKERNOTE_NIKON_OLDER_TAGSR  t   MAKERNOTE_NIKON_NEWER_TAGSt
   startswitht   MAKERNOTE_OLYMPUS_TAGSt   MAKERNOTE_CASIO_TAGSR  R  t   MAKERNOTE_FUJIFILM_TAGSt   MAKERNOTE_CANON_TAGSt   MAKERNOTE_CANON_TAG_0x001t   MAKERNOTE_CANON_TAG_0x004t   has_keyt   canon_decode_tag(   R  t   notet   makeR  R  R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   decode_maker_note  sZ    ,
	,
	:
						 *c         C   s   d  S(   N(    (   R  R  R  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   olympus_decode_tag  s    c         C   s   x t  d t |   D] } | i | d  } |  i o | G| GHn | d } t |  d j o | d i | | d  } n | | } t t |  d  d d  d  d   |  i d | <q Wd  S(   Ni   Rx   i    s
   MakerNote (   s   Unknown(   R  R   R  R  R  R   R   R  (   R  R  R  R  R  t   nameR  (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR4  	  s     


(   R  R  R  R  R  R  R  R  t	   EXIF_TAGSR  R#  R7  R8  R4  (    (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyR    s   					h	H	S	R   c         C   sh  | a  d } |  i d  } | d d !d1 j o3 |  i d  |  i d  } |  i d  d } n | d d !d j o xv | d d	 j od | d
 d !d2 j oP t | d  d t | d  }	 |  i |	 d  d |  i d  } d } qy W| d d	 j o3 | d
 d !d j o |  i   } |  i d  } q?h  Sn h  S| o h d d 6d d 6| Gd GHn t |  | | | | |  }
 |
 i   } d } x| D]} | d j o
 d } n( | d j o d } | } n d | } | o d | | | f GHn |
 i | | d | |
 i i	 | d  } | o | o d  | i
 d GHn |
 i | i
 d d! d | |
 i i	 d"  } | oB | o d# | i
 d GHn |
 i | i
 d d$ d% t d | qn |
 i i	 | d&  } | oB | o d' | i
 d GHn |
 i | i
 d d( d% t d | n | d 7} qW|
 i i	 d)  } | o! | i d* j o |
 i |  n |
 i i	 d+  } | oF |  i | | i
 d  |
 i d, i
 d } |  i |  |
 i d- <n d. |
 i j o% d/ |
 i j o t  o |
 i   n d- |
 i j oR |
 i i	 d0  } | o5 |  i | | i
 d  t i | i  |
 i d- <qan |
 i S(3   Ni    i   i   s   II* t   MM *i   i   s   s   i   i
   t   JFIFt   JFXXt   OLYMt   Photi   i   i   s    t   Exift   IntelR  t   MotorolaR  t   formatt   Imaget	   Thumbnails   IFD %ds    IFD %d (%s) at offset %d:R  s    ExifOffsets    EXIF SubIFD at offset %d:t   EXIFs"   EXIF SubIFD InteroperabilityOffsets.    EXIF Interoperability SubSubIFD at offset %d:s   EXIF InteroperabilityR  s    GPSInfos    GPS SubIFD at offset %d:t   GPSs   Thumbnail Compressions   Uncompressed TIFFs   Thumbnail JPEGInterchangeFormats%   Thumbnail JPEGInterchangeFormatLengthR6  s   EXIF MakerNotes
   Image Makes   MakerNote JPEGThumbnail(   s   II* R;  (   R<  R=  R>  R?  (   R  R  R  R  t   tellR  R  R  R  R  R  t	   INTR_TAGSt   GPS_TAGSR  R#  R7  R  R  (   t   fR  t   detailsR  R  R  t   dataR  R  R  t   hdrt   ifd_listt   ctrR  t   IFD_nameR  t   exif_offt   intr_offt   gps_offt   thumbt	   thumb_offt   size(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   process_file  s    
 %"% 


''!c         C   sN   d } | d 7} | d 7} | d 7} | d 7} | d 7} | GHt  i |   d  S(   Ns+   Usage: EXIF.py [OPTIONS] file1 [file2 ...]
sD   Extract EXIF information from digital camera image files.

Options:
s(   -q --quick   Do not process MakerNotes.
sD   -t TAG --stop-tag TAG   Stop processing when this tag is retrieved.
s3   -s --strict   Run in strict mode (stop on errors).
s5   -d --debug   Run in debug mode (display extra info).
(   t   syst   exit(   t   exit_statust   msg(    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   usage  s    




t   __main__Ns   hqsdt:vt   helpt   quickR  R  s	   stop-tag=s   -hs   --helps   -qs   --quicks   -ts
   --stop-tags   -ss   --stricts   -ds   --debugt   rbs   '%s' is unreadable
t   :R  RL  s   No EXIF information foundR  s      %s (%s): %st   errort   "s   File has JPEG thumbnail(3   R   R   R  R:  RI  RJ  R  R   R+  R*  R5  R-  t   MAKERNOTE_OLYMPUS_TAG_0x2020R.  R/  R0  R1  R2  R  R  R  R   R  R  t   Truet   FalseRX  R]  R  RY  t   getoptt   argvt   optst   argst   GetoptErrorR  R  R  R  t   oR   t   filenamet   openR  RM  t   keysR  t   sortR  R  R  (    (    (    sV   /mnt/luc/web/www.saillard.org/www/programs_and_patches/photon/photon.hg/Photon/EXIF.pyt   <module>W   s  			



































































































































	,
































































	













































































































































		
	 Uh	5 


 		$
 )!	
