File: //lib/python3.10/__pycache__/imghdr.cpython-310.pyc
o
    E�h�  �                   @   s4  d Z ddlmZ dgZd%dd�Zg Zdd� Ze�e� dd	� Ze�e� d
d� Z	e�e	� dd
� Z
e�e
� dd� Ze�e� dd� Ze�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�  dS dS )&z<Recognize image file formats based on their first few bytes.�    )�PathLike�whatNc                 C   s�   d }zE|d u r't | ttf�rt| d�}|�d�}n| �� }| �d�}| �|� tD ]}|||�}|r>|  W |r=|��  S S q)W |rF|��  d S |rO|��  w w )N�rb�    )	�
isinstance�strr   �open�read�tell�seek�tests�close)�file�h�f�location�tf�res� r   �/usr/lib/python3.10/imghdr.pyr      s&