
    }f-             #         d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
 d dlmZ d dlmZmZ d dlmZmZmZ ddlmZmZmZmZmZmZ dd	lmZ dd
lmZ ddlm Z  ddlm!Z!  ej"        e#          Z$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8d Z9d!Z:d"Z;d#Z<d$Z=d%Z>d&Z?d'Z@d(ZAd)ZBd*ZCd+ZDd,ZEd-ZFd.ZGd/ZHd0ZId1ZJd2ZKd3ZLd4ZMd5ZNd6ZOd7ZPd8ZQd9ZRd:ZSi dd;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[ZTd\ eTU                                D             ZVi e)d d]dd]d^fd_e*d d]dd]d^fd_e)d d]d<d]d^fd`e*d d]d<d]d^fd`e)dd]dd]d^fdae*dd]dd]d^fdae)dd]d<d]d^fdbe*dd]d<d]d^fdbe)d d]ddcd^fdde*d d]ddcd^fdde)d d]d<dcd^fdee*d d]d<dcd^fdee)dd]ddcd^fdfe*dd]ddcd^fdfe)dd]d<dcd^fdge*dd]d<dcd^fdge)d d]ddhd^fdii e*d d]ddhd^fdie)d d]d<dhd^fdje*d d]d<dhd^fdje)dd]ddhd^fdke*dd]ddhd^fdke)dd]d<dhd^fdle*dd]d<dhd^fdle)d d]ddmd^fdne*d d]ddmd^fdne)d d]d<dmd^fdoe*d d]d<dmd^fdoe)dd]ddmd^fdpe*dd]ddmd^fdpe)ddcddmd^fdpe*ddcddmd^fdpe)dd]d<dmd^fdqe*dd]d<dmd^fdqi e)dd]ddrd^fdse)d d]ddtd^fdue)dd]ddtd^fdue*dd]ddtd^fdve)dd]d<dtd^fdwe)ddcddtd^fdxe*ddcddtd^fdye)d dzdd{d^fd|e*d dzdd{d^fd}e)dd]dd{d^fd~e)ddcdd{d^fde*ddcdd{d^fde)ddzdd{d^fd|e*ddzdd{d^fd}e)dd]dddcfde*dd]dddcfde)d<d]ddd^fdi e*d<d]ddd^fde)d<d]d<dd^fde*d<d]d<dd^fde)d<d]ddd^fde*d<d]ddd^fde)d<d]dddfde*d<d]dddfde)d<d]dddfde*d<d]dddfde)d<d]dddfde*d<d]dddfde)d<d]ddd]fde*d<d]ddd]fde)d<d]dddfde*d<d]dddfde)d<d]dddfde*d<d]dddfdi e)d<d]dddcfde*d<d]dddcfde)d<d]dddfde*d<d]dddfde)d<d]dddfde*d<d]dddfde)d<d]dddfde*d<d]dddfde)d<d]ddd^fde*d<d]ddd^fde)d<d]ddd^fde*d<d]ddd^fde)d<d]dddfde*d<d]dddfde)d<d]ddd]fde*d<d]ddd]fde)d<d]dddcfdi e*d<d]dddcfde)d>d]dd]d^fde*d>d]dd]d^fde)d>d]d<d]d^fde*d>d]d<d]d^fde)d>d]ddcd^fde*d>d]ddcd^fde)d>d]d<dcd^fde*d>d]d<dcd^fde)d>d]ddhd^fde*d>d]ddhd^fde)d>d]d<dhd^fde*d>d]d<dhd^fde)d>d]ddmd^fde*d>d]ddmd^fde)d>d]dddcfde*d>d]dddcfde)d>d]d<dmd^fde*d>d]d<dmd^fde)dBd]ddd^fde*dBd]ddd^fde)dBd]dddfde*dBd]dddfde)dBd]dddfde*dBd]dddfde)dBd]ddd^fde)dDd]ddmd^fdpe*dDd]ddmd^fdpe)dDd]ddd^fde*dDd]ddd^fde)dHd]ddd^fde*dHd]ddd^fdiZW eXd eWD                       ZYg dZZd Z[d Z\d Z]i Z^i Z_d Z` G d de          Zad Zbd Zcd Zdere
eeef         Zfne
Zf G d def          Zge^eg_^        e_eg__         e!jU                    D ]M\  ZhZieij                    dd          Zi ekegdeiz   e^eh         d                     ekegdeiz   e_eh                    N[^[_[h[i G dĄ deg          ZlelZm G dƄ dej                  Zni dde)ddd]dfdde)dddmdfdde)dddd<fdde)d>ddmdfdde)d>ddd<fdde)dd<d{dfdde)dddtdfdde)dd<dtdfdde)dd>d{dfdde)d<dddfdde)d<ddd fdde)d<ddd<fdde)dBdddfdde)dDdddfdde)dHdddfdde*dd<d{dfdde*dddtdfde*dd<dtdfde*dd>d{dfdݜZodބ Zp G d߄ d          Zqd Zr ejs        enjt        ene[            eju        enjt        ep            ejv        enjt        er            ejw        enjt        ddg            ejx        enjt        d           dS )    )annotationsN)MutableMapping)Fraction)NumberRational)TYPE_CHECKINGAnyCallable   )ExifTagsImage	ImageFileImageOpsImagePaletteTiffTags)i16be)i32beo8TYPESFT   s   IIs   MM      i  i  i  i  i
  i    i  i  i  i  i  i  i(  i-  i1  i2  i;  i=  i@  iB  iC  D  iE  iJ  iR  iS  i[  i  i  i  i  iI  is  ii  i  i  i  i  raw   
tiff_ccitt   group3   group4   tiff_lzw   	tiff_jpeg   jpeg   tiff_adobe_deflatei  tiff_raw_16i  packbitsi)  tiff_thunderscani  tiff_deflateit  tiff_sgilogiu  tiff_sgilog24im  lzmaiP  zstdiQ  webpc                    i | ]\  }}||	S  r6   ).0kvs      L/var/www/rtfcompare/venv/lib/python3.11/site-packages/PIL/TiffImagePlugin.py
<dictcomp>r;      s    BBBA1BBB    r   r6   )1z1;I)r>   z1;IR)r>   r>   )r>   z1;R)r   )LzL;2I)r?   zL;2IR)r?   zL;2)r?   zL;2R)r"   )r?   zL;4I)r?   zL;4IR)r?   zL;4)r?   zL;4R)r*   )r?   zL;I)r?   zL;IR)r?   r?   )r?   zL;R)   )I;16zI;12)   )rA   rA   )I;16BrC   )rA   zI;16R)II;16S)rD   I;16BS)r    )    )FF;32F)rH   F;32BF)rD   zI;32N)rD   I;32S)rD   I;32BS)r*   r*   )LArM   )r*   r*   r*   )RGBrN   )rN   zRGB;R)r*   r*   r*   r*   )RGBArO   r   )RGBXrQ   )r*   r*   r*   r*   r*   r   r   )rQ   RGBXX)r*   r*   r*   r*   r*   r*   )r   r   r   )rQ   RGBXXX)rO   RGBa)r   r   )rO   RGBaX)r   r   r   )rO   RGBaXX)r   r   )rO   RGBAX)r   r   r   )rO   RGBAXX)i  )rB   rB   rB   )rN   zRGB;16L)rN   zRGB;16B)rB   rB   rB   rB   )rO   zRGBA;16L)rO   zRGBA;16B)rQ   zRGBX;16L)rQ   zRGBX;16B)rO   zRGBa;16L)rO   zRGBa;16B)PzP;1)rZ   zP;1R)rZ   zP;2)rZ   zP;2R)rZ   zP;4)rZ   zP;4R)rZ   rZ   )PAr[   )rZ   zP;R)CMYKr\   )r\   CMYKX)r\   CMYKXX)r\   zCMYK;16L)rN   rQ   )LABr_   c              #  @   K   | ]}t          |d                    V  dS )r"   N)len)r7   key_tps     r:   	<genexpr>rc     s,      AAV#fQi..AAAAAAr<   )   MM *   II* s   MM* s   II *s   MM +s   II+ c                $    | d d         t           v S Nr"   )PREFIXESprefixs    r:   _acceptrk     s    "1":!!r<   c                    t          |           dk    }t          |rd| z  n|                               |          }|r|d d d         n|S )Nr   )absIFDRationallimit_rational)valmax_valinvn_ds       r:   _limit_rationalru     sR    
c((Q,C
-a#gg#
.
.
=
=g
F
FC$3ttt99$r<   c                    t          |           }|j        |j        f}t          |          |k     rt	          | t          |                    }t          |          |k    rt          | } t	          | |          }|S N)r   	numeratordenominatorminru   rn   max)rq   rr   min_valfracrt   s        r:   _limit_signed_rationalr~   "  sp    C==D
.$*
*C
3xx'c3w<<00
3xx'nc7++Jr<   c                      fd}|S )Nc                4     t          | j                  | S rw   )getattr_val)selfargsops     r:   delegatez_delegate.<locals>.delegate8  s    %wty"%%t,,r<   r6   )r   r   s   ` r:   	_delegater   7  s#    - - - - - Or<   c                     e Zd ZdZ	 dZd)dZed             Zed             Zd Z	d Z
d	 Zd
 Zd Zd Z	  ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z ed          Z  ed          Z! ed          Z" ed           Z# ed!          Z$ ed"          Z% ed#          Z& ed$          Z' ed%          Z( ed&          Z) e*e+d'          r ed'          Z,d(S d(S )*ro   zImplements a rational class where 0/0 is a legal value to match
    the in the wild use of exif rationals.

    e.g., DigitalZoomRatio - 0.00/0.00  indicates that no digital zoom was used
    )
_numerator_denominatorr   r   c                   t          |t                    r&|j        | _        |j        | _        |j        | _        dS t          |t                    r|j        | _        |j        | _        n|| _        || _        |dk    rt          d          | _        dS |dk    rt          |          | _        dS t          ||          | _        dS )z
        :param value: either an integer numerator, a
        float/rational/other number, or an IFDRational
        :param denominator: Optional integer denominator
        Nr   nanr   )	
isinstancero   rx   r   ry   r   r   r   float)r   valuery   s      r:   __init__zIFDRational.__init__L  s     e[)) 	#oDO % 1D
DIFeX&& 	,#oDO % 1D#DO +D!eDIIIA DIII 44DIIIr<   c                    | j         S rw   )r   r   s    r:   rx   zIFDRational.numeratorf  s
    r<   c                    | j         S rw   )r   r   s    r:   ry   zIFDRational.denominatorj  s      r<   c                    | j         dk    r| j        | j         fS | j                            |          }|j        |j         fS )z

        :param max_denominator: Integer, the maximum denominator value
        :returns: Tuple of (numerator, denominator)
        r   )ry   rx   r   limit_denominator)r   max_denominatorfs      r:   rp   zIFDRational.limit_rationaln  sF     q  >4#333I''88{AM))r<   c                D    t          t          | j                            S rw   )strr   r   r   s    r:   __repr__zIFDRational.__repr__{  s    5##$$$r<   c                4    | j                                         S rw   )r   __hash__r   s    r:   r   zIFDRational.__hash__~  s    y!!###r<   c                    | j         }t          |t                    r|j         }t          |t                    rt          |          }||k    S rw   )r   r   ro   r   )r   otherrq   s      r:   __eq__zIFDRational.__eq__  sI    ie[)) 	JEeU## 	**Ce|r<   c                *    | j         | j        | j        gS rw   )r   r   r   r   s    r:   __getstate__zIFDRational.__getstate__  s    	4?D,=>>r<   c                r    t                               | d           |\  }}}|| _        || _        || _        d S )Nr   )ro   r   r   r   r   )r   stater   r   r   s        r:   __setstate__zIFDRational.__setstate__  s@    T1%%%).&j,	$(r<   __add____radd____sub____rsub____mul____rmul____truediv____rtruediv____floordiv____rfloordiv____mod____rmod____pow____rpow____pos____neg____abs__	__trunc____lt____gt____le____ge____bool____ceil__	__floor__	__round____int__Nr=   )-__name__
__module____qualname____doc__	__slots__r   propertyrx   ry   rp   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   hasattrr   r   r6   r<   r:   ro   ro   >  s        
 7I5 5 5 54   X ! ! X!* * *% % %$ $ $  ? ? ?) ) ) i	""Gy$$Hi	""Gy$$Hi	""Gy$$H)M**K9^,,L9^,,LIo..Mi	""Gy$$Hi	""Gy$$Hi	""Gi	""Gi	""G	+&&IYx  FYx  FYx  FYx  Fy$$Hy$$H	+&&I	+&&Iwx## ')I&&' 'r<   ro   c                      fd}|S )Nc                    ddl m} | j                            d          r&| j        dd                              dd          |<   | ft
          <   | S )Nr   r   load_r$   _ )r   r   r   
startswithreplace_load_dispatch)funcr   idxsizes     r:   	decoratorz#_register_loader.<locals>.decorator  sd    ######=##G,, 	=qrr*223<<E#J"Djsr<   r6   )r   r   r   s   `` r:   _register_loaderr     s*          r<   c                      fd}|S )Nc                    | t           <   | S rw   )_write_dispatch)r   r   s    r:   r   z#_register_writer.<locals>.decorator  s    #r<   r6   )r   r   s   ` r:   _register_writerr     s$         r<   c                    ddl m} | \  }}|||<   t          j        dz             dfd	ft          |<   fdt
          |<   d S )Nr   r   =Tc                X    |                      t          |          z    |          S rw   )_unpackra   )r   data
legacy_apifmtr   s      r:   <lambda>z!_register_basic.<locals>.<lambda>  s/    LLCII-4s44d;; r<   c                J     d                      fd|D                       S )Nr<   c              3  D   K   | ]}                     |          V  d S rw   )_pack)r7   r   r   r   s     r:   rc   z4_register_basic.<locals>.<lambda>.<locals>.<genexpr>  s1      <<EC''<<<<<<r<   join)r   valuesr   s   ` r:   r   z!_register_basic.<locals>.<lambda>  s0    <<<<<V<<<<< r<   T)r   r   structcalcsizer   r   )idx_fmt_namer   r   namer   r   s       @@r:   _register_basicr     s    !NCdE#J?39%%D	
 	
 	
 	
 	
 	
N3   OCr<   c                  p   e Zd ZU dZi Zded<   i Zded<   d?dZ ed	           Z	 ed
           Z
ed             Zej        d             Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z e eeej        ddfej        ddfej        ddfej         dd fej!        d!d"fej"        d#d$fej#        d%d&fej$        ddfej%        d'd(fg	                      e&d)d)          d@d+            Z' e(d)          d,             Z) e&d-d)          d@d.            Z* e(d-          d/             Z+ e&d0d1          d@d2            Z, e(d0          d3             Z- e&d4d)          d@d5            Z. e(d4          d6             Z/ e&d7d1          d@d8            Z0 e(d7          d9             Z1d: Z2d; Z3dAd=Z4d> Z5dS )BImageFileDirectory_v2a  This class represents a TIFF tag directory.  To speed things up, we
    don't decode tags unless they're asked for.

    Exposes a dictionary interface of the tags in the directory::

        ifd = ImageFileDirectory_v2()
        ifd[key] = 'Some Data'
        ifd.tagtype[key] = TiffTags.ASCII
        print(ifd[key])
        'Some Data'

    Individual values are returned as the strings or numbers, sequences are
    returned as tuples of the values.

    The tiff metadata type of each item is stored in a dictionary of
    tag types in
    :attr:`~PIL.TiffImagePlugin.ImageFileDirectory_v2.tagtype`. The types
    are read from a tiff file, guessed from the type added, or added
    manually.

    Data Structures:

        * ``self.tagtype = {}``

          * Key: numerical TIFF tag number
          * Value: integer corresponding to the data type from
            :py:data:`.TiffTags.TYPES`

          .. versionadded:: 3.0.0

    'Internal' data structures:

        * ``self._tags_v2 = {}``

          * Key: numerical TIFF tag number
          * Value: decoded data, as tuple for multiple values

        * ``self._tagdata = {}``

          * Key: numerical TIFF tag number
          * Value: undecoded byte string from file

        * ``self._tags_v1 = {}``

          * Key: numerical TIFF tag number
          * Value: decoded data in the v1 format

    Tags will be found in the private attributes ``self._tagdata``, and in
    ``self._tags_v2`` once decoded.

    ``self.legacy_api`` is a value for internal use, and shouldn't be changed
    from outside code. In cooperation with
    :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v1`, if ``legacy_api``
    is true, then decoded tags will be populated into both ``_tags_v1`` and
    ``_tags_v2``. ``_tags_v2`` will be used if this IFD is used in the TIFF
    save routine. Tags should be read from ``_tags_v1`` if
    ``legacy_api == true``.

    z>dict[int, Callable[[ImageFileDirectory_v2, bytes, bool], Any]]r   zdict[int, Callable[..., Any]]r      II*     Nc                   t          |          s"dt          |           d}t          |          ||n	|dd         | _        | j        t          k    rd| _        n)| j        t          k    rd| _        nd}t          |          |d         dk    | _        || _        i | _	        	 | 
                                 | j        r|                     d	|d
d                   n|                     d|dd                   \  | _        d| _        dS )a  Initialize an ImageFileDirectory.

        To construct an ImageFileDirectory from a real file, pass the 8-byte
        magic header to the constructor.  To only set the endianness, pass it
        as the 'prefix' keyword argument.

        :param ifh: One of the accepted magic headers (cf. PREFIXES); also sets
              endianness.
        :param prefix: Override the endianness of the file.
        znot a TIFF file (header z not valid)Nr   ><znot a TIFF IFD+   Qr*   r?   r"   F)rk   reprSyntaxError_prefixMM_endianII_bigtiffgrouptagtyperesetr   next_legacy_api)r   ifhrj   r   msgs        r:   r   zImageFileDirectory_v2.__init__%  s    s|| 	#CT#YYCCCCc"""!'!3vvRaR<2DLL\RDLL"Cc"""A"
'

*.-WDLLc!""g&&&T\\#sSTSUSUw=W=W 	 !r<   c                    | j         S rw   )r   r   s    r:   r   zImageFileDirectory_v2.<lambda>E      4< r<   c                    | j         S rw   )_offsetr   s    r:   r   zImageFileDirectory_v2.<lambda>F  r  r<   c                    | j         S rw   )r   r   s    r:   r   z ImageFileDirectory_v2.legacy_apiH  s    r<   c                $    d}t          |          )Nz"Not allowing setting of legacy api)	Exception)r   r   r  s      r:   r   z ImageFileDirectory_v2.legacy_apiL  s    2nnr<   c                Z    i | _         i | _        i | _        i | _        d | _        d | _        d S rw   )_tags_v1_tags_v2_tagdatar   _nextr  r   s    r:   r   zImageFileDirectory_v2.resetQ  s0    
r<   c                :    t          t          |                     S rw   )r   dictr   s    r:   __str__zImageFileDirectory_v2.__str__Y  s    4::r<   c                D      fd                                  D             S )z
        :returns: dict of name|key: value

        Returns the complete tag dictionary, with named tags where possible.
        c                V    i | ]%\  }}t          j        |j                  j        |&S r6   )r   lookupr   r   )r7   coder   r   s      r:   r;   z/ImageFileDirectory_v2.named.<locals>.<dictcomp>b  s@     
 
 
e OD$*--2E
 
 
r<   )itemsr   s   `r:   namedzImageFileDirectory_v2.named\  s6    
 
 
 
#zz||
 
 
 	
r<   c                n    t          t          | j                  t          | j                  z            S rw   )ra   setr  r  r   s    r:   __len__zImageFileDirectory_v2.__len__g  )    3t}%%DM(:(::;;;r<   c                    || j         vr?| j        |         }| j        |         }| j        |         \  }} || || j                  | |<   | j         |         }| j        rt          |t          t          f          s|f}|S rw   )r  r  r   r   r   r   tuplebytes)r   tagr   typr   handlerrq   s          r:   __getitem__z!ImageFileDirectory_v2.__getitem__j  s    dm##=%D,s#C /4MD'dDO<<DImC ? 	:cE5>#B#B 	&C
r<   c                &    || j         v p|| j        v S rw   )r  r  r   r  s     r:   __contains__z"ImageFileDirectory_v2.__contains__u      dm#;sdm';;r<   c                >    |                      ||| j                   d S rw   )_setitemr   )r   r  r   s      r:   __setitem__z!ImageFileDirectory_v2.__setitem__x  s     c5$/22222r<   c           	        t           t          t          f}t          j        || j                  t          ||          r|gn|}|| j        vrj        rj        | j        |<   nt          j	        | j        |<   t          d |D                       r;t          d |D                       rt          j        nt          j        | j        |<   n8t          d |D                       rt          d |D                       rt          j        | j        |<   nt          d |D                       rt          j        | j        |<   nt          d |D                       rt          j        nt          j        | j        |<   nt          d |D                       rt          j        | j        |<   n[t          d |D                       rt          j        | j        |<   n-t          d	 |D                       rt          j        | j        |<   | j        |         t          j	        k    rd
 |D             }n'| j        |         t          j        k    rd |D             }| j        |         t          j        k    ot          |t(                    }|st+          fd|D                       }|r| j        n| j        }|sj        dk    s7| j        |         t          j        k    sj        t3          |          dk    rz|sx|r(| j        |         t          j        t          j        fv r|f}	 |\  ||<   d S # t4          $ r7 t7          j        d| dt3          |           d           |d         ||<   Y d S w xY w|||<   d S )Nc              3  @   K   | ]}t          |t                    V  d S rw   )r   ro   r7   r9   s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  s,      BBaz![11BBBBBBr<   c              3  "   K   | ]
}|d k    V  dS r   Nr6   r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  s&      66!qAv666666r<   c              3  @   K   | ]}t          |t                    V  d S rw   )r   intr+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  ,      <<As++<<<<<<r<   c              3  6   K   | ]}d |cxk    odk     nc V  dS )r   r   Nr6   r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  s6      ::a1>>>>E>>>>::::::r<   c              3  6   K   | ]}d |cxk     odk     nc V  dS )i i   Nr6   r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  s>      BBaX1111E1111BBBBBBr<   c              3  "   K   | ]
}|d k    V  dS r-  r6   r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  s&      ":":a16":":":":":":r<   c              3  @   K   | ]}t          |t                    V  d S rw   )r   r   r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  ,      >>!Au-->>>>>>r<   c              3  @   K   | ]}t          |t                    V  d S rw   )r   r   r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  r0  r<   c              3  @   K   | ]}t          |t                    V  d S rw   )r   r  r+  s     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  r5  r<   c                h    g | ]/}t          |t                    r|                    d d          n|0S )asciir   )r   r   encoder+  s     r:   
<listcomp>z2ImageFileDirectory_v2._setitem.<locals>.<listcomp>  sJ        1;1c0B0BI),,,  r<   c                Z    g | ](}t          |t                    rt          |          n|)S r6   )r   r/  r   r+  s     r:   r;  z2ImageFileDirectory_v2._setitem.<locals>.<listcomp>  s1    LLL*Q"4"4;eAhhh!LLLr<   c              3  B   K   | ]}                     |          V  d S rw   )cvt_enum)r7   r   infos     r:   rc   z1ImageFileDirectory_v2._setitem.<locals>.<genexpr>  s/      DDE4==//DDDDDDr<   r   zMetadata Warning, tag z had too many entries: z, expected 1r   )r   r  r   r   r  r   r   r   type	UNDEFINEDallRATIONALSIGNED_RATIONALSHORTSIGNED_SHORTLONGSIGNED_LONGDOUBLEASCIIBYTEr  r  r
  r  lengthra   
ValueErrorwarningswarn)	r   r  r   r   	basetypesr   is_ifddestr?  s	           @r:   r'  zImageFileDirectory_v2._setitem{  s   UC(	sDJ//&ui88C%edl""y 6$(IS!!$,$6S!BB6BBBBB 6 66v666666))%5 L%%
 <<V<<<<< 6::6::::: 	,4NS))BB6BBBBB ,4,AS))  #":":6":":":::6HMM!)!5 S))
 >>v>>>>> 6(0DL%%<<V<<<<< 6(0DL%%>>v>>>>> 6(0DL%< 222   FF \#("333LLVLLLFc"hm3P
648P8P 	EDDDDVDDDDDF *=t}}  	[A|C HM11#Fq(8(8(8  #dl3/!(4   !&%c & & &1S 1 16{{1 1 1   #1IS				& DIIIs   "L+ +=M,+M,c                    | j                             |d            | j                            |d            | j                            |d            d S rw   )r  popr
  r  r#  s     r:   __delitem__z!ImageFileDirectory_v2.__delitem__  sP    #t$$$#t$$$#t$$$$$r<   c                n    t          t          | j                  t          | j                  z            S rw   )iterr  r  r  r   s    r:   __iter__zImageFileDirectory_v2.__iter__  )    C&&T]););;<<<r<   c                <    t          j        | j        |z   |          S rw   )r   unpackr   )r   r   r   s      r:   r   zImageFileDirectory_v2._unpack  s    }T\C/666r<   c                6    t          j        | j        |z   g|R  S rw   )r   packr   )r   r   r   s      r:   r   zImageFileDirectory_v2._pack  s!    {4<#-77777r<   Hshortr?   longbzsigned bytehzsigned shortlzsigned longr   r   ddoubler   long8r   Tc                    |S rw   r6   r   r   r   s      r:   	load_bytezImageFileDirectory_v2.load_byte      r<   c                    t          |t                    rt          |          }t          |t                    rt          |f          }|S rw   )r   ro   r/  r  r   r   s     r:   
write_bytez ImageFileDirectory_v2.write_byte  sC    dK(( 	t99DdC   	"$>>Dr<   r   c                l    |                     d          r
|d d         }|                    dd          S )N    rm   zlatin-1r   )endswithdecoderh  s      r:   load_stringz!ImageFileDirectory_v2.load_string  s7    == 	9D{{9i000r<   c                    t          |t                    rt          |          }t          |t                    s|                    dd          }|dz   S )Nr9  r   ro  )r   r/  r   r  r:  r   r   s     r:   write_stringz"ImageFileDirectory_v2.write_string  sP     eS!! 	JJE%'' 	5LL)44Eu}r<   r$   r*   c           
         |                      t          |          dz   d|          }fdt          fdt          |d d d         |dd d                   D                       S )Nr"   r?   c                0    r| |fnt          | |          S rw   ro   ara  r   s     r:   combinez4ImageFileDirectory_v2.load_rational.<locals>.combine	       '>Aq66[A->->>r<   c              3  6   K   | ]\  }} ||          V  d S rw   r6   r7   numdenomr{  s      r:   rc   z6ImageFileDirectory_v2.load_rational.<locals>.<genexpr>  3      VVZS%WWS%((VVVVVVr<   r   r   r   ra   r  zipr   r   r   valsr{  s     ` @r:   load_rationalz#ImageFileDirectory_v2.load_rational      ||s4yyA~000$77	? 	? 	? 	? 	? VVVV3tCCaCy$qtRSt*;U;UVVVVVVr<   c                F     d                      fd|D                       S )Nr<   c              3  P   K   | ] } j         d gt          |d          R  V  !dS )2Ll    N)r   ru   r7   r}   r   s     r:   rc   z7ImageFileDirectory_v2.write_rational.<locals>.<genexpr>  sR       
 
DHJDJt?odI>>???
 
 
 
 
 
r<   r   r   r   s   ` r:   write_rationalz$ImageFileDirectory_v2.write_rational  s?    xx 
 
 
 
LR
 
 
 
 
 	
r<   r(   c                    |S rw   r6   rh  s      r:   load_undefinedz$ImageFileDirectory_v2.load_undefined  rj  r<   c                    t          |t                    rt          |          }t          |t                    r#t          |                              dd          }|S )Nr9  r   )r   ro   r/  r   r:  rt  s     r:   write_undefinedz%ImageFileDirectory_v2.write_undefined  sQ    e[)) 	JJEeS!! 	:JJ%%gy99Er<   
   c           
         |                      t          |          dz   d|          }fdt          fdt          |d d d         |dd d                   D                       S )Nr"   rc  c                0    r| |fnt          | |          S rw   rx  ry  s     r:   r{  z;ImageFileDirectory_v2.load_signed_rational.<locals>.combine$  r|  r<   c              3  6   K   | ]\  }} ||          V  d S rw   r6   r~  s      r:   rc   z=ImageFileDirectory_v2.load_signed_rational.<locals>.<genexpr>'  r  r<   r   r   r  r  s     ` @r:   load_signed_rationalz*ImageFileDirectory_v2.load_signed_rational   r  r<   c                F     d                      fd|D                       S )Nr<   c           	   3  R   K   | ]!} j         d gt          |dd          R  V  "dS )2lii   N)r   r~   r  s     r:   rc   z>ImageFileDirectory_v2.write_signed_rational.<locals>.<genexpr>+  sX       
 
 DJtP4T9hOOPPP
 
 
 
 
 
r<   r   r  s   ` r:   write_signed_rationalz+ImageFileDirectory_v2.write_signed_rational)  s?    xx 
 
 
 

 
 
 
 
 	
r<   c                    |                     |          }t          |          |k    r%d| dt          |           d}t          |          |S )Nz&Corrupt EXIF data.  Expecting to read  bytes but only got z. )readra   OSError)r   fpr   retr  s        r:   _ensure_readz"ImageFileDirectory_v2._ensure_read0  sj    ggdmms88tL%)L L?B3xxL L L  #,,
r<   c           
     
   |                                   |                                | _        	 | j        r*|                     d|                     |d                    n)|                     d|                     |d                    d         }t          |          D ]G}| j        r*|                     d|                     |d                    n)|                     d|                     |d	                    \  }}}}t          j        || j	                  j
        }t          j        |d
          }	d| d| d|	 d| d	}
	 | j        |         \  }}n,# t          $ r t                              d|
|           Y w xY w||z  }|| j        rdndk    r|                                }|                     | j        rdnd|          \  }|
d| d| z  }
|                    |           t%          j        ||          }|                    |           n
|d |         }t)          |          |k    rFt+          j        d| dt)          |           d|            t                              |
           |st                              |
           || j        |<   || j        |<   |
d|dk    rd|z  nt3          |          z   z  }
t                              |
           I| j        r*|                     d|                     |d                    n)|                     d|                     |d                    \  | _        d S # t6          $ r,}
t+          j        t9          |
                     Y d }
~
d S d }
~
ww xY w)Nr   r*   r^  r   r   HHQ8s   HHL4sr@   unknownztag:  (
) - type: )z%s - unsupported type %sr"   r?   z Tag Location: z - Data Location: z/Possibly corrupt EXIF data.  Expecting to read r  z. Skipping tag 
 - value: rG   <table: %d bytes>)r   tellr  r   r   r  ranger   r  r   r   r   getr   KeyErrorloggerdebugseekr   
_safe_readra   rN  rO  r  r   r   r   r  r   )r   r  	tag_countir  r  countr   tagnametypnamer  	unit_sizer   r   hereoffsets                   r:   loadzImageFileDirectory_v2.load:  s   

wwyy=	 =AS$"3"3B":":;;;\\#t'8'8Q'?'?@@	I
 9%% ." ." }JDLL$*;*;B*C*CDDDgt/@/@R/H/HII &S% #/#tz::?)C33IgIIIIII3III)-)<S)A&Iww   LL!;S#FFFH y(4111557799D $DM-JSSsD Q QIVMTMMVMMMCGGFOOO$/D99DGGDMMMM;Dt99$$M/-1/ /GJ4yy/ /),/ /  
 LL%%% LL%%%%)c"$'S!|26))'$..d  S!!!! =AS$"3"3B":":;;;\\#t'8'8Q'?'?@@ TYYY
  	 	 	M#c((###FFFFF	s=   DM EM &F =M ?F  G
M 
N!M==Nr   c                   |                      dt          | j                            }g }|t          |          z   t          | j                  dz  z   dz   }d }t          | j                                                  D ]\  }}|t
          k    rt          |          }| j                            |          }t          	                    d||t          |                     |t          j        k    ot          |t                    }|rc| j        dk    rd}	nd}	t!          |	|          }
| j        |         }|                                D ]
\  }}||
|<   |
                    |          }n.t          |t$                    r|n|f} | j        |         | g|R  }t          j        || j                  j        }|rd	nt/          j        |d
          }d| d| d| d| d	}|dt          |          dk    rdt          |          z  nt1          |          z   z  }t          	                    |           |rd}nD|t          j        t          j        t          j        fv rt          |          }nt          |          }t          |          dk    r0|                    ||||                    dd          df           C|                    ||||                      d|          |f           |t          |          dz   dz  dz  z  }|^||         \  }}}}}|rd}t=          |          |                      d|                     d|          d         |z             }|||||f||<   |D ]]\  }}}}}t          	                    d|||t          |          t          |                     ||                      d||||          z  }^|dz  }|D ]$\  }}}}}||z  }t          |          dz  r|dz  }%|S )Nr^  r@   r"   zTag %s, Type: %s, Value: %sr   s   II*    s   MM *   )r   ifdr  zsave: r  r  r  r  rB   r  r   ro  r<   r?   r   z&multistrip support not yet implementedr   z%s %s %s %s %sr  s       ) r   ra   r  sortedr  STRIPOFFSETSr   r  r  r  r   r   rG  r   r  r   r   tobytesr  r   r  r   r   r   r   rK  rJ  rA  appendljustNotImplementedErrorr   )r   r  resultentriesstripoffsetsr  r   r  rQ  r   r  r   ifd_tag	ifd_valuer   r  r  r  r  s                      r:   r  zImageFileDirectory_v2.tobytes}  s5   CT]!3!344#f++%DM(:(:R(??!C !!4!4!6!677 (	3 (	3JCl"""7||,""3''CLL6S$u++NNNHM)Ej.E.EF @<3&&7CC7C+Cs;;;s+*0,,.. - -&GY#,CLL{{6**",UE":":H0t+C0????oc4:66;G%Dee59S)+D+DGF7FFcFFWFFFFFC<36t99??#c$ii//F C LL  $8JKKKD		F4yyA~~S%Au1E1EsKLLLLS%C1H1H$OPPP3t99q=Q.22 #+2<+@(CeUD />)#...JJsDLLe$<$<Q$?&$HIIE$'eUD$@GL! -4 	B 	B(CeUDLL)3UDKKdTTTdjj#sE5AAAFF 	+ -4 	  	 (CeUDdNF4yy1}  %r<   c                6   |                                 dk    r2|                    | j        |                     ddd          z              |                                 }|                     |          }|                    |           |t          |          z   S )Nr   HL*   r*   )r  writer   r   r  ra   )r   r  r  r  s       r:   savezImageFileDirectory_v2.save  s}    7799>>HHT\DJJtR$;$;;<<<f%%
F##r<   )r   NNr   rP   )6r   r   r   r   r   __annotations__r   r   r   rj   r  r   setterr   r  r  r  r!  r$  r(  r'  rU  rX  r   r   listmapr   r   rE  rG  SIGNED_BYTErF  rH  FLOATrI  IFDLONG8r   ri  r   rm  rr  ru  r  r  r  r  r  r  r  r  r  r  r6   r<   r:   r   r     s        : :x VXNWWWW57O7777! ! ! !@ X//00FX//00F    X        	
 	
 	
< < <	 	 	< < <3 3 3N N N`% % %
= = =7 7 78 8 8 	Dg.V,%sM:&^<%sM:g.#x0sF+g.
	
 	
  " a    a   a1 1 1 1
 a   aW W W W a
 
 

 a    a   b!W W W W b
 
 
  A A AFK K K KZ$ $ $ $ $r<   r   r   r   r   write_c                       e Zd ZU dZ fdZ ed           Z ed           Zded<   	 e	d             Z
d Zd	 Zd
 Zd Zd Zd Z xZS )ImageFileDirectory_v1a  This class represents the **legacy** interface to a TIFF tag directory.

    Exposes a dictionary interface of the tags in the directory::

        ifd = ImageFileDirectory_v1()
        ifd[key] = 'Some Data'
        ifd.tagtype[key] = TiffTags.ASCII
        print(ifd[key])
        ('Some Data',)

    Also contains a dictionary of tag types as read from the tiff image file,
    :attr:`~PIL.TiffImagePlugin.ImageFileDirectory_v1.tagtype`.

    Values are returned as a tuple.

    ..  deprecated:: 3.0.0
    c                H     t                      j        |i | d| _        d S )NT)superr   r   )r   r   kwargs	__class__s      r:   r   zImageFileDirectory_v1.__init__  s-    $)&)))r<   c                    | j         S rw   )r
  r   s    r:   r   zImageFileDirectory_v1.<lambda>  s     r<   c                    | j         S rw   )r  r   s    r:   r   zImageFileDirectory_v1.<lambda>  s    DM r<   zdict[int, int]r   c                p     | |j                   }|j        |_        |j        |_        |j        |_        |S )a2  Returns an
        :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v1`
        instance with the same data as is contained in the original
        :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v2`
        instance.

        :returns: :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v1`

        ri   )rj   r  r   r   )clsoriginalr  s      r:   from_v2zImageFileDirectory_v1.from_v2  s:     c)))(&=
r<   c                    t          | j                  }t          | j                  |_        t          | j                  |_        t          | j                  |_        |S )a2  Returns an
        :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v2`
        instance with the same data as is contained in the original
        :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v1`
        instance.

        :returns: :py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v2`

        ri   )r   rj   r  r  r   r  )r   r  s     r:   to_v2zImageFileDirectory_v1.to_v2  sN     $4;777DM**4<((DM**
r<   c                &    || j         v p|| j        v S rw   )r
  r  r#  s     r:   r$  z"ImageFileDirectory_v1.__contains__   r%  r<   c                n    t          t          | j                  t          | j                  z            S rw   )ra   r  r  r
  r   s    r:   r  zImageFileDirectory_v1.__len__#  r  r<   c                n    t          t          | j                  t          | j                  z            S rw   )rW  r  r  r
  r   s    r:   rX  zImageFileDirectory_v1.__iter__&  rY  r<   c                >    dD ]}|                      |||           d S N)FT)r'  )r   r  r   r   s       r:   r(  z!ImageFileDirectory_v1.__setitem__)  s4    ' 	2 	2JMM#uj1111	2 	2r<   c           	        || j         vrQ| j        |         }| j        |         }| j        |         \  }}dD ]$}|                     | || ||          |           %| j         |         }t          |t          t          f          s|f}|S r  )r
  r  r   r   r'  r   r  r  )r   r  r   r  r   r   legacyrq   s           r:   r!  z!ImageFileDirectory_v1.__getitem__-  s    dm##=%D,s#C /4MD'' H Hc774v#>#>GGGGmC #u~.. 	&C
r<   )r   r   r   r   r   r   tagstagdatar  classmethodr  r  r$  r  rX  r(  r!  __classcell__r  s   @r:   r  r    s          $          8..//Dh1122G !  ["  "< < << < <= = =2 2 2
 
 
 
 
 
 
r<   r  c                       e Zd ZdZdZdZd fd	Zd Zed             Z	d Z
d	 Zd
 Zd Zd Z fdZd Zd Zd Z xZS )TiffImageFileTIFFz
Adobe TIFFFNc                l    d | _         	 d | _        	 t                                          ||           d S rw   )tag_v2r  r  r   )r   r  filenamer  s      r:   r   zTiffImageFile.__init__G  s7    5"X&&&&&r<   c                "   | j                             d          }|d         dk    r|| j                             d          z  }t          |          | _        d| _        | j        j        x| _        | _        d| _        | j         | _	        g | _
        d| _        t                              d           t                              d| j                   t                              dt          |                     |                     d	           dS )
z#Open the first image in a TIFF filer*   r   r   Nrm   z*** TiffImageFile._open ***z- __first: %sz	- ifh: %sr   )r  r  r   r  r  r   _TiffImageFile__first_TiffImageFile__next_TiffImageFile__frame_fp
_frame_pos	_n_framesr  r  r   _seek)r   r   s     r:   _openzTiffImageFile._openP  s     gll1ooq6R<<47<<??"C+C00  &*[%55t{72333_dl333[$s)),,, 	

1r<   c                .   | j         |                                 }|                     t          | j                             | j         1|                     |                                 dz              | j         1|                     |           | j         S )Nr   )r  r  r  ra   r  r  )r   currents     r:   n_frameszTiffImageFile.n_framesk  s}    >!iikkGJJs4?++,,,.(

499;;?+++ .(IIg~r<   c                    |                      |          sdS |                     |           t          j        | j                   t          j                            | j        | j                  | _        dS )z%Select a given frame as current imageN)	_seek_checkr  r   _decompression_bomb_checkr   corenewmodeim)r   frames     r:   r  zTiffImageFile.seeku  sc    && 	F

5 	'	222*..DI66r<   c                   | j         | _        | j                                         t          | j                  |k    r| j        sd}t          |          t                              d|| j	        | j        | j                                                   | j        dk    rd}t          |          | j                            | j                   | j                            | j                   t                              d| j                                                   | j                            | j                   | j        j        | j        v rd| _        n| j        j        | _        | j        dk    r
|dz   | _        t          | j                  dk    r| j        dk    | _        | xj	        dz  c_	        t          | j                  |k    | j                            | j        |                    | j                            | j                   |                                  t&                              | j                  x| _        | _        || _	        |                                  d S )Nzno more images in TIFF filez9Seeking to frame %s, on frame %s, __next %s, location: %sl            zUnable to seek to framezLoading tags, location: %sr   r   )r  r  r  ra   r  r  EOFErrorr  r  r  rM  r  r  r  r  r   r  is_animated_reload_exifr  r  r  r  _setup)r   r  r  s      r:   r  zTiffImageFile._seek  s   ( 	$/""e++; $3smm#LLK   {e##/ oo%GLL%%%O""4;///LL5tw||~~FFFKTW%%%{4?22  "k.{a!&4?##q((#';!#3 LLALL9 $/""e++: 	T_U+,,,!!!3;;DKHHH48r<   c                    | j         S )zReturn the current frame number)r  r   s    r:   r  zTiffImageFile.tell  s
    |r<   c                l    t           | j        v r%|                     | j        t                              ni S )z
        Returns a dictionary containing the XMP tags.
        Requires defusedxml to be installed.

        :returns: XMP tags in a dictionary.
        )XMPr  _getxmpr   s    r:   getxmpzTiffImageFile.getxmp  s.     251C1Ct||DK,---Kr<   c                   i }| j                             t          j        j                  }|r|dd         dk    rt          |dd                   }t          j        |d         dz   dz            dz  }t          |d|z   d|z                      }|d|z   d|z   |z            }d|i||<   |t          j        d|z   |z   dz            dz  d         }|dd         dk    |S )	a5  
        Returns a dictionary of Photoshop "Image Resource Blocks".
        The keys are the image resource ID. For more information, see
        https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1037727

        :returns: Photoshop "Image Resource Blocks" in a dictionary.
        Nr"   s   8BIMr&   r   r   r  r   )	r  r  r   BaseImageResourcesi16mathceili32)r   blocksrq   idnr   r   s          r:   get_photoshop_blocksz"TiffImageFile.get_photoshop_blocks  s     koohm:;; 	@bqb'W$$QqS]]Is1vzQ.//!33q1urAv~.//26BFTM12$d^r
$)R!Vd]a$7881<>>? bqb'W$$ r<   c                    | j         r| j        r|                                 S t                                                      S rw   )tileuse_load_libtiff_load_libtiffr  r  )r   r  s    r:   r  zTiffImageFile.load  s;    9 	(. 	(%%'''ww||~~r<   c                \   | j         s]d| _        | j                                         |                                 }t
          j        D ]}||vr|                    |           t          j	        | d           t          j        j        | j        v r| j        t          j        j        = d S d S )NT)in_place)r  !_close_exclusive_fp_after_loadingr  r  getexifr   TAGS_V2_GROUPSget_ifdr   exif_transposer   r  Orientationr  )r   exifkeys      r:   load_endzTiffImageFile.load_end  s      	"59D2 GLLNNN <<>>D. " "d??S!!!!t4444=$33HM5666 43r<   c                    t           j                             |            |                                  t          | j                  dk    sd}t          |          | j        d         d         }t          | j        d         d                   }	 t          | j        d          o| j        	                                }t          | j        d          r| j        
                                 n# t
          $ r d}Y nw xY w|r||d<   t          j        | j        d	t          |          | j                  }	 |                    | j        |           n$# t"          $ r}d
}t          |          |d}~ww xY w| j        o| j         }t          | j        d          rJt(                              d           |                    | j                                                  \  }}	n|rOt(                              d           |s| j                            d           |                    d          \  }}	nct(                              d           | j                            d           |                    | j                                                  \  }}	g | _        d| _        |                                  |r | j                                         d| _        |	dk     rt          |	          t           j                             |           S )zWOverload method triggered when we detect a compressed tiff
        Calls out to libtiffr   zNot exactly one tiler   r    filenoflushFr   libtiffzCouldn't set the imageNgetvaluez5have getvalue. just sending in a string from getvaluez3have fileno, calling fileno version of the decoder.s   fpfpz+don't have fileno or getvalue. just reading)r   r  load_preparera   r"  r  r  r   r  r1  r2  _getdecoderr	  r  decoderconfigsetimager
  rM  _exclusive_fpr  r  r  rq  r4  r  r  readonlyr/  close)
r   r  extentsr   r  decodereclose_self_fpr  errs
             r:   r$  zTiffImageFile._load_libtiff  s    	49~~""(C#,, )A,q/DIaLO$$

	(++@0@0@B tw((   	 	 	 BBB	
  	DG#Iy%++t/A
 
	&TWg.... 	& 	& 	&*C#,,A%	& *C43C/C47J'' 	4 LLPQQQ^^DG$4$4$6$677FAss 	4LLNOOO   Q^^G,,FAss LLFGGGGLLOOO^^DGLLNN33FAs	 	GMMOOODG77#,,{%%%s+   AC. .C=<C=6E 
E3E..E3c                   d| j         v rd}t          |          t          | j                             t          d                   | _        | j                             t          d          | _        | j                             t          d          }| j        dk    rd}| j                             t          d          }t                              d           t                              d| j                   t                              d	|           t                              d
| j                   t                              d|           t                              d| j                            t                               t          | j                             t                              }t          | j                             t                               }||f| _        t                              d| j                   | j                             t&          d          }t)          |          dk    r,t+          |          t-          |          cxk    rdk    rn nd}| j                             t.          d          }| j                             t0          d          }|dv rd}	n|dk    rd}	nd}	|	t)          |          z  }	t)          |          }
| j                             t2          | j        dk    r|dv rdnd          }|t4          k    r,t                              d|           d}t9          |          ||
k     r|d|         }n||
k    r|
dk    r||z  }t)          |          |k    rd}t9          |          | j         j        |||||f}t                              d|           	 t<          |         \  | _        }n># t@          $ r1}t                              d           d}t9          |          |d}~ww xY wt                              d|           t                              d| j!                   | j        | j"        d<   | j                             tF          d          }| j                             tH          d          }|rt|rr| j                             tJ                    }|dk    r||f| j"        d <   n@|dk    r|d!z  |d!z  f| j"        d <   n'|||f| j"        d <   ||f| j"        d"<   n||f| j"        d"<   dx}x}}g | _&        tN          p
| j        d#k    | _(        | j(        r|dk    rH|dd         dz   |dd         z   }t                              d|           t<          |         \  | _        }|d$k    rd%}d&|v r|)                    d&d'          }d(|v r|)                    d(d'          }|dk    r| j        d)k    r| j        dk    rd*}|| j        d+| j         j*        f}| j&        +                    d,dd||fd|f           ntX          | j         v stZ          | j         v rqtX          | j         v r@| j         tX                   }| j                             t\          |          }| j        d         }nP| j         tZ                   }| j                             t^                    }| j                             t`                    }|D ]}||z   |k    r|tc          |          z  d-z  }nd}|}| j        dk    r||         }||	z  }|t          |          df}| j&        +                    | j        ||t-          ||z   |          t-          ||z   |          f||f           ||z   }|| j        d         k    r!d||z   }}|| j        d         k    r	dx}}|dz  }n+t                              d.           d}t9          |          td          | j         v r| j         td                   | j"        d/<   | j!        d0v rKd1 | j         tf                   D             }ti          j5        d2d36                    |                    | _7        dS dS )4z-Setup this image object based on current tagsi  z+Windows Media Photo files not yet supportedr   r   r'   r&   z*** Summary ***z- compression: %sz - photometric_interpretation: %sz- planar_configuration: %sz- fill_order: %sz- YCbCr subsampling: %sz
- size: %sr=   r6   )r   r&   r*   r    r$   r"   )r   r&   z.More samples per pixel than can be decoded: %sz#Invalid value for samples per pixelNzunknown data organizationzformat key: %sz- unsupported formatzunknown pixel modez- raw mode: %sz- pil mode: %scompressionr   dpigRQ@
resolutionr   rA   I;16Nz;16Bz;16Nz;16Lr)   rN   Fr3  r*   z- unsupported data organizationicc_profilerZ   r[   c                2    g | ]}t          |d z            S r   r   )r7   ra  s     r:   r;  z(TiffImageFile._setup.<locals>.<listcomp>  s"    CCCr!s(||CCCr<   RGB;Lr<   )8r  r  COMPRESSION_INFOr  COMPRESSION_compressionPLANAR_CONFIGURATION_planar_configurationPHOTOMETRIC_INTERPRETATION	FILLORDERr  r  r  YCBCRSUBSAMPLINGr/  
IMAGEWIDTHIMAGELENGTH_sizer   SAMPLEFORMATra   r{   rz   BITSPERSAMPLEEXTRASAMPLESSAMPLESPERPIXELMAX_SAMPLESPERPIXELerrorr   rj   	OPEN_INFO_moder  r	  r?  X_RESOLUTIONY_RESOLUTIONRESOLUTION_UNITr"  READ_LIBTIFFr#  r   r  r  r  TILEOFFSETSROWSPERSTRIP	TILEWIDTH
TILELENGTHsum
ICCPROFILECOLORMAPr   r   r   palette)r   r  photo	fillorderxsizeysizesample_format	bps_tupleextra_tuple	bps_countbps_actual_countsamples_per_pixelr.  rawmoder>  xresyresresunitxylayerrz  offsetsrb  wr  stridetile_rawmoderi  s                                r:   r  zTiffImageFile._setup=  sO    T[  ?C#,, -T[__[!-L-LM%)[__5I1%M%M"  :A>> ++EKOOIq11	&'''($*;<<<7???143MNNN'333.=M0N0NOOO DKOOJ//00DKOOK0011E\
\49---d;;}!!c-&8&8C<N<N&S&S&S&SRS&S&S&S&S&S !MKOOM488	koolB77IIIaZZIIIS%%%	y>> KOO"k11evooAA1
 

 222LL@BS   8Cc"""/// ""4#4"45II!1116F!6K6K "$55Iy>>...-Cc""" K
 	%s+++	*"+C.DJ 	* 	* 	*LL/000&Cc"")	*
 	%w///%ty111#'#4	- {|Q//{|Q// 	5D 	5kooo66G!||$($<	%  A$(4K#=	%  $($<	%  +/*	,''*.*	,' A	 , J0AU0J  Y	# A~~"1"gns122w.-s333 '0n#
G
 &  !  !//&&99  !//&&99
 

%//.!33 $+UDK4FGAIi!Qu)=q!DEEEET[((K4;,F,Ft{**+l3KOOL%88IaL +k2KOOI..KOOJ//! # #q55==Y/!3FFF&-22#*5>Li'F!3v;;2	  )As1q5%00#a!eU2C2CD	   E	!$$a!eqADIaL(( !	A
7#: LL:;;;-Cc""" $$'+{:'>DIm$ 9##CCT[-BCCCG'+GSXXg5F5FGGDLLL $#s   4O
 

P,P  P)NN)r   r   r   formatformat_descriptionr'  r   r   r   r  r  r  r  r  r   r  r/  r$  r  r  r  s   @r:   r  r  B  s       F%(-%' ' ' ' ' '  6   X	7 	7 	7* * *X  L L L  *    
7 7 7*S& S& S&j^H ^H ^H ^H ^H ^H ^Hr<   r  r>   r?   rM   rZ   r[   rD   rK   rA   rE   rH   rI   rN   rQ   rO   r\   YCbCrr_   rL   rC   rF   rJ   )rF   rJ   c                >   	 t           | j                 \  }}}}}}n-# t          $ r }	d| j         d}
t          |
          |	d }	~	ww xY wt	          |          }| j        }| j        }	 |d         }nA# t          $ r4 | j                            d          }t          |t                    rd }Y nw xY w|d}n|dk    rd}n|dk    rd	}t          p|dk    }d
|t          <   | j        d         |t          <   | j        d
         |t          <   d|v r	|d         }nNd|v rH|d         }t          |t                     r*t#          j                    }|                    |           |}ni }t(                              dt-          |                     t          |t.                    r|                                }|D ]}t          |t"          j                  r'|t2          j        v r|                    |          ||<   n|                    |          ||<   	 |j        |         |j        |<   r# t:          $ r Y ~w xY wt=          | d          r\t>          t@          tB          tD          tF          tH          fD ]5}|| j%        v r*| j%        |         ||<   | j%        j        |         |j        |<   6|                    d| j                            d                    }|r
||tL          <   tN          dft@          dftB          dft@          dftB          dft>          dftP          dftR          dftT          dftV          dff
D ]\  }}||v r||         ||<   |                    d          }|r*d|t>          <   |d         |t@          <   |d
         |tB          <   |dk    r4||tX          <   t[          |          d
k    rt[          |          |t\          <   |
||t^          <   |d
k    r
||t`          <   tb          |vr||tb          <   n| j        dv r|tb                   dk    r| j        dk    rp| 2                                }|                                }tg          |j4                  D ]0}tg          |j5                  D ]}|||f         dk    rdnd|||f<   1|} ntm          j7        |           } | j        d v rw| j8        9                    d!d"          }g }t[          |          d#z  }tg          d#          D ].}|d$ |||z  ||d
z   z           D             z  }|dgd%|z
  z  z  }/||tt          <   |t                   |t                   }}t[          |          ||d         z  d&z   d'z  z  } tv          |vrl|rV|                    d(tx                    }!| dk    rd
nt{          |!| z  |          }"|dk    rt{          |"d&z   d'z  d'z  |          }"n|}"|"dk    rd
}"|"|tv          <   | dk    rd
n| |tv                   z  }#||tv                   z   d
z
  |tv                   z  }$|#d)k    rt2          j>        |j        t~          <   |#f|$d
z
  z  | |z  |#|$d
z
  z  z
  fz   |t~          <   t          tg          d|#|$z  |#                    |t          <   t                              |d
          |t          <   | j        d*k    r>t          d+t          d,iF                                D ]\  }%}&|G                    |%|&           t          t          t          t          g}'|rXd-|v r[|d-         }(t          |(t                    r|(dk     s|(d.k    rd/}
t          |
          |dk    rd0}
t          |
          |(|t          <   t(                              d1           t(                              d2t          |F                                                     d})t=          |d3          rR	 |O                    d           t          jQ        |R                                          })n# t          jT        $ r Y nw xY wi }*|'t          t          t~          t          t          t          gz  }'tX          |d         i}+i },t=          | d4          r| jX                                        },i t          | di           |,}-t`          |-v r|-t`          = t          j[        |F                                |-F                                          D ]\  }%}&|%t2          j\        vrt          t"          j]        d5d6          s/|%|j        v r|j        |%         |*|%<   nIt          |&t          t          t          t           f          srt3          j`        |%          ja        }.|.r|.|*|%<   |%|+vrc|%|'vr_t          |&t                    r|&b                    d7d8          d9z   |+|%<   t          |&t                    rt          |&          |+|%<   |&|+|%<   t`          |+v r9t[          |+t`                             d
k    r|+t`                   d         |+t`          <   t(                              d:t          |+F                                                     | j        d;v rd<}t-          |+F                                          }/|/d                                 |||)||/|*f}0t#          je        | j        d=|0|          }1|1f                    | j8        d>| j        z              	 |1b                    d@          d
d          \  }2}3|)s|g                    |3           |2rn;|)r&	 t          jh        |)           n# t          $ r Y nw xY w|2dk     rdA|2 dB}
t          |
          nC|'D ]}%||%= |i                    |          }4t          jk        | |dd>| j        z   |4|| d
ffg           dC|v r	|| _l        d S d S )DNzcannot write mode z as TIFFri   rB  r   r'   r)   r/   r+   r   r   tiffinfor-  zTiffinfo Keys: %sr  rF  descriptionrD  x_resolutiony_resolutionresolution_unitsoftware	date_timeartist	copyrightrC  r   r=   )r>   r?   r>   r   rG  rN   rJ  r    c                    g | ]}|d z  S rI  r6   r+  s     r:   r;  z_save.<locals>.<listcomp>  s    MMMQSMMMr<   r   r(   r*   
strip_sizer   r  )r   r   )r   r      r   r  r   qualityd   zInvalid quality settingz5quality setting only supported for 'jpeg' compressionzSaving using libtiff encoderz	Items: %sr1  r  libtiff_support_custom_tagsFr9  r   ro  zConverted items: %s)rC   rA   rE  r3  rR   Ti @  zencoder error z when writing image file_debug_multipage)m	SAVE_INFOr	  r  r  r   encoderinfoencoderconfigr?  r  r   r/  WRITE_LIBTIFFrN  r   rS  rT  r  r   Exifr  r  r  r  r  r  r   r)  r*  r   r  r   r`  r^  r_  IPTC_NAA_CHUNKPHOTOSHOP_CHUNKr  r  rg  IMAGEDESCRIPTIONSOFTWARE	DATE_TIMEARTIST	COPYRIGHTrW  ra   rY  rX  rV  rP  copyr  heightwidthr   invertr
  
getpaletterh  rc  
STRIP_SIZErz   rG  STRIPBYTECOUNTSr  r  COMPRESSION_INFO_REVrL  rR  REFERENCEBLACKWHITEr  
setdefaultrd  re  rb  TILEBYTECOUNTSrM  JPEGQUALITYr  r  osdupr1  ioUnsupportedOperationOSUBFILETYPETRANSFERFUNCTIONSUBIFDr  r   	itertoolschainLIBTIFF_COREr  r   r   r  r@  r:  ro   sort_getencoderr8  r  r;  r  r   _saver  )5r
  r  r  rt  rj   rj  r  bitsextrar>  r  r  r  r  rB  r3  r?  r-  r.  iccr   rC  inverted_impxry  rx  lutcolormapcolorsr  r|  rb  r}  im_strip_sizerows_per_stripstrip_byte_countsstrips_per_imager  r   	blocklistr  r  typesatts
legacy_ifdsupplied_tagsr@  r  rz  encodererrcoder   r  s5                                                        r:   r  r  >  s   "6?6H3ee " " "427444cll!"  v
.
.
.C.K$M!-0   gkk-00k3'' 	K	
 		#	#		&	&*3{e3G !"CgajC
OwqzC [  :&	;		6"dE"" 	:<<DIIdOOOD
LL$d4jj111$-.. zz||  dEJ'' 	%C83J,J,J||C((CHHxx}}CH	#|C0CK 	 	 	D	
 r8 : 
 
	: 
	:C bi9S>C#%9#4S#9C  //-])C)C
D
DC
 J 
=)	|$	|$	~&	~&	+,	:	K 		K  ) )	T ;"4(CH
//%
 
 C
 # OFLFLt||!Mt99>>#&t99C !L{{"L!,,*/&''	J		3'A#Ba#G#G7c>>''))K!!##B;-.. = ={011 = =A$&q!tHOOqqBq!tHH=BB$$B	w+eug..SQq 	- 	-AMM#fqj6QU;K.K*LMMMMHsV|,,HH Hz?C,qAYY1tAw;?q01F3 	'OOL*EEM"(A++QQ3}7NPQ3R3RNf$$!$~'9a&?1%Da!H!HNQN*L#q[[fs<7H.HC--1c,6GGE!!'/}O$-/3Ca3GH
&*:Q*>??L C a"%557HII C ,//Q??C	w'f!=
 %''	' 	'JC NN3&&&&J^DI z
##!),Ggs++ &w{{gmm/ oo%f$$M oo%&C3444[&"5"56662x   	


fRYY[[))*     	
 	
	 tAw' 
2u 	(J D72x44C
C=((l+#/#))++}7J7J7L7LMM 	& 	&JC
 (///uz+H%PP #+%%!$S!1E#JJ$US%e,DEE *#?3//4D *%)c
$3i#7#7eS)) & %Wi @ @5 HDII{33 & %eDII %DI4C\(:$;$;q$@$@!%l!3A!6D*F4::<<,@,@AAA 7'''G
 DJJLL!!		k3$>#BGY=II 0111	#NN955abb9MGT  	  	   Q;;D7DDDC#,, 
  	 	CC"eVbg-v7KLM	
 	
 	

 [((! )(s\    
AAA(A1 1;B/.B/H))
H65H6;;_7 7`	`	l! !
l.-l.c                      e Zd Zg dZh dZddZd Zd Zd Zd Z	d	 Z
d
 Zej        fdZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZddZdS )AppendingTiffWriter)r   r   r   r   r"   r*   r   r   r   r"   r*   r"   r*   r"   r   r"   r*   >       	     r   r   Fc                D   t          |d          r|| _        d| _        nN|| _        d| _        	 t	          ||rdnd          | _        n%# t
          $ r t	          |d          | _        Y nw xY w| j                                        | _        |                                  d S )Nr  FTzw+bzr+b)	r   r   close_fpr   openr  r  	beginningsetup)r   fnr  s      r:   r   zAppendingTiffWriter.__init__  s    2v 		)DF!DMMDI DM)b3"9%%E:: ) ) )b%)

s   A	 	A+*A+c                   | j                             | j        t          j                   d | _        d| _        | j                             d          x| _        }|s	d| _	        d S d| _	        |dk    r| 
                    d           n-|dk    r| 
                    d           nd	}t          |          |                                  |                                  d S )
Nr   r"   TFre   r   rd   r   zInvalid TIFF file header)r   r  r  r  SEEK_SETwhereToWriteNewIFDOffsetoffsetOfNewPager  IIMMisFirst	setEndianRuntimeErrorskipIFDsgoToEnd)r   iimmr  s      r:   r  zAppendingTiffWriter.setup  s    DNBK000(,% 6;;q>>)	D 	DLF=  NN3]""NN3,Cs###r<   c                   | j         rd S | j                            | j                   | j                            d          }|sd S || j        k    rd}t          |          |                                 }|| j        z  }| j                            | j                   | 	                    |           | j                            |           | 
                                 d S )Nr"   z1IIMM of new page doesn't match IIMM of first page)r  r   r  r  r  r  r  readLongr  	writeLongfixIFD)r   r  r  
ifd_offsets       r:   finalizezAppendingTiffWriter.finalize  s    < 	F 	D()))v{{1~~ 	F49ECs###]]__
d**
D1222z"""Jr<   c                V    |                                   |                                  d S rw   )r  r  r   s    r:   newFramezAppendingTiffWriter.newFrame  s     

r<   c                    | S rw   r6   r   s    r:   	__enter__zAppendingTiffWriter.__enter__  s    r<   c                <    | j         r|                                  dS )NF)r  r;  )r   exc_type	exc_value	tracebacks       r:   __exit__zAppendingTiffWriter.__exit__  s    = 	JJLLLur<   c                D    | j                                         | j        z
  S rw   )r   r  r  r   s    r:   r  zAppendingTiffWriter.tell  s    v{{}}t333r<   c                    |t           j        k    r
|| j        z  }| j                            ||           |                                 S rw   )r  r  r  r   r  r  )r   r  whences      r:   r  zAppendingTiffWriter.seek  s@    R[  d**FFF###yy{{r<   c                <   | j                             dt          j                   | j                                         }d|dz  z
  }d|cxk     rdk     r*n n'| j                             t          |                     | j                                         | _        d S )Nr   rB   )r   r  r  SEEK_ENDr  r  r  r  )r   pos	pad_bytess      r:   r  zAppendingTiffWriter.goToEnd  s    Ar{###fkkmm rM	y2FLLy))***#v{{}}r<   c                n    || _         | j         dz   | _        | j         dz   | _        | j         dz   | _        d S )Nr?   r^  HHL)endianlongFmtshortFmt	tagFormat)r   r  s     r:   r  zAppendingTiffWriter.setEndian  s7    {S(c)u,r<   c                ,   	 |                                  }|dk    r#| j                                        dz
  | _        d S | j                            |           |                                 }| j                            |dz  t          j                   )NTr   r"   r@   )r  r   r  r  r  	readShortr  SEEK_CUR)r   r  num_tagss      r:   r  zAppendingTiffWriter.skipIFDs  s}    	4JQ040A-FKK
###~~''HFKK2r{333	4r<   c                6    | j                             |          S rw   )r   r  rl  s     r:   r  zAppendingTiffWriter.write  s    v||D!!!r<   c                n    t          j        | j        | j                            d                    \  }|S )Nr   )r   r[  r  r   r  rt  s     r:   r  zAppendingTiffWriter.readShort  s(    =A??r<   c                n    t          j        | j        | j                            d                    \  }|S rg   )r   r[  r  r   r  rt  s     r:   r  zAppendingTiffWriter.readLong  s(    =tv{{1~~>>r<   c                    | j                             dt          j                   | j                             t          j        | j        |                    }||dk    rd| d}t          |          d S d S )Nr"   wrote only  bytes but wanted 4	r   r  r  r   r  r   r]  r  r  r   r   bytes_writtenr  s       r:   rewriteLastShortToLongz*AppendingTiffWriter.rewriteLastShortToLong  w    B$$$V[u%E%EFF$!););BBBBCs### %$););r<   c                    | j                             dt          j                   | j                             t          j        | j        |                    }||dk    rd| d}t          |          d S d S )Nr  r   r   bytes but wanted 2)	r   r  r  r   r  r   r]  r  r  r
  s       r:   rewriteLastShortz$AppendingTiffWriter.rewriteLastShort  sw    B$$$V[%F%FGG$!););BBBBCs### %$););r<   c                    | j                             dt          j                   | j                             t          j        | j        |                    }||dk    rd| d}t          |          d S d S )Nr"   r  r  r	  r
  s       r:   rewriteLastLongz#AppendingTiffWriter.rewriteLastLong  r  r<   c                    | j                             t          j        | j        |                    }||dk    rd| d}t          |          d S d S )Nr   r  r  )r   r  r   r]  r  r  r
  s       r:   
writeShortzAppendingTiffWriter.writeShort  s_    V[%F%FGG$!););BBBBCs### %$););r<   c                    | j                             t          j        | j        |                    }||dk    rd| d}t          |          d S d S )Nr"   r  r  )r   r  r   r]  r  r  r
  s       r:   r  zAppendingTiffWriter.writeLong  s_    V[u%E%EFF$!););BBBBCs### %$););r<   c                `    |                                   | j                                         d S rw   )r  r   r;  r   s    r:   r;  zAppendingTiffWriter.close"  s"    r<   c                "   |                                  }t          |          D ]i}t          j        | j        | j                            d                    \  }}}| j        |         }||z  }|dk    }|s3|                                 }	|	| j	        z  }	| 
                    |	           || j        v r| j                                        }
|r>|                     ||dk    |dk               | j                            |
dz              nT| j                            |	           |                     ||dk    |dk               | j                            |
           d x}	}
B|r%| j                            dt          j                   kd S )Nr*   r"   r   )isShortisLong)r  r  r   r[  r  r   r  
fieldSizesr  r  r  Tagsr  
fixOffsetsr  r  r   )r   r  r  r  
field_typer  
field_size
total_sizeis_localr  cur_poss              r:   r  zAppendingTiffWriter.fixIFD&  s   >>##x 	, 	,A%+]4>46;;q>>%R%R"CU4J#e+J!QH -$..$$V,,,di&++-- 
)OO
a*PQ/ $    FKK!,,,,FKK'''OO
a*PQ/ $    FKK(((#'' ,Ar{+++=	, 	,r<   c                V   |s|sd}t          |          t          |          D ]}|r|                                 n|                                 }|| j        z  }|r|dk    r|dk    rd}t          |          |                     |           | j                            dt          j	                   | 
                    t          j                   | j                            dt          j	                   |r|                     |           |                     |           d S )Nz offset is neither short nor longr   r   znot implementedir*   )r  r  r  r  r  r  r   r  r  r   r  r   rG  r  r  )r   r  r  r  r  r  r  s          r:   r  zAppendingTiffWriter.fixOffsetsI  s0    	$v 	$4Cs###u 	- 	-A)0ET^^%%%dmmooFd**F -6U??A::+C&s+++ ++F333C---...Ar{++++ -%%f----$$V,,,,%	- 	-r<   N)F)FF)r   r   r   r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r;  r  r  r6   r<   r:   r  r  h  s         J(  D     2  .  
    
4 4 4 #%+    - - -- - -	4 	4 	4" " "    $ $ $$ $ $$ $ $$ $ $$ $ $  !, !, !,F- - - - - -r<   r  c                   | j                                         }| j        }t          |                    dg                     }t          | d          s|st          | ||          S |                                 }	 t          |          5 }| g|z   D ]}||_         ||_        t          |d          sd}	n|j	        }	t          |	          D ]P}
|                    |
           |                                 t          |||           |                                 Q	 d d d            n# 1 swxY w Y   |                     |           d S # |                     |           w xY w)Nappend_imagesr  r   )r  r  r  r  r  r   r  r  r  r  r  r  r  r  )r
  r  r  r  r  r%  cur_idxtfimsnfrr   s              r:   	_save_allr*  c  s   .%%''K$M"==>>M2z"" '= 'RX&&&ggiiG $$ 	"tm+ " ""-$1!sJ// 'CC,C :: " "CHHSMMMHHJJJ#r8,,,KKMMMM	""	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	s1   <E BD*E *D..E 1D.2E E#z.tifz.tiffz
image/tiff)y
__future__r   r  r  loggingr  r  r   rN  collections.abcr   	fractionsr   numbersr   r   typingr   r	   r
    r   r   r   r   r   r   _binaryr   r  r   r  r   r   	getLoggerr   r  ra  r  IFD_LEGACY_APIr  r   r   r  rS  rT  rW  rL  rP  rQ  r  r  rY  rc  r  r^  r_  rN  r`  r  r  r  r  	PREDICTORrh  rd  re  rb  r  r  rX  rV  
JPEGTABLESrR  r  r  r  r  rg  EXIFIFDr  r  IMAGEJ_META_DATA_BYTE_COUNTSIMAGEJ_META_DATArK  r  r  r\  r{   rZ  rh   rk   ru   r~   r   r   r   ro   r   r   r   r/  
_IFDv2Baser   r   r   r   setattrr  ImageFileDirectoryr  r  r  r  r*  register_openr  register_saveregister_save_allregister_extensionsregister_mimer6   r<   r:   <module>rB     s  R # " " " " " 				       				   * * * * * *       $ $ $ $ $ $ $ $ / / / / / / / / / / J J J J J J J J J J J J J J J J ! ! ! ! ! ! ! ! ! ! ! !            		8	$	$ 


 
  	   				
	
  	

	  %  u | x	
 x z { v  
= 
: 
 
> 
= 
?  
6!" 
6#$ 
6% * CB)9)?)?)A)ABBB z D!T2z D!T2	z
 D!T2z D!T2z D!T2
z D!T2
z D!T2z D!T2z D!T2z D!T2z D!T2z D!T2z D!T2z  D!T2!z" D!T2#z$ D!T2%z& D!T2'z z( D!T2)z* D!T2+z, D!T2-z. D!T2/z0 D!T21z2 D!T23z4 D!T25z6 D!T27z8 D!T29z: D!T2;z< D!T2=z> D!T2
?z@ D!T2
AzB D!T2
CzD D!T2
EzF D!T2GzH D!T2Iz z zJ D!UB!1KzL D!UB!1MzN D!UB!1OzP D!UB!3QzR D!UB!2SzT D!UBUzV D!UBWzX D!UBYzZ D!UB[z\ D!UB]z^ D!UB_z` D!UBazb D!UBczd D!UBezf D!VT"Lgzh D!VT"Lizj D!Y#^kz z zl D!Y#^mzn D!Y#%5ozp D!Y#%5qzr D!\2&(8szt D!\2&(8uzv D!\4(*:wzx D!\4(*:yzz D!_f-/@{z| D!_f-/@}z~ D!'35Gz@ D!'35GAzB D!\4(*:CzD D!\4(*:EzF D!_f-/@GzH D!_f-/@IzJ D!'35GKzL D!'35GMz z zN D!\4(*:OzP D!\4(*:QzR D!_f-/@SzT D!_f-/@UzV D!'35GWzX D!'35GYzZ D!\6*,<[z\ D!\6*,<]z^ D!\2&(:_z` D!\2&(:azb D!%r*,@czd D!%r*,@ezf D!%t,.Bgzh D!%t,.Bizj D!%t,.Bkzl D!%t,.Bmzn D!%t,.Boz z zp D!%t,.Bqzr D!T2szt D!T2uzv D!T2wzx D!T2yzz D!T2{z| D!T2}z~ D!T2z@ D!T2AzB D!T2CzD D!T2EzF D!T2GzH D!T2IzJ D!T2
KzL D!T2
MzN D!VT"LOzP D!VT"LQz zR D!T2D!T2D!\2&(8D!\2&(8D!_d+->D!_d+->D!'02DD!'02DD!%r*,@D!T2
D!T2
 D!Y#_D!Y#_D!Y#^D!Y#^sz z	x cAAyAAAAA   " " "% % %  "   y' y' y' y' y'( y' y' y'x	 	 	    "   S)JJJm$ m$ m$ m$ m$J m$ m$ m$` (6  $(7  % J JIC<<S!!DG!7T>>#3Fq3IJJJG!8d?OC4HIIIIOS$X X X X X1 X X Xx + YH YH YH YH YHI' YH YH YHF #r1at	$ #r1at	$	
 	4Q61
% #r1at	$ 	4Q61
% '2q!UD	) VRAud+ gr1a- '2q!UD	) 
E2q!Y- VRA|Q/ VRA|Q/ VRA|T2  gr1aD1!" 
E2q!Y-#$ xQ5$/%& gr1a-'( Q5$/Q5$/+  	2g" g" g"T	x- x- x- x- x- x- x- x-v  >  M(- A A A  M(% 0 0 0  ,i 8 8 8  -.0A B B B  M(, 7 7 7 7 7r<   