B ]@sVddlmZddlmZy ddlZWn ek rDddlZeZYnXddZdZ dS))Image)i32leNc Cs:dd}t|dr||St|d }||SQRXdS)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 putpalette method. :param filename: WAL file name, or an opened file handle. :returns: An image instance. c Ss|d}t|dt|df}t|d}||t|td|||d|d}|td|_d |_ |dd d dd|j d <|d d  d dd}|r||j d<|S)Nd $(PrrZWALzQuake2 Texturename8X next_name) readi32seekrZ_decompression_bomb_checkZ frombytesZ putpalette quake2paletteformatformat_descriptionsplitinfo)fpheadersizeoffsetZimrr2/tmp/pip-build-ktz6qwqq/Pillow/PIL/WalImageFile.pyimopen0s       zopen..imopenrrbN)hasattrbuiltinsopen)filenamerrrrrr!#s  r!s """&&&))),,,///222555777:::<<<$"         ##&""%" #!"   -( )$'"%8.1),%& <07,3(-$("  10., * ' %!        )#'!& %#!    &#    3"5)&7/-95479:379046+14'.1"+/(,%* & % "    ,!!*)'&$"!  .0)-.'+,&**$()#''!&&$$"" 0-,*(&$!       ()8&'6%&4$$1""/ !-*'%!  /2)-0&+.$),!'*%(#&!%"    ?< 9 5#1#-#)?????9??1??*?? ???<?9?5 ?2?-=*;&9!742/-* '#=??? <.*6' 0!)<9772/1,(+&!0" ) r_binaryrrr ImportError __builtin__r!rrrrrs    .