
    zvg+                       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d6dZd7dZd8dZdddddZd6dZd7dZd8dZddddd d!d"d#d$d%d&
Zd'ed(<   d9d*Zd7d+Zd8d,Zd9d-Zd7d.Zd8d/Zd:d;d5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        I/var/www/pixelcanvas.ch/venv/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_ZLIBNGzlib_ng_version)r   HAVE_LIBIMAGEQUANTimagequant_version)r   HAVE_XCBN)
	webp_animwebp_muxtransp_webpraqmfribidiharfbuzzlibjpeg_turbozlib_ng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)rh   r   
isinstancer   r   r   r+   r   r   r   r    r   )r   r!   r"   flagr#   imported_moduler$   s          r%   check_featurerp      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)   )rp   rh   r+   r   )r   r"   rn   r#   s       r%   version_featurerr      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)rh   itemsr   r&   appendrp   )supported_featuresr4   r"   rn   _r   feature_modules          r%   get_supported_featuresry      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   rh   rp   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   rh   rr   r}   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   extendry   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t'          d          }
|
|d|
z   z  }n'|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)ra   zRAQM (Bidirectional Text))rf   z#LIBIMAGEQUANT (Quantization method))rg   zXCB (X protocol)r>   rd   zlibjpeg-turbo )r   r>   r   c              3  4   K   | ]}t          |          V  d S )N)int)r3   xs     r%   	<genexpr>zpilinfo.<locals>.<genexpr>6  s(      *H*Ha3q66*H*H*H*H*H*Hr-   .)r{      zcompiled forloadedr<   re   z, compiled for zlib-ng ra   )rb   rc   z,  z---zsupport ok,z
support okz***zsupport not installedzExtensions: {}opensavesave_alldecodeencodezFeatures: {})&sysstdoutr   initprintrl   __version__rL   
splitlinesstrip
executableprefixbase_prefixospathdirname__file__rD   r~   rr   tuplerK   collectionsdefaultdictlist	EXTENSIONrt   ru   sortedIDMIMEformatjoinOPENSAVESAVE_ALLDECODERSENCODERS)r   r   py_version_lines
py_versionnamer   vrX   version_statictrZ   r4   v2
extensionsextilinerh   s                     r%   pilinfor      sa    {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>>&5i&@&@O&26HHV^^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   ri   )NT)r   r   r   r   r   r   )
__future__r   r   r   r   r   typingr   rl    r   
_deprecater   r   r&   r,   r6   rB   rG   rM   rP   rh   __annotations__rp   rr   ry   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AQ-; ;       8< < < <"   "   $       r& r& r& r& r& r& r&r-   