1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
U
T±d
ã@sPdZddlmZmZmZddlmZddlmZ    Gdd„dejƒZ
d dd    „Z d
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.
    ZGDzGD uncompressed imagescCsÄ|j d¡}t|ƒdkr$d}t|ƒ‚d|_t|dƒt|dƒf|_|d}|rPdnd}t|d    |ƒ}|d
krt||jd <t     d |d    |dd    |dd …¡|_
dd|j d    |dd dfg|_ dS)Ni )iþÿiÿÿzNot a valid GD 2.x .gd fileÚLééééééZ transparencyZXBGRiÚraw)r r )rr r) ÚfpÚreadÚi16Ú SyntaxErrorÚmodeÚ_sizeÚi32ÚinforrZpaletteÚsizeZtile)ÚselfÚsÚmsgZ
true_colorZtrue_color_offsetZtindex©rúFd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PIL/GdImageFile.pyÚ_open.s*   
ÿüÿzGdImageFile._openN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚformatÚformat_descriptionrrrrrr#srÚrc
CsT|dkrd}t|ƒ‚z
t|ƒWStk
rN}zd}t|ƒ|‚W5d}~XYnXdS)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)rrrÚerrrÚopenOs
 
r(N)r%) r"ÚrrrÚ_binaryrrrrrr(rrrrÚ<module>s
   ,