zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
U
T±dÝ&ã
@sØddlZddlZddlZddlZddlZddlmZdddddd    œZd
d „Zd d „Z    dd„Z
dddddœZ dd„Z dd„Z dd„Zdddddd d!d"d#d$œ    Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd4d2d3„ZdS)5éNé)ÚImage)ú PIL._imagingZPILLOW_VERSION)zPIL._tkinter_finderZ
tk_version)úPIL._imagingftZfreetype2_version)zPIL._imagingcmsZlittlecms_version)ú    PIL._webpZwebpdecoder_version)ÚpilÚtkinterÚ    freetype2Ú
littlecms2Úwebpc
Cs„|tkrd|›}t|ƒ‚t|\}}zt|ƒWdStk
rJYdStk
r~}zt t|ƒ¡WY¢dSd}~XYnXdS)zâ
    Checks if a module is available.
 
    :param feature: The module to check for.
    :returns: ``True`` if available, ``False`` otherwise.
    :raises ValueError: If the module is not defined in this version of Pillow.
    zUnknown module TFN)ÚmodulesÚ
ValueErrorÚ
__import__ÚModuleNotFoundErrorÚ ImportErrorÚwarningsÚwarnÚstr)ÚfeatureÚmsgÚmoduleÚverÚex©rúCd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PIL/features.pyÚ check_modules
 rcCs8t|ƒs dSt|\}}|dkr$dStt||gd|ƒS)zè
    :param feature: The module to check for.
    :returns:
        The loaded version number as a string, or ``None`` if unknown or not available.
    :raises ValueError: If the module is not defined in this version of Pillow.
    N©Úfromlist)rr Úgetattrr)rrrrrrÚversion_module+s  rcCsdd„tDƒS)z4
    :returns: A list of all supported modules.
    cSsg|]}t|ƒr|‘qSr)r©Ú.0ÚfrrrÚ
<listcomp>Asz)get_supported_modules.<locals>.<listcomp>)r rrrrÚget_supported_modules=sr$)ZjpegZjpeglib)Zjpeg2kZjp2klib)ÚzipÚzlib)Úlibtiffr')ÚjpgÚjpg_2000r&r'cCs8|tkrd|›}t|ƒ‚t|\}}|dttjƒkS)zß
    Checks if a codec is available.
 
    :param feature: The codec to check for.
    :returns: ``True`` if available, ``False`` otherwise.
    :raises ValueError: If the codec is not defined in this version of Pillow.
    zUnknown codec Ú_encoder)Úcodecsr ÚdirrÚcore)rrÚcodecÚlibrrrÚ check_codecLs
 
 r0cCsLt|ƒs dSt|\}}ttj|dƒ}|dkrH| d¡d d¡dS|S)a
    :param feature: The codec to check for.
    :returns:
        The version number as a string, or ``None`` if not available.
        Checked at compile time for ``jpg``, run-time otherwise.
    :raises ValueError: If the codec is not defined in this version of Pillow.
    NÚ_versionr'Ú
rzVersion r)r0r+rrr-Úsplit)rr.r/ÚversionrrrÚ version_codec]s r5cCsdd„tDƒS)z3
    :returns: A list of all supported codecs.
    cSsg|]}t|ƒr|‘qSr)r0r rrrr#vsz(get_supported_codecs.<locals>.<listcomp>)r+rrrrÚget_supported_codecsrsr6)rZ HAVE_WEBPANIMN)rZ HAVE_WEBPMUXN)rZHAVE_TRANSPARENCYN)rZ    HAVE_RAQMZ raqm_version)rZ HAVE_FRIBIDIZfribidi_version)rZ HAVE_HARFBUZZZharfbuzz_version)rZHAVE_LIBJPEGTURBOZlibjpeg_turbo_version)rZHAVE_LIBIMAGEQUANTZimagequant_version)rZHAVE_XCBN)    Ú    webp_animÚwebp_muxÚ transp_webpÚraqmÚfribidiÚharfbuzzÚ libjpeg_turboÚ libimagequantÚxcbc
Cs’|tkrd|›}t|ƒ‚t|\}}}zt|dgd}t||ƒWStk
rXYdStk
rŒ}zt t|ƒ¡WY¢dSd}~XYnXdS)zÿ
    Checks if a feature is available.
 
    :param feature: The feature to check for.
    :returns: ``True`` if available, ``False`` if unavailable, ``None`` if unknown.
    :raises ValueError: If the feature is not defined in this version of Pillow.
    zUnknown feature ÚPILrN)    Úfeaturesr rrrrrrr)rrrÚflagrZimported_modulerrrrÚ check_feature†s
 rCcCs:t|ƒs dSt|\}}}|dkr&dStt||gd|ƒS)zÐ
    :param feature: The feature to check for.
    :returns: The version number as a string, or ``None`` if not available.
    :raises ValueError: If the feature is not defined in this version of Pillow.
    Nr)rCrArr)rrrBrrrrÚversion_featurežs rDcCsdd„tDƒS)z5
    :returns: A list of all supported features.
    cSsg|]}t|ƒr|‘qSr)rCr rrrr#³sz*get_supported_features.<locals>.<listcomp>)rArrrrÚget_supported_features¯srEcCsJ|tkrt|ƒS|tkr t|ƒS|tkr0t|ƒStjd|›ddddS)z²
    :param feature: A module, codec, or feature name.
    :returns:
        ``True`` if the module, codec, or feature is available,
        ``False`` or ``None`` otherwise.
    zUnknown feature 'z'.é)Ú
stacklevelF)r rr+r0rArCrr©rrrrÚcheck¶srIcCs4|tkrt|ƒS|tkr t|ƒS|tkr0t|ƒSdS)z¬
    :param feature:
        The module, codec, or feature to check for.
    :returns:
        The version number as a string, or ``None`` if unknown or not available.
    N)r rr+r5rArDrHrrrr4Èsr4cCs"tƒ}| tƒ¡| tƒ¡|S)zJ
    :returns: A list of all supported modules, features, and codecs.
    )r$ÚextendrEr6)ÚretrrrÚ get_supportedØs  rLTc    Cs|dkrtj}t ¡td|dtdtj›|dtj ¡}td|d     ¡›|d|dd…D]}td|     ¡›|dqftd|dtd    t
j   tj ¡›|dtd
t
j   tjj ¡›|dtd|dd D]ö\}}t|ƒr¾|d kr td ƒr dtd ƒ}nt|ƒ}|dk    r¬|dk}|dkrLtdd„| d¡Dƒƒdk}|rVdnd}|dkr–dD],}t|ƒ}    |    dk    rh|d|›d|    ›7}qhtd|d|||dntd|d|dqØtd|d|dqØtd|d|rt t¡}
tj ¡D]\} } |
|  | ¡qöttjƒD]ø} | ›} | tjkrD| ›dtj| ›} t| |d| |
krztd  d t|
| ƒ¡¡|dg}| tjkr”| d!¡| tj krª| d"¡| tj!krÀ| d#¡| tj"krÖ| d$¡| tj#krì| d%¡td& d |¡¡|dtd|dqdS)'aG
    Prints information about this installation of Pillow.
    This function can be called with ``python3 -m PIL``.
 
    :param out:
        The output stream to print to. Defaults to ``sys.stdout`` if ``None``.
    :param supported_formats:
        If ``True``, a list of all supported image file formats will be printed.
    NzD--------------------------------------------------------------------)ÚfilezPillow zPython rrz       zPython modules loaded from zBinary modules loaded from ))rzPIL CORE)rZTKINTER)r    Z    FREETYPE2)r
Z
LITTLECMS2)r ZWEBP)r9zWEBP Transparency)r8ZWEBPMUX)r7zWEBP Animation)r(ZJPEG)r)zOPENJPEG (JPEG2000))r&zZLIB (PNG/ZIP))r'ZLIBTIFF)r:zRAQM (Bidirectional Text))r>z#LIBIMAGEQUANT (Quantization method))r?zXCB (X protocol)r(r=zlibjpeg-turbo )rr(r
css|]}t|ƒVqdS)N)Úint)r!ÚxrrrÚ    <genexpr>szpilinfo.<locals>.<genexpr>Ú.)rFéz compiled forZloadedr:)r;r<z, ú z---z support ok,z
support okz***zsupport not installedzExtensions: {}ÚopenÚsaveZsave_allÚdecodeÚencodez Features: {})$ÚsysÚstdoutrÚinitÚprintr@Ú __version__r4Ú
splitlinesÚstripÚosÚpathÚdirnameÚ__file__r-rIrCrDÚtupler3Ú collectionsÚ defaultdictÚlistZ    EXTENSIONÚitemsÚappendÚsortedZIDZMIMEÚformatÚjoinZOPENZSAVEZSAVE_ALLZDECODERSZENCODERS)ÚoutZsupported_formatsÚ
py_versionÚnamerÚvZversion_staticÚtr"Zv2Ú
extensionsÚextÚiÚlinerArrrÚpilinfoãs‚  
 þþ  
 
 
 
 
 
 
ÿ 
 
 
 
 
ru)NT)rdr_rXrr@Úrr rrr$r+r0r5r6rArCrDrErIr4rLrurrrrÚ<module>sN û    ü÷