File: //lib/python3.12/__pycache__/imghdr.cpython-312.pyc
�
    )!�h.  �                   �  � d Z ddlmZ ddlZdgZ ej
                  ed��       dd�Zg Zd� Z	ej                  e	�       d	� Zej                  e�       d
� Zej                  e�       d� Z
ej                  e
�       d� Zej                  e�       d
� Zej                  e�       d� Zej                  e�       d� Zej                  e�       d� Zej                  e�       d� Zej                  e�       d� Zej                  e�       d� Zej                  e�       d� Zej                  e�       d� Zd� Zedk(  r e�        yy)z<Recognize image file formats based on their first few bytes.�    )�PathLikeN�what)�   �
   )�removec                 �  � d}	 |�ft        | t        t        f�      rt        | d�      }|j	                  d�      }n2| j                  �       }| j	                  d�      }| j
                  |�       t        D ]$  } |||�      }|s�|c |r|j                  �        S S  	 |r|j                  �        y# |r|j                  �        w w xY w)z<Return the type of image contained in a file or byte stream.N�rb�    )	�
isinstance�strr   �open�read�tell�seek�tests�close)�file�h�f�location�tf�ress         �/usr/lib/python3.12/imghdr.pyr   r      s�   � ��A���9��$��h��0���t�$���F�F�2�J���9�9�;���I�I�b�M���	�	�(�#�� 	�B��Q��(�C���
��a�g�g�i�1�	�
 
�a�g�g�i��� 
�a�g�g�i�1�s   �A<B- �B- �B- �-Cc                 �&