HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/PIL/__pycache__/GdImageFile.cpython-310.pyc
o

we0
�@sPdZddlmZmZmZddlmZddlmZ	Gdd�dej�Z
ddd	�Zd
S)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.
�)�	ImageFile�ImagePalette�UnidentifiedImageError)�i16be)�i32bec@s eZdZdZdZdZdd�ZdS)�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 imagescCs�|j�d�}t|�dvrd}t|��d|_t|d�t|d�f|_|d}|r(dnd}t|d	|�}|d
kr:||jd<t�	d|d	|dd	|dd
��|_
dd|jd	|dd
dfg|_dS)Ni
)i��i��zNot a valid GD 2.x .gd file�L�������transparency�XBGRi�raw)r
r
)r	r
r)
�fp�read�i16�SyntaxError�_mode�_size�i32�inforr�palette�size�tile)�self�s�msg�
true_color�true_color_offset�tindex�r$�H/home/arjun/projects/env/lib/python3.10/site-packages/PIL/GdImageFile.py�_open.s(
 ��
�zGdImageFile._openN)�__name__�
__module__�__qualname__�__doc__�format�format_descriptionr&r$r$r$r%r#s
r�rc
CsF|dkr
d}t|��zt|�WSty"}zd}t|�|�d}~ww)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)�
ValueErrorrrr)r�moder �er$r$r%�openOs


��r1N)r-)r*�rrr�_binaryrrrrrr1r$r$r$r%�<module>s
,