
    Rf%              
          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 Z
d Zd ZdddddZd Zd Zd Zdddddddddd	Zd  Zd! Zd" Zd# Zd$ Zd% Zd(d'ZdS ))    )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                
   | t           vrd|  }t          |          t           |          \  }}	 t          |           dS # t          $ r Y dS t          $ r,}t          j        t          |                     Y d}~dS d}~ww xY 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exs        >/var/www/html/env/lib/python3.11/site-packages/PIL/features.pycheck_moduler"      s     g)))oo'"KFC6t   uu   c"gguuuuus   A   
B	B!A==Bc                    t          |           sdS t          |          \  }}|dS t          t          ||g          |          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   s      r!   version_moduler'   -   sP        t'"KFC
{t:fu555s;;;    c                 $    d t           D             S )z4
    :returns: A list of all supported modules.
    c                0    g | ]}t          |          |S  )r"   .0fs     r!   
<listcomp>z)get_supported_modules.<locals>.<listcomp>C   s#    222!,q//2A222r(   )r   r+   r(   r!   get_supported_modulesr0   ?   s     32w2222r(   )jpegjpeglib)jpeg2kjp2klib)zipzlib)libtiffr7   )jpgjpg_2000r6   r7   c                    | t           vrd|  }t          |          t           |          \  }}|dz   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libs       r!   check_codecrA   N   sM     f(w((ooJE3:UZ00r(   c                    t          |           sdS t          |          \  }}t          t          j        |dz             }| dk    r4|                    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_versionr7   
r   zVersion r   )rA   r<   r&   r   r>   split)r   r?   r@   versions       r!   version_codecrG   _   sv     w tJE3ej#
"233G)}}T""1%++J77::Nr(   c                 $    d t           D             S )z3
    :returns: A list of all supported codecs.
    c                0    g | ]}t          |          |S r+   )rA   r,   s     r!   r/   z(get_supported_codecs.<locals>.<listcomp>x   s#    000!Q0A000r(   )r<   r+   r(   r!   get_supported_codecsrJ   t   s     10v0000r(   )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                .   | t           vrd|  }t          |          t           |          \  }}}	 t          |dg          }t          ||          S # t          $ r Y dS t
          $ r,}t          j        t          |                     Y d}~dS d}~ww xY 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    s          r!   check_featurerg      s     h***oo )FD#$Vug>>>---   tt   c"ggttttts   !A 
B	B(!BBc                    t          |           sdS t          |          \  }}}|dS t          t          ||g          |          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$   )rg   rd   r&   r   )r   r   re   r   s       r!   version_featureri      sS     !! t )FD#
{t:fu555s;;;r(   c                 $    d t           D             S )z5
    :returns: A list of all supported features.
    c                0    g | ]}t          |          |S r+   )rg   r,   s     r!   r/   z*get_supported_features.<locals>.<listcomp>   s%    444!=#3#34A444r(   )rd   r+   r(   r!   get_supported_featuresrl      s     54x4444r(   c                    | t           v rt          |           S | t          v rt          |           S | t          v rt          |           S t          j        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"   r<   rA   rd   rg   r   r   r   s    r!   checkrq      su     'G$$$&7###(W%%%M1g111a@@@@5r(   c                    | 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'   r<   rG   rd   ri   rp   s    r!   rF   rF      sT     'g&&&&W%%%(w'''4r(   c                     t                      } |                     t                                 |                     t                                 | S )zJ
    :returns: A list of all supported modules, features, and codecs.
    )r0   extendrl   rJ   )rets    r!   get_supportedrv      sF    
  
!
!CJJ%''(((JJ#%%&&&Jr(   Tc                   | t           j        } t          j                     t	          d|            t	          dt
          j         |            t           j                                        }t	          d|d         	                                 |            |dd         D ](}t	          d|	                                 |            )t	          d|            t	          d	t          j                            t          j                   |            t	          d
t          j                            t          j        j                   |            t	          d|            dD ]\  }}t          |          r|dk    r"t!          d          rdt#          d          z   }nt          |          }|}|dv }|dk    r0t%          d |                    d          D                       dk     }|rdnd}|dk    r!dD ]}t#          |          }	|	|d| d|	 z  }t	          d|d|||            t	          d|d|            t	          d|d|            t	          d|            |rt)          j        t,                    }
t          j                                        D ] \  }}|
|                             |           !t5          t          j                  D ]}| }|t          j        v r| dt          j        |          }t	          ||            ||
v rJt	          d                    d                    t5          |
|                                       |            g }|t          j        v r|                    d            |t          j         v r|                    d!           |t          j!        v r|                    d"           |t          j"        v r|                    d#           |t          j#        v r|                    d$           t	          d%                    d                    |                    |            t	          d|            dS dS )&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--------------------------------------------------------------------)filezPillow zPython r   r   z       zPython modules loaded from zBinary modules loaded from ))r   zPIL CORE)r   TKINTER)r   	FREETYPE2)r   
LITTLECMS2)r   WEBP)r[   zWEBP Transparency)rZ   WEBPMUX)rY   zWEBP Animation)r8   JPEG)r9   zOPENJPEG (JPEG2000))r6   zZLIB (PNG/ZIP))r7   LIBTIFF)r\   zRAQM (Bidirectional Text))r`   z#LIBIMAGEQUANT (Quantization method))ra   zXCB (X protocol)r8   r_   zlibjpeg-turbo )r   r8   r   c              3  4   K   | ]}t          |          V  d S )N)int)r-   xs     r!   	<genexpr>zpilinfo.<locals>.<genexpr>   s(      *H*Ha3q66*H*H*H*H*H*Hr(   .)rn      zcompiled forloadedr\   )r]   r^   z,  z---zsupport ok,z
support okz***zsupport not installedzExtensions: {}opensavesave_alldecodeencodezFeatures: {})$sysstdoutr   initprintrc   __version__rF   
splitlinesstripospathdirname__file__r>   rq   rg   ri   tuplerE   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linerd   s                  r!   pilinfor      s    {j	JLLL	(	
%CO
%
%C0000''))J	
+JqM''))
+
+#6666 n 8 8
,
((**,,377777	(	Gbgooen&E&EGG    
Lbgooej6I&J&JLL    
( %E %Eg" ;; 	Eu}}!?!?}$'G'GGDMM}!%!7<''%**H*H1773<<*H*H*H%H%H6%QN&4BNN(6>>4 / /,Q//>a".AeWmQDDDDDeWl=====%"9DDDDD	( & ,T22
o++-- 	& 	&FCqM  %%%%!! 	& 	&A6DEJ00A00$S!!!!J$++DIIfZ]6K6K,L,LMMTW    HEJ'''EJ'''EN""
+++EN"")))EN""))).''		((;(;<<3GGGG(%%%%%;& &
	& 	&r(   )NT)
__future__r   r   r   r   r   rc    r   r   r"   r'   r0   r<   rA   rG   rJ   rd   rg   ri   rl   rq   rF   rv   r   r+   r(   r!   <module>r      s   " " " " " "     				 



  



       .48:0   0< < <$3 3 3 %%	
 
1 1 1"  *1 1 1 63;;DGSQ-
 
  0< < <"5 5 5  $     f& f& f& f& f& f&r(   