3

Z                 @   sV   d dl mZ d dlmZ yddlZW n  ek
rD   ddlZeZY nX dd ZdZ	dS )   )Image)i32le    Nc          	   C   s:   dd }t | dr|| S tj| d
}||S Q R X dS )a  
    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 d j
ddd |jd< |dd j
ddd }|r||jd< |S )N          $   (   Pr   r   ZWALzQuake2 Texture    name8   	next_namer   X   d   r   )readi32seekr   Z_decompression_bomb_checkZ	frombytesZ
putpalettequake2paletteformatZformat_descriptionsplitinfo)fpheadersizeoffsetZimr    r   2/usr/lib/python3/dist-packages/PIL/WalImageFile.pyimopen/   s    



 

zopen.<locals>.imopenr   rbN)hasattrbuiltinsopen)filenamer   r   r   r   r   r"   "   s
    
r"   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" )
 r   Z_binaryr   r   r!   ImportErrorZ__builtin__r"   r   r   r   r   r   <module>   s   
.