Your IP : 3.137.177.204


Current Path : /opt/alt/python35/lib64/python3.5/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/__pycache__/imghdr.cpython-35.pyc



��Yf��@s�dZdgZddd�ZgZdd�Zeje�dd�Zeje�dd	�Zeje�d
d�Zeje�dd
�Z	eje	�dd�Z
eje
�dd�Zeje�dd�Zeje�dd�Z
eje
�dd�Zeje�dd�Zeje�dd�Zeje�dd�Zeje�dd�Zd d!�Zed"kr�e�dS)#z<Recognize image file formats based on their first few bytes.�whatNc
Cs�d}z�|dkrmt|t�rEt|d�}|jd�}n(|j�}|jd�}|j|�x'tD]}|||�}|rt|SqtWWd|r�|j�XdS)N�rb� )�
isinstance�str�open�read�tell�seek�tests�close)�file�h�f�locationZtf�res�r�+/opt/alt/python35/lib64/python3.5/imghdr.pyr	s 

cCs|dd�dkrdSdS)z JPEG data in JFIF or Exif format��
�JFIF�ExifZjpegN)rrr)r
rrrr�	test_jpeg#srcCs|jd�rdSdS)Ns�PNG

Zpng)�
startswith)r
rrrr�test_png*srcCs|dd�dkrdSdS)zGIF ('87 and '89 variants)Nr�GIF87a�GIF89aZgif)rrr)r
rrrr�test_gif0srcCs|dd�dkrdSdS)z-TIFF (can be in Motorola or Intel byte order)N��MM�IIZtiff)rrr)r
rrrr�	test_tiff7sr cCs|jd�rdSdS)zSGI image librarys�ZrgbN)r)r
rrrr�test_rgb>sr!cCsPt|�dkrL|dtd�krL|ddkrL|ddkrLdSd	S)
zPBM (portable bitmap)���P�s14rs 	

ZpbmN)�len�ord)r
rrrr�test_pbmEs6r(cCsPt|�dkrL|dtd�krL|ddkrL|ddkrLdSd	S)
zPGM (portable graymap)r"r#r$r%s25rs 	

ZpgmN)r&r')r
rrrr�test_pgmMs6r)cCsPt|�dkrL|dtd�krL|ddkrL|ddkrLdSd	S)
zPPM (portable pixmap)r"r#r$r%s36rs 	

ZppmN)r&r')r
rrrr�test_ppmUs6r*cCs|jd�rdSdS)zSun raster filesY�j�ZrastN)r)r
rrrr�	test_rast]sr+cCs|jd�rdSdS)zX bitmap (X10 or X11)s#define ZxbmN)r)r
rrrr�test_xbmdsr,cCs|jd�rdSdS)NsBMZbmp)r)r
rrrr�test_bmpksr-cCs-|jd�r)|dd�dkr)dSdS)NsRIFF��sWEBPZwebp)r)r
rrrr�	test_webpqs%r0cCs|jd�rdSdS)Nsv/1Zexr)r)r
rrrr�test_exrwsr1cCs�ddl}d}|jdd�rN|jddkrN|jdd�=d}yJ|jdd�r�t|jdd�|d�ntdg|d�Wn/tk
r�|jjd�|jd�YnXdS)Nr#r%z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r3�	recursiverrr�test�s& 
r;cCsddl}ddl}x�|D]�}|jj|�r�t|ddd�|sW|r�td�ddl}|j|jj|d��}t||d�q�td�qt|ddd�|jj	�ytt
|��Wqtk
r�td	�YqXqWdS)
Nr#z/:�end� zrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)r3�os�path�isdir�print�glob�joinr5�stdout�flushr�OSError)�listr:Ztoplevelr3r@�filenamerD�namesrrrr5�s"




r5�__main__)�__doc__�__all__rr
r�appendrrr r!r(r)r*r+r,r-r0r1r;r5�__name__rrrr�<module>sB	














?>