o
    ÒèFh°'  ã                
   @  sä   d dl mZ d dlZd dlZd dlZd dlZd dlZddlmZ ddddd	d
œZ	dd„ Z
dd„ Zdd„ ZdddddœZdd„ Zdd„ Zdd„ Zddddd d!d"d#d$d%œ	Zd&d'„ Zd(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Zd0d1„ Zd5d3d4„ZdS )6é    )ÚannotationsNé   )ÚImage)úPIL._imagingÚPILLOW_VERSION)zPIL._tkinter_finderÚ
tk_version)úPIL._imagingftÚfreetype2_version)zPIL._imagingcmsÚlittlecms_version)ú	PIL._webpÚwebpdecoder_version)ÚpilÚtkinterÚ	freetype2Ú
littlecms2Úwebpc              
   C  s|   | t vrd| › �}t|ƒ‚t |  \}}zt|ƒ W dS  ty$   Y dS  ty= } zt t|ƒ¡ W Y d}~dS d}~ww )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.
    zUnknown module TFN)ÚmodulesÚ
ValueErrorÚ
__import__ÚModuleNotFoundErrorÚImportErrorÚwarningsÚwarnÚstr)ÚfeatureÚmsgÚmoduleÚverÚex© r   úE/var/www/html/loop/nvenv/lib/python3.10/site-packages/PIL/features.pyÚcheck_module   s   
€þr!   c                 C  s8   t | ƒsdS t|  \}}|du rdS tt||gd�|ƒ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)r!   r   Úgetattrr   )r   r   r   r   r   r    Úversion_module-   s   r%   c                   C  ó   dd„ t D ƒS )z4
    :returns: A list of all supported modules.
    c                 S  ó   g | ]}t |ƒr|‘qS r   )r!   ©Ú.0Úfr   r   r    Ú
<listcomp>C   ó    z)get_supported_modules.<locals>.<listcomp>)r   r   r   r   r    Úget_supported_modules?   ó   r-   )ÚjpegÚjpeglib)Újpeg2kÚjp2klib)ÚzipÚzlib)Úlibtiffr5   )ÚjpgÚjpg_2000r4   r5   c                 C  s8   | t vrd| › �}t|ƒ‚t |  \}}|d ttjƒv S )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.
    zUnknown codec Ú_encoder)Úcodecsr   Údirr   Úcore)r   r   ÚcodecÚlibr   r   r    Úcheck_codecN   s
   
r>   c                 C  sL   t | ƒsdS t|  \}}ttj|d ƒ}| dkr$| d¡d  d¡d S |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Ú_versionr5   Ú
r   zVersion r   )r>   r9   r$   r   r;   Úsplit)r   r<   r=   Úversionr   r   r    Úversion_codec_   s   rC   c                   C  r&   )z3
    :returns: A list of all supported codecs.
    c                 S  r'   r   )r>   r(   r   r   r    r+   x   r,   z(get_supported_codecs.<locals>.<listcomp>)r9   r   r   r   r    Úget_supported_codecst   r.   rD   )r   ÚHAVE_WEBPANIMN)r   ÚHAVE_WEBPMUXN)r   ÚHAVE_TRANSPARENCYN)r   Ú	HAVE_RAQMÚraqm_version)r   ÚHAVE_FRIBIDIÚfribidi_version)r   ÚHAVE_HARFBUZZÚharfbuzz_version)r   ÚHAVE_LIBJPEGTURBOÚlibjpeg_turbo_version)r   ÚHAVE_LIBIMAGEQUANTÚimagequant_version)r   ÚHAVE_XCBN)	Ú	webp_animÚwebp_muxÚtransp_webpÚraqmÚfribidiÚharfbuzzÚlibjpeg_turboÚlibimagequantÚxcbc              
   C  sŠ   | t vrd| › �}t|ƒ‚t |  \}}}zt|dgd�}t||ƒW S  ty+   Y dS  tyD } zt t|ƒ¡ W Y d}~dS d}~ww )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.
    zUnknown feature ÚPILr"   N)	Úfeaturesr   r   r$   r   r   r   r   r   )r   r   r   Úflagr   Úimported_moduler   r   r   r    Úcheck_featureˆ   s   
€þr`   c                 C  s:   t | ƒsdS t|  \}}}|du rdS tt||gd�|ƒ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"   )r`   r]   r$   r   )r   r   r^   r   r   r   r    Úversion_feature    s   ra   c                   C  r&   )z5
    :returns: A list of all supported features.
    c                 S  r'   r   )r`   r(   r   r   r    r+   µ   r,   z*get_supported_features.<locals>.<listcomp>)r]   r   r   r   r    Úget_supported_features±   r.   rb   c                 C  sJ   | t v rt| ƒS | tv rt| ƒS | tv rt| ƒS tjd| › d�dd� dS )z²
    :param feature: A module, codec, or feature name.
    :returns:
        ``True`` if the module, codec, or feature is available,
        ``False`` or ``None`` otherwise.
    zUnknown feature 'z'.é   )Ú
stacklevelF)r   r!   r9   r>   r]   r`   r   r   ©r   r   r   r    Úcheck¸   s   rf   c                 C  s4   | t v rt| ƒS | tv rt| ƒS | tv rt| ƒS dS )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   r%   r9   rC   r]   ra   re   r   r   r    rB   Ê   s   rB   c                  C  s"   t ƒ } |  tƒ ¡ |  tƒ ¡ | S )zJ
    :returns: A list of all supported modules, features, and codecs.
    )r-   Úextendrb   rD   )Úretr   r   r    Úget_supportedÚ   s   ri   Tc              	   C  sd  | du rt j} t ¡  td| d� tdtj› �| d� t j ¡ }td|d  	¡ › �| d� |dd… D ]}td| 	¡ › �| d� q3td| d� td	t j
pMd
› �| d� t jt jkrctdt j› �| d� tdt j› �| d� td| d� tdtj tj¡› �| d� tdtj tjj¡› �| d� td| d� dD ]s\}}t|ƒ�r|dkr°tdƒr°dtdƒ }nt|ƒ}|durú|dv }|dkrÎtdd„ | d¡D ƒƒdk }|rÒdnd}|dkrïdD ]}t|ƒ}	|	durî|d|› d|	› �7 }qÚtd|d ||| d� q˜td|d!| d� q˜td"|d#| d� q˜td| d� |�r®t t¡}
tj ¡ D ]\}}|
|  |¡ �qttjƒD ]~}|› }|tjv �rF|› dtj| › �}t|| d� ||
v �ratd$  d !t|
| ƒ¡¡| d� g }|tj"v �rn| d%¡ |tj#v �ry| d&¡ |tj$v �r„| d'¡ |tj%v �r�| d(¡ |tj&v �rš| d)¡ td*  d !|¡¡| d� td| d� �q1dS dS )+a  
    Prints information about this installation of Pillow.
    This function can be called with ``python3 -m PIL``.
    It can also be called with ``python3 -m PIL.report`` or ``python3 -m PIL --report``
    to have "supported_formats" set to ``False``, omitting the list of all supported
    image file formats.

    :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--------------------------------------------------------------------)ÚfilezPillow zPython r   r   z       zPython executable is Úunknownz%Environment Python files loaded from z System Python files loaded from z"Python Pillow modules loaded from z"Binary Pillow modules loaded from ))r   zPIL CORE)r   ÚTKINTER)r   Ú	FREETYPE2)r   Ú
LITTLECMS2)r   ÚWEBP)rU   zWEBP Transparency)rT   ÚWEBPMUX)rS   zWEBP Animation)r6   ÚJPEG)r7   zOPENJPEG (JPEG2000))r4   zZLIB (PNG/ZIP))r5   ÚLIBTIFF)rV   zRAQM (Bidirectional Text))rZ   z#LIBIMAGEQUANT (Quantization method))r[   zXCB (X protocol)r6   rY   zlibjpeg-turbo )r   r6   r   c                 s  s   � | ]}t |ƒV  qd S )N)Úint)r)   Úxr   r   r    Ú	<genexpr>(  s   € zpilinfo.<locals>.<genexpr>Ú.)rc   é   zcompiled forÚloadedrV   )rW   rX   z, ú z---zsupport ok,z
support okz***zsupport not installedzExtensions: {}ÚopenÚsaveÚsave_allÚdecodeÚencodezFeatures: {})'ÚsysÚstdoutr   ÚinitÚprintr\   Ú__version__rB   Ú
splitlinesÚstripÚ
executableÚprefixÚbase_prefixÚosÚpathÚdirnameÚ__file__r;   rf   r`   ra   ÚtuplerA   ÚcollectionsÚdefaultdictÚlistÚ	EXTENSIONÚitemsÚappendÚsortedÚIDÚMIMEÚformatÚjoinÚOPENÚSAVEÚSAVE_ALLÚDECODERSÚENCODERS)ÚoutÚsupported_formatsÚ
py_versionÚnamer   ÚvÚversion_staticÚtr*   Úv2Ú
extensionsÚextÚiÚliner]   r   r   r    Úpilinfoå   s�   
þþ
€

ÿ




ãrª   )NT)Ú
__future__r   rŽ   r‰   r   r   r\   Ú r   r   r!   r%   r-   r9   r>   rC   rD   r]   r`   ra   rb   rf   rB   ri   rª   r   r   r   r    Ú<module>   sR    û	ü÷