AlkantarClanX12
Current Path : /proc/self/root/lib64/python3.6/__pycache__/ |
Current File : //proc/self/root/lib64/python3.6/__pycache__/imghdr.cpython-36.opt-1.pyc |
3 \� � @ s2 d Z ddlmZ dgZd%dd�Zg Zdd� Zeje� dd � Zeje� d d� Z eje � dd � Z eje � dd� Zeje� dd� Zeje� dd� Z eje � dd� Zeje� dd� Zeje� dd� Zeje� dd� Zeje� dd� Zeje� dd� Zeje� d d!� Zd"d#� Zed$k�r.e� dS )&z<Recognize image file formats based on their first few bytes.� )�PathLike�whatNc C s� d }zl|d krNt | ttf�r2t| d�}|jd�}n| j� }| jd�}| j|� xtD ]}|||�}|rT|S qTW W d |r~|j� X d S )N�rb� ) � isinstance�strr �open�read�tell�seek�tests�close)�file�h�f�locationZtf�res� r �/usr/lib64/python3.6/imghdr.pyr s c C s | dd� dkrdS dS )z JPEG data in JFIF or Exif format� � � JFIF� ExifZjpegN)r r r )r r r r r � test_jpeg% s r c C s | j d�rdS d S )Ns �PNG Zpng)� startswith)r r r r r �test_png, s r c C s | dd� dkrdS dS )zGIF ('87 and '89 variants)Nr � GIF87a� GIF89aZgif)r r r )r r r r r �test_gif2 s r c C s | dd� dkrdS dS )z-TIFF (can be in Motorola or Intel byte order)N� � MM� IIZtiff)r r! r )r r r r r � test_tiff9 s r"