ó
O'^c           @   s   d  d l  m Z m Z d  d l m Z m Z d Z d   Z d e j f d     YZ	 e j
 e	 j e	 e  e j e	 j d  d S(	   i˙˙˙˙(   t   Imaget   TiffImagePlugin(   t   MAGICt	   OleFileIOs   0.1c         C   s   |  d  t  k S(   Ni   (   R   (   t   prefix(    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyt   _accept   s    t   MicImageFilec           B   sM   e  Z d  Z d Z d   Z e d    Z e d    Z d   Z d   Z	 RS(   t   MICs   Microsoft Image Composerc         C   sü   y t  |  j  |  _ Wn t k
 r5 t d   n Xg  |  _ xX |  j j   D]G } | d rO | d d d k rO | d d k rO |  j j |  qO qO W|  j s˛ t d   n  |  j |  _ d |  _	 t
 |  j  d k rë t j |  _ n  |  j d  d  S(   Ns!   not an MIC file; invalid OLE filei   i    iü˙˙˙s   .ACIR    s!   not an MIC file; no image entries(   R   t   fpt   olet   IOErrort   SyntaxErrort   imagest   listdirt   appendt   _MicImageFile__fpt   framet   lenR    t	   CONTAINERt   categoryt   seek(   t   selft   path(    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyt   _open*   s    	.		c         C   s   t  |  j  S(   N(   R   R   (   R   (    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyt   n_framesI   s    c         C   s   t  |  j  d k S(   Ni   (   R   R   (   R   (    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyt   is_animatedM   s    c         C   sc   y |  j  | } Wn t k
 r0 t d   n X|  j j |  |  _ t j j |   | |  _	 d  S(   Ns   no such frame(
   R   t
   IndexErrort   EOFErrorR	   t
   openstreamR   R   t   TiffImageFileR   R   (   R   R   t   filename(    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyR   Q   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyt   tell^   s    (
   t   __name__t
   __module__t   formatt   format_descriptionR   t   propertyR   R   R   R   (    (    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyR   %   s   		s   .micN(   t   PILR    R   t   PIL.OleFileIOR   R   t   __version__R   R   R   t   register_openR"   t   register_extension(    (    (    s4   /tmp/pip-unpacked-wheel-ivxKtu/PIL/MicImagePlugin.pyt   <module>   s   	@