ó
È4ec           @   si   d  d l  m Z d  d l m Z y d d l Z Wn# e k
 rU d d l Z e Z n Xd „  Z d Z	 d S(   i   (   t   Image(   t   i32leiÿÿÿÿNc         C   sK   d „  } t  |  d ƒ r" | |  ƒ St j |  d ƒ  } | | ƒ SWd QXd S(   s  
    Load texture from a Quake2 WAL texture file.

    By default, a Quake2 standard palette is attached to the texture.
    To override the palette, use the <b>putpalette</b> method.

    :param filename: WAL file name, or an opened file handle.
    :returns: An image instance.
    c         S   s÷   |  j  d ƒ } t | d ƒ t | d ƒ f } t | d ƒ } |  j | ƒ t j | ƒ t j d | |  j  | d | d ƒ ƒ } | j t ƒ d	 | _ d
 | _	 | d  j
 d d ƒ d | j d <| d d !j
 d d ƒ d } | ró | | j d <n  | S(   Ni    i   i   i$   i(   t   Pi    i   t   WALs   Quake2 Textures    t   namei8   t	   next_namei8   iX   id   iX   (   t   readt   i32t   seekR    t   _decompression_bomb_checkt	   frombytest
   putpalettet   quake2palettet   formatt   format_descriptiont   splitt   info(   t   fpt   headert   sizet   offsett   imR   (    (    s:   /usr/local/lib/python2.7/dist-packages/PIL/WalImageFile.pyt   imopen0   s    *		!R   t   rbN(   t   hasattrt   builtinst   open(   t   filenameR   R   (    (    s:   /usr/local/lib/python2.7/dist-packages/PIL/WalImageFile.pyR   #   s
    	
s   """&&&))),,,///222555777:::<<<$" 


##&""%" #!"  -( )$'"%8.1),%& <07,3(-$("
10.,*'
%!


)#'!& %#! 

&# 

3"5)&7/-95479:379046+14'.1"+/(,%* &%"
 
,!!*)'&$"!


.0)-.'+,&**$()#''!&&$$""
0-,*(&$!



()8&'6%&4$$1""/ !-*'%!
/2)-0&+.$),!'*%(#&!%"

?<9 5#1#-#)?????9??1??*?? ???<?9?5?2?-=*;&9!742/-*'#=???<.*6' 0!)<9772/1,(+&!0" (
   t    R    t   _binaryR   R   R   t   ImportErrort   __builtin__R   R   (    (    (    s:   /usr/local/lib/python2.7/dist-packages/PIL/WalImageFile.pyt   <module>   s   
	.