CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
GdImageFile.cpython-310.pyc44 linesDownload Raw Back to __pycache__
1o

2��YiJ�@svdZddlmZddlmZddlmZmZmZddl	m3Zddl	mZ
ddlmZGd	d4�d5ej�Zdddd�ZdS)a�6.. note::7    This format cannot be automatically recognized, so the8    class is not registered for use with :py:func:`PIL.Image.open()`.  To open a9    gd file, use the :py:func:`PIL.GdImageFile.open()` function instead.10 11.. warning::12    THE GD FORMAT IS NOT DESIGNED FOR DATA INTERCHANGE.  This13    implementation is provided for convenience and demonstrational14    purposes only.15�)�annotations)�IO�)�	ImageFile�ImagePalette�UnidentifiedImageError)�i16be)�i32be)�StrOrBytesPathc@s"eZdZdZdZdZd	dd�ZdS)16�GdImageFilea%17    Image plugin for the GD uncompressed format.  Note that this format18    is not supported by the standard :py:func:`PIL.Image.open()` function.  To use19    this plugin, you have to import the :py:mod:`PIL.GdImageFile` module and20    use the :py:func:`PIL.GdImageFile.open()` function.21    ZGDzGD uncompressed images�return�NonecCs�|jdusJ�|j�d�}t|�dvrd}t|��d|_t|d�t|d�f|_|d}|r/dnd}t|d	|�}|d22krA||jd<t�	d|d	|dd	|dd
��|_23t�dd|j
d	|dd
d�g|_dS)Ni
)i��i��zNot a valid GD 2.x .gd file�P���r��ZtransparencyZRGBXi�raw)rr�L)�fp�read�i16�SyntaxError�_mode�_size�i32�inforr�paletterZ_Tile�sizeZtile)�self�s�msgZ24true_colorZtrue_color_offsetZtindex�r#�yE:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\PIL/GdImageFile.py�_open1s,25 ��26�zGdImageFile._openN)rr
)�__name__�27__module__�__qualname__�__doc__�format�format_descriptionr%r#r#r#r$r&s28r�rr�StrOrBytesPath | IO[bytes]�mode�strrc29CsF|dkr30d}t|��zt|�WSty"}zd}t|�|�d}~ww)a#31    Load texture from a GD image file.32 33    :param fp: GD file name, or an opened file handle.34    :param mode: Optional mode.  In this version, if the mode argument35        is given, it must be "r".36    :returns: An image instance.37    :raises OSError: If the image could not be read.38    r,zbad modezcannot identify this image fileN)�39ValueErrorrrr)rr.r"�er#r#r$�openTs404142��r2N)r,)rr-r.r/rr)r)�43__future__r�typingr�rrr�_binaryrrr	rZ_typingr44rr2r#r#r#r$�<module>s.
Aluode/PerceptionLabPortable · CoolFace