AlkantarClanX12

Your IP : 3.144.255.116


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/imghdr.cpython-37.opt-1.pyc

B

� f��@s2dZddlmZdgZd%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$k�r.e�dS)&z<Recognize image file formats based on their first few bytes.�)�PathLike�whatNcCs�d}zl|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�xtD]}|||�}|rT|SqTWWd|r~|��XdS)N�rb� )	�
isinstance�strr�open�read�tell�seek�tests�close)�file�h�f�locationZtfZres�r�+/opt/alt/python37/lib64/python3.7/imghdr.pyrs 




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

Zpng)�
startswith)rrrrr�test_png,s
rcCs|dd�dkrdSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifr)rrrrr�test_gif2srcCs|dd�dkrdSdS)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffr)rrrrr�	test_tiff9srcCs|�d�rdSdS)zSGI image librarys�ZrgbN)r)rrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPBM (portable bitmap)�r�P�s14rs 	

ZpbmN)�len�ord)rrrrr�test_pbmGs(r"cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPGM (portable graymap)rrrrs25rs 	

ZpgmN)r r!)rrrrr�test_pgmOs(r#cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPPM (portable pixmap)rrrrs36rs 	

ZppmN)r r!)rrrrr�test_ppmWs(r$cCs|�d�rdSdS)zSun raster filesY�j�ZrastN)r)rrrrr�	test_rast_s
r%cCs|�d�rdSdS)zX bitmap (X10 or X11)s#define ZxbmN)r)rrrrr�test_xbmfs
r&cCs|�d�rdSdS)NsBMZbmp)r)rrrrr�test_bmpms
r'cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebp)r)rrrrr�	test_webpssr*cCs|�d�rdSdS)Nsv/1Zexr)r)rrrrr�test_exrys
r+cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}y8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrrz-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r-�	recursiverrr�test�sr5c	Cs�ddl}ddl}x�|D]�}|j�|�rzt|ddd�|s>|rptd�ddl}|�|j�|d��}t||d�q�td�qt|ddd�|j�	�ytt
|��Wqtk
r�td	�YqXqWdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)r-�os�path�isdir�print�glob�joinr/�stdout�flushr�OSError)�listr4Ztoplevelr-r:�filenamer>�namesrrrr/�s"


r/�__main__)N)�__doc__r:r�__all__rrr�appendrrrrr"r#r$r%r&r'r*r+r5r/�__name__rrrr�<module>sD