Your IP : 18.191.44.145


Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/imghdr.cpython-39.pyc

a

R�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}z�|durNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD](}|||�}|rR|W|rx|��SqRW|r�|��n|r�|��0dS)N�rb� )	�
isinstance�strr�open�read�tell�seek�tests�close)�file�h�f�locationZtf�res�r�+/opt/alt/python39/lib64/python3.9/imghdr.pyrs"



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

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dvrdSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dvrdSdS)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)zSGI image librarys�ZrgbNrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddvr8|ddvr8dSd	S)
zPBM (portable bitmap)�r�P�s14r� 	

ZpbmN��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddvr8|ddvr8dSd	S)
zPGM (portable graymap)r rr!r"s25rr#ZpgmNr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddvr8|ddvr8dSd	S)
zPPM (portable pixmap)r rr!r"s36rr#ZppmNr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)zSun raster filesY�j�ZrastNrrrrr�	test_rast_s
r*cCs|�d�rdSdS)zX bitmap (X10 or X11)s#define ZxbmNrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn(ty�|j�d�|�d�Yn0dS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqty�td	�Yq0qdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)�__doc__r?r�__all__rrr�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sD
















?>