B ë˜Þ]Œ ã@sHddlmZmZddlmZmZmZdZ Gdd„dejƒZ d dd„Z d S) é)Ú ImageFileÚ ImagePalette)Úi8Úi16beÚi32bez0.1c@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ú1/tmp/pip-build-ktz6qwqq/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)Ú ValueErrorrrÚIOError)rrrrrÚopenJs r&N)r#) ÚrrÚ_binaryrrrrrÚ __version__rr&rrrrÚs !