AlkantarClanX12

Your IP : 3.144.114.8


Current Path : /opt/alt/python310/lib64/python3.10/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/__pycache__/imghdr.cpython-310.opt-1.pyc

o

6��f��@s4dZddlmZdgZd%dd�ZgZdd�Ze�e�dd	�Ze�e�d
d�Z	e�e	�dd
�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�d d!�Zd"d#�Zed$kr�e�dSdS)&z<Recognize image file formats based on their first few bytes.�)�PathLike�whatNcCs�d}zE|dur't|ttf�rt|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|r>|W|r=|��SSq)W|rF|��dS|rO|��ww)N�rb� )	�
isinstance�strr�open�read�tell�seek�tests�close)�file�h�f�locationZtf�res�r�-/opt/alt/python310/lib64/python3.10/imghdr.pyrs&



���cCs|dd�dvr
dSdS)z JPEG data in JFIF or Exif format��
)sJFIFsExifZjpegNr�rrrrr�	test_jpeg%��rcC�|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,�
�rcC�|dd�dvr
dSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2rr cCr)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffrrrrr�	test_tiff9rr"cC�|�d�rdSdS)zSGI image librarys�ZrgbNrrrrr�test_rgb@�
�r$cC�Ht|�dkr|dtd�kr|ddvr |ddvr"dSd	Sd	Sd	Sd	S)
zPBM (portable bitmap)�r�P�s14r!� 	

ZpbmN��len�ordrrrr�test_pbmG�
(�r.cCr&)
zPGM (portable graymap)r'rr(r)s25r!r*ZpgmNr+rrrr�test_pgmOr/r0cCr&)
zPPM (portable pixmap)r'rr(r)s36r!r*ZppmNr+rrrr�test_ppmWr/r1cCr#)zSun raster filesY�j�ZrastNrrrrr�	test_rast_r%r2cCr#)zX bitmap (X10 or X11)s#define ZxbmNrrrrr�test_xbmfr%r3cCr)NsBMZbmprrrrr�test_bmpmrr4cCs&|�d�r|dd�dkrdSdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpss�r7cCr)Nsv/1Zexrrrrrr�test_exryrr8cCs�ddl}d}|jdd�r|jddkr|jdd�=d}z|jdd�r2t|jdd�|d�WdStdg|d�WdStyP|j�d�|�d�YdSw)Nrr)z-rr!�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r:�	recursiverrr�test�s�rBc	Cs�ddl}ddl}|D]W}|j�|�r?t|ddd�|s|r:td�ddl}|�|j�|�|�d��}t||d�q
td�q
t|ddd�|j	�
�ztt|��Wq
tyatd	�Yq
wdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r:�os�path�isdir�print�glob�join�escaper<�stdout�flushr�OSError)�listrAZtoplevelr:rG�filenamerK�namesrrrr<�s&

��r<�__main__)N)�__doc__rGr�__all__rrr�appendrr r"r$r.r0r1r2r3r4r7r8rBr<�__name__rrrr�<module>sH














�