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__/features.cpython-310.pyc
o

we�%�
@s�ddlZddlZddlZddlZddlZddlmZdddddd	�Zd
d�Zdd
�Z	dd�Z
ddddd�Zdd�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._imaging�PILLOW_VERSION)zPIL._tkinter_finder�
tk_version)�PIL._imagingft�freetype2_version)zPIL._imagingcms�littlecms_version)�	PIL._webp�webpdecoder_version)�pil�tkinter�	freetype2�
littlecms2�webpc
Cs||tvr
d|��}t|��t|\}}zt|�WdSty$YdSty=}zt�t|��WYd}~dSd}~ww)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�E/home/arjun/projects/env/lib/python3.10/site-packages/PIL/features.py�check_modules
��r cCs8t|�sdSt|\}}|durdStt||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)r r�getattrr)rrrrrr�version_module+sr$cC�dd�tD�S)z4
    :returns: A list of all supported modules.
    cS�g|]}t|�r|�qSr)r ��.0�frrr�
<listcomp>A�z)get_supported_modules.<locals>.<listcomp>)rrrrr�get_supported_modules=�r,)�jpeg�jpeglib)�jpeg2k�jp2klib)�zip�zlib)�libtiffr4)�jpg�jpg_2000r3r4cCs8|tvr
d|��}t|��t|\}}|dttj�vS)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

r=cCsLt|�sdSt|\}}ttj|d�}|dkr$|�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�_versionr4�
rzVersion r)r=r8r#rr:�split)rr;r<�versionrrr�
version_codec]srBcCr%)z3
    :returns: A list of all supported codecs.
    cSr&r)r=r'rrrr*vr+z(get_supported_codecs.<locals>.<listcomp>)r8rrrr�get_supported_codecsrr-rC)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
Cs�|tvr
d|��}t|��t|\}}}z
t|dgd�}t||�WSty+YdStyD}zt�t|��WYd}~dSd}~ww)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 �PILr!N)	�featuresrrr#rrrrr)rrr�flagr�imported_modulerrrr�
check_feature�s
��r_cCs:t|�sdSt|\}}}|durdStt||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!)r_r\r#r)rrr]rrrr�version_feature�sr`cCr%)z5
    :returns: A list of all supported features.
    cSr&r)r_r'rrrr*�r+z*get_supported_features.<locals>.<listcomp>)r\rrrr�get_supported_features�r-racCsJ|tvrt|�S|tvrt|�S|tvrt|�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)rr r8r=r\r_rr�rrrr�check�srecCs4|tvrt|�S|tvrt|�S|tvrt|�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)rr$r8rBr\r`rdrrrrA�srAcCs"t�}|�t��|�t��|S)zJ
    :returns: A list of all supported modules, features, and codecs.
    )r,�extendrarC)�retrrr�
get_supported�srhTc	Cs|durtj}t��td|d�tdtj��|d�tj��}td|d�	���|d�|dd�D]
}td|�	���|d�q3td|d�td	t
j�tj
���|d�td
t
j�tjj
���|d�td|d�dD]r\}}t|�r�|dkr�td
�r�dtd
�}nt|�}|dur�|dv}|dkr�tdd�|�d�D��dk}|r�dnd}|dkr�dD]}t|�}	|	dur�|d|�d|	��7}q�td|d|||d�qltd|d|d�qltd|d|d�qltd|d�|�r�t�t�}
tj��D]\}}|
|�|�q�ttj�D]~}|�}
|tjv�r|
�dtj|��}
t|
|d�||
v�r3td �d�t|
|���|d�g}|tjv�r@|�d!�|tj v�rK|�d"�|tj!v�rV|�d#�|tj"v�ra|�d$�|tj#v�rl|�d%�td&�d�|��|d�td|d��qdSdS)'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 ))rzPIL CORE)r
�TKINTER)r�	FREETYPE2)r�
LITTLECMS2)r�WEBP)rTzWEBP Transparency)rS�WEBPMUX)rRzWEBP Animation)r5�JPEG)r6zOPENJPEG (JPEG2000))r3zZLIB (PNG/ZIP))r4�LIBTIFF)rUzRAQM (Bidirectional Text))rYz#LIBIMAGEQUANT (Quantization method))rZzXCB (X protocol)r5rXzlibjpeg-turbo )rr5rcss�|]}t|�VqdS)N)�int)r(�xrrr�	<genexpr>s�zpilinfo.<locals>.<genexpr>�.)rb�zcompiled for�loadedrU)rVrWz, � z---zsupport ok,z
support okz***zsupport not installedzExtensions: {}�open�save�save_all�decode�encodezFeatures: {})$�sys�stdoutr�init�printr[�__version__rA�
splitlines�strip�os�path�dirname�__file__r:rer_r`�tupler@�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\rrr�pilinfo�s�
���

�




�r�)NT)r�r�r}rr[�rrr r$r,r8r=rBrCr\r_r`rarerArhr�rrrr�<module>sP�	��