K i dZddlmZddlmZddlmZmZmZddl m Z ddl m Z ddlmZGd d ej Zd dd Zy )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) ImageFile ImagePaletteUnidentifiedImageError)i16be)i32be)StrOrBytesPathc eZdZdZdZdZddZy) 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 imagesc|jJ|jjd}t|dvr d}t|d|_t|dt|df|_|d}|rdnd}t |d |z}|d kr||jd <tjd |d |zdzd |zdzd z|_ tjdd|jzd |zdzd zdg|_y)Ni )iizNot a valid GD 2.x .gd filePr transparencyRGBXiraw)rrL)fpreadi16 SyntaxError_mode_sizei32inforrpaletter_Tilesizetile)selfsmsg true_colortrue_color_offsettindexs U/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/PIL/GdImageFile.py_openzGdImageFile._open1sww""" GGLL  q6 '/Cc" " AYAq ) qT !+AQ--. C<(.DIIn %#'' Aa++a/!6G2G!2Kg2UV  OO"%%)G3    N)returnNone)__name__ __module__ __qualname____doc__formatformat_descriptionr-r.r,r r &sF1  r.r c||dk7r d}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. rzbad modezcannot identify this image fileN) ValueErrorr rr)rmoder(es r,openr=TsK s{o12 1/$S)q01s  ;6;N)r9)rzStrOrBytesPath | IO[bytes]r;strr/r )r4 __future__rtypingrrrr_binaryr rr r _typingr r r=r7r.r,rDs9" #==!!#+ )%%+ \1r.