ó
O'^c           @   s   d  d l  m Z m Z m Z d  d l m Z d Z y d  d l Z Wn# e k
 rg d  d l	 Z	 e	 Z n Xe j
 Z d e j f d     YZ d d  Z d S(	   i˙˙˙˙(   t	   ImageFilet   ImagePalettet   _binary(   t   isPaths   0.1Nt   GdImageFilec           B   s   e  Z d  Z d Z d   Z RS(   t   GDs   GD uncompressed imagesc         C   sŻ   |  j  j d  } d |  _ t | d d ! t | d d ! f |  _ t | d d ! } | d k  rs | |  j d	 <n  t j d
 | d  |  _ d d |  j d d f g |  _	 d  S(   Ni  t   Li    i   i   i   i   i   t   transparentt   RGBt   rawi˙˙˙˙(   i    i    (   R   i    i˙˙˙˙(
   t   fpt   readt   modet   i16t   sizet   infoR   R	   t   palettet   tile(   t   selft   st   tindex(    (    s1   /tmp/pip-unpacked-wheel-ivxKtu/PIL/GdImageFile.pyt   _open3   s    	)(   t   __name__t
   __module__t   formatt   format_descriptionR   (    (    (    s1   /tmp/pip-unpacked-wheel-ivxKtu/PIL/GdImageFile.pyR   .   s   t   rc         C   s}   | d k r t  d   n  t |   rB |  } t j |  d  }  n d } y t |  |  SWn t k
 rx t d   n Xd S(   s)  
    Load texture from a GD image file.

    :param filename: GD file name, or an opened file handle.
    :param mode: Optional mode.  In this version, if the mode argument
        is given, it must be "r".
    :returns: An image instance.
    :raises IOError: If the image could not be read.
    R   s   bad modet   rbt    s   cannot identify this image fileN(   t
   ValueErrorR   t   builtinst   openR   t   SyntaxErrort   IOError(   R
   R   t   filename(    (    s1   /tmp/pip-unpacked-wheel-ivxKtu/PIL/GdImageFile.pyR   E   s    
(   t   PILR    R   R   t	   PIL._utilR   t   __version__R   t   ImportErrort   __builtin__t   i16beR   R   R   (    (    (    s1   /tmp/pip-unpacked-wheel-ivxKtu/PIL/GdImageFile.pyt   <module>   s   
		