
     f)              
          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dd	d
dZd4dZd5dZd6dZdddddZd4dZd5dZd6dZdddd d!d"d#d$d%d&	Zd7d(Zd5d)Zd6d*Zd7d+Zd5d,Zd6d-Zd8d9d3ZdS ):    )annotationsN)IO   )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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        O/var/www/api.educacionweb.es/myenv/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>A   s#    222!,q//2A222r,   )r   r0   r,   r$   get_supported_modulesr5   =   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_codecrF   L   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   )rF   rA   r*   r   rC   split)r   rD   rE   versions       r$   version_codecrL   ]   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 r0   )rF   r1   s     r$   r4   z(get_supported_codecs.<locals>.<listcomp>v   s#    000!Q0A000r,   )rA   r0   r,   r$   get_supported_codecsrO   r   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xcbbool | Nonec                .   | 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_featurerm      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(   )rm   rj   r*   r   )r   r!   rk   r"   s       r$   version_featurero      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 r0   )rm   r1   s     r$   r4   z*get_supported_features.<locals>.<listcomp>   s%    444!=#3#34A444r,   )rj   r0   r,   r$   get_supported_featuresrr      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%   rA   rF   rj   rm   r   r   r   s    r$   checkrw      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+   rA   rL   rj   ro   rv   s    r$   rK   rK      sT     'g&&&&W%%%(w'''4r,   c                     t                      } |                     t                                 |                     t                                 | S )zJ
    :returns: A list of all supported modules, features, and codecs.
    )r5   extendrr   rO   )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`   zWEBP Transparency)r_   WEBPMUX)r^   zWEBP Animation)r=   JPEG)r>   zOPENJPEG (JPEG2000))r;   zZLIB (PNG/ZIP))r<   LIBTIFF)ra   zRAQM (Bidirectional Text))re   z#LIBIMAGEQUANT (Quantization method))rf   zXCB (X protocol)r=   rd   zlibjpeg-turbo )r   r=   r   c              3  4   K   | ]}t          |          V  d S )N)int)r2   xs     r$   	<genexpr>zpilinfo.<locals>.<genexpr>)  s(      *H*Ha3q66*H*H*H*H*H*Hr,   .)rt      zcompiled forloadedra   )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printri   __version__rK   
splitlinesstrip
executableprefixbase_prefixospathdirname__file__rC   rw   ro   tuplerJ   collectionsdefaultdictlist	EXTENSIONitemsappendsortedIDMIMEformatjoinOPENSAVESAVE_ALLDECODERSENCODERS)r}   r   py_version_lines
py_versionnamer   vrZ   version_statictr3   v2
extensionsextilinerj   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   rg   )NT)r}   r~   r   r   r   r   )
__future__r   r   r   r   r   typingr   ri    r   r   r%   r+   r5   rA   rF   rL   rO   rj   rm   ro   rr   rw   rK   r|   r   r0   r,   r$   <module>r      s   " " " " " "     				 



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



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