B ¥.¦^9 ã@sHddlmZmZmZddlmZmZmZ Gdd„dejƒZ d dd„Z dS) é)Ú ImageFileÚ ImagePaletteÚUnidentifiedImageError)Úi8Úi16beÚi32bec@seZdZdZdZdd„ZdS)Ú GdImageFileZGDzGD uncompressed imagescCsæ|j d¡}t|dd…ƒdkr(tdƒ‚d|_t|dd…ƒt|dd…ƒf|_t|dƒ}|rddnd}t|d |d |d…ƒ}|d kr–||jd <t   d |d |dd |dd …¡|_ dd|j d |dd dfg|_ dS)Ni é)iþÿiÿÿzNot a valid GD 2.x .gd fileÚLéééééZ transparencyZXBGRiÚraw)r r )r r r)ÚfpÚreadÚi16Ú SyntaxErrorÚmodeÚ_sizerÚi32ÚinforrZpaletteÚsizeZtile)ÚselfÚsZ trueColorZtrueColorOffsetZtindex©rú3/tmp/pip-install-mwhup7aw/Pillow/PIL/GdImageFile.pyÚ_open)s "   &zGdImageFile._openN)Ú__name__Ú __module__Ú __qualname__ÚformatÚformat_descriptionrrrrrr$srÚrcCs:|dkrtdƒ‚yt|ƒStk r4tdƒ‚YnXdS)a) 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$zbad modezcannot identify this image fileN)Ú ValueErrorrrr)rrrrrÚopenEs r&N)r$) ÚrrrÚ_binaryrrrrrrr&rrrrÚs !