
    h
                        S r SSKJr  SSKJr  SSKJrJrJr  SSK	J
r  SSK	Jr  SSKJr   " S	 S
\R                  5      rSSS jjrg)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ImagePaletteUnidentifiedImageError)i16be)i32be)StrOrBytesPathc                  *    \ rS rSrSrSrSrSS jrSrg)	GdImageFile&   a  
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.
GDzGD uncompressed imagesc                   U R                   c   eU R                   R                  S5      n[        U5      S;  a  Sn[        U5      eSU l        [        US5      [        US5      4U l        US   nU(       a  SOSn[        US	U-   5      nUS
:  a  XPR                  S'   [        R                  " SUS	U-   S-   S	U-   S-   S-    5      U l
        [        R                  " SSU R                  -   S	U-   S-   S-   S5      /U l        g )Ni  )i  i  zNot a valid GD 2.x .gd fileP         r         transparencyRGBXi   raw)r   r   L)fpreadi16SyntaxError_mode_sizei32infor   r   paletter   _Tilesizetile)selfsmsg
true_colortrue_color_offsettindexs         A/var/www/html/env/lib/python3.13/site-packages/PIL/GdImageFile.py_openGdImageFile._open1   s   ww"""GGLLq6'/Cc""
AYAq	)
qT
!+A Q--.C<(.IIn%#''Aa++a/!6G2G!2Kg2UV

 OO"%%)G3	
	    )r   r    r#   r&   N)returnNone)	__name__
__module____qualname____firstlineno____doc__formatformat_descriptionr.   __static_attributes__ r0   r-   r   r   &   s     F1 
r0   r   c                    US:w  a  Sn[        U5      e [        U 5      $ ! [         a  nSn[        U5      UeSnAff = f)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.
rzbad modezcannot identify this image fileN)
ValueErrorr   r   r   )r   moder)   es       r-   openrA   T   sK     s{o12 1/$S)q01s   
  
=8=N)r=   )r   zStrOrBytesPath | IO[bytes]r?   strr1   r   )r7   
__future__r   typingr    r   r   r   _binaryr	   r   r
   r!   _typingr   r   rA   r;   r0   r-   <module>rH      s9   "
 #  = = ! ! #+
)%% +
\1r0   