)Ej dZddlmZddlmZddlmZmZmZm Z ddl m Z ddl m ZddlmZGd d ejZdddZdS)a .. note:: This format cannot be automatically recognized, so the class is not registered for use with :py:func:`PIL.Image.open()`. To open a gd file, use the :py:func:`PIL.GdImageFile.open()` function instead. .. warning:: THE GD FORMAT IS NOT DESIGNED FOR DATA INTERCHANGE. This implementation is provided for convenience and demonstrational purposes only. ) annotations)IO)Image ImageFile ImagePaletteUnidentifiedImageError)i16be)i32be)StrOrBytesPathc"eZdZdZdZdZddZdS) GdImageFilea% Image plugin for the GD uncompressed format. Note that this format is not supported by the standard :py:func:`PIL.Image.open()` function. To use this plugin, you have to import the :py:mod:`PIL.GdImageFile` module and use the :py:func:`PIL.GdImageFile.open()` function. GDzGD uncompressed imagesreturnNonec:|jJ|jd}t|dvrd}t|d|_t|dt|df|_t j|j|d}|rdnd}t|d |z}|d kr ||j d <tj d |d |zdzd |zdzd z|_ tjdd|jzd |zdzd zdg|_dS)Ni )iizNot a valid GD 2.x .gd filePr transparencyRGBXiraw)rrL)fpreadi16 SyntaxError_mode_sizer_decompression_bomb_checksizei32inforrpaletter_Tiletile)selfsmsg true_colortrue_color_offsettindexs AC:\PYTHON\MyICR_Suite\python\Lib\site-packages\PIL/GdImageFile.py_openzGdImageFile._open2s@w""" GLL   q66 ' '/Cc"" " AYYAq )  ' 222qT !+2AAQ--.. C<<(.DIn %#' Aa++a/!6G2G!2Kg2UUV   O"%%)G3     N)rr)__name__ __module__ __qualname____doc__formatformat_descriptionr1r2r0rr's?F1! ! ! ! ! ! r2rrrStrOrBytesPath | IO[bytes]modestrrc|dkrd}t| t|S#t$r}d}t||d}~wwxYw)a# Load texture from a GD image file. :param fp: 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 OSError: If the image could not be read. r:zbad modezcannot identify this image fileN) ValueErrorrr r )rr<r,es r0openrAVsc s{{oo12 111/$S))q01s( A AA N)r:)rr;r<r=rr)r6 __future__rtypingrrrrr _binaryr rr r%_typingr rrAr9r2r0rGs"  #"""""DDDDDDDDDDDD!!!!!!!!!!!!######, , , , , )%, , , ^1111111r2