
    g*              
      
   U d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlZddl	m
Z
 ddlmZ ddd	d
ddZd5dZd6dZd7dZdddddZd5dZd6dZd7dZddddd d!d"d#d$d%	Zd&ed'<   d8d)Zd6d*Zd7d+Zd8d,Zd6d-Zd7d.Zd9d:d4ZdS );    )annotationsN)IO   )Image)	deprecate)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webpfeaturestrreturnboolc                
   | 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warnr   )r   msgmoduleverexs        H/var/www/html/ai-engine/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
str | Nonec                    t          |           sdS t          |          \  }}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,   /   sF        t'"KFC:fu555s;;;    	list[str]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>B   s#    222!,q//2A222r-   )r   r1   r-   r%   get_supported_modulesr6   >   s     32w2222r-   )jpegjpeglib)jpeg2kjp2klib)zipzlib)libtiffr=   )jpgjpg_2000r<   r=   c                    | 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libs       r%   check_codecrG   M   sQ     f(w((ooJE3UZ00r-   c                    t          |           sdS t          |          \  }}t          t          j        | d          }| 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_versionr=   
r   zVersion r   )rG   rB   r+   r   rD   split)r   rE   rF   versions       r%   version_codecrM   ^   sz     w tJE3ejS"2"2"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 r1   )rG   r2   s     r%   r5   z(get_supported_codecs.<locals>.<listcomp>w   s#    000!Q0A000r-   )rB   r1   r-   r%   get_supported_codecsrP   s   s     10v0000r-   )r   TN)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xcbz-dict[str, tuple[str, str | bool, str | None]]featuresbool | Nonec                   | t           vrd|  }t          |          t           |          \  }}}t          |t                    rt	          d|  dd           	 t          |dg          }t          |t                    r|S 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 zcheck_feature("z")   PILr)   N)re   r   
isinstancer   r   r   r+   r   r   r   r    r   )r   r!   r"   flagr#   imported_moduler$   s          r%   check_featurerm      s    h***oo )FD#$ 5/G///444	$Vug>>>dD!! 	K---   tt   c"ggttttts$   (B B 
C	C(!CC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)   )rm   re   r+   r   )r   r"   rk   r#   s       r%   version_featurero      sS     !! t )FD#
{t:fu555s;;;r-   c                 >   g } t                                           D ]\  }\  }}}|du rOt                                          D ]4\  }\  }}||k    r&t          |          r|                     |            n5\t          |          r|                     |           | S )z5
    :returns: A list of all supported features.
    T)re   itemsr   r&   appendrm   )supported_featuresr4   r"   rk   _r   feature_modules          r%   get_supported_featuresrv      s      ( 0 0 ) )FD!4<<07  ,,.!!V++#G,, 5*11!444E , 1 	)%%a(((r-   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&   rB   rG   re   rm   r   r    r   s    r%   checkr{      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,   rB   rM   re   ro   rz   s    r%   rL   rL      sT     'g&&&&W%%%(w'''4r-   c                     t                      } |                     t                                 |                     t                                 | S )zJ
    :returns: A list of all supported modules, features, and codecs.
    )r6   extendrv   rP   )rets    r%   get_supportedr      sF    
  
!
!CJJ%''(((JJ#%%&&&Jr-   ToutIO[str] | Nonesupported_formatsNonec                	   | 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
        pd
 |            t           j        t           j        k    rt	          dt           j         |            t	          dt           j         |            t	          d|            t	          dt          j                            t          j                   |            t	          dt          j                            t          j        j                   |            t	          d|            dD ]\  }}t%          |          rd}|dk    rt'          d          }|d|z   }|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        t0                    }t          j                                        D ] \  }}||                             |           !t9          t          j                  D ]}| }|t          j        v r| dt          j        |          }t	          ||            ||v rJt	          d#                    d                     t9          ||                                       |            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 )*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)r>   JPEG)r?   zOPENJPEG (JPEG2000))r<   zZLIB (PNG/ZIP))r=   LIBTIFF)r_   zRAQM (Bidirectional Text))rc   z#LIBIMAGEQUANT (Quantization method))rd   zXCB (X protocol)r>   rb   zlibjpeg-turbo )r   r>   r   c              3  4   K   | ]}t          |          V  d S )N)int)r3   xs     r%   	<genexpr>zpilinfo.<locals>.<genexpr>5  s(      *H*Ha3q66*H*H*H*H*H*Hr-   .)rx      zcompiled forloadedr_   )r`   ra   z,  z---zsupport ok,z
support okz***zsupport not installedzExtensions: {}opensavesave_alldecodeencodezFeatures: {})&sysstdoutr   initprintri   __version__rL   
splitlinesstrip
executableprefixbase_prefixospathdirname__file__rD   r{   ro   tuplerK   collectionsdefaultdictlist	EXTENSIONrq   rr   sortedIDMIMEformatjoinOPENSAVESAVE_ALLDECODERSENCODERS)r   r   py_version_lines
py_versionnamer   vrX   version_statictr4   v2
extensionsextilinere   s                    r%   pilinfor      s4    {j	JLLL	(	
%CO
%
%C0000{--//	
1$Q'--//
1
1<<<<&qrr* 8 8
,
((**,,377777	(	
?#."=I
?
?cJJJJ
zS_$$BcjBBMMMM	
>S_
>
>SIIII	(	NRW__U^-L-LNN    
SRW__UZ=P-Q-QSS    
( %E %Eg ;; 	E Au}}(7(H(H%(4(+@@Ay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-   )r   r   r   r   )r   r   r   r'   )r   r.   )r   r   r   rf   )NT)r   r   r   r   r   r   )
__future__r   r   r   r   r   typingr   ri    r   
_deprecater   r   r&   r,   r6   rB   rG   rM   rP   re   __annotations__rm   ro   rv   r{   rL   r   r   r1   r-   r%   <module>r      s   " " " " " " "     				 



        



       ! ! ! ! ! ! .48:0    0< < < <3 3 3 3 %%	
 
1 1 1 1"   *1 1 1 1 +),;DGSQ-
; 
; 
 
 
 
   8< < < <"   "   $       n& n& n& n& n& n& n&r-   