Ë
    òT•j.  ã                   ó„  — d Z ddlmZ ddlZdgZ ej
                  ed¬«       dd„Zg Zd„ Z	ej                  e	«       d	„ Zej                  e«       d
„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zej                  e«       d„ Zd„ Zedk(  r e«        yy)z<Recognize image file formats based on their first few bytes.é    )ÚPathLikeNÚwhat)é   é   )Úremovec                 óŠ  — d}	 |€ft        | t        t        f«      rt        | d«      }|j	                  d«      }n2| j                  «       }| j	                  d«      }| j                  |«       t        D ]$  } |||«      }|sŒ|c |r|j                  «        S S  	 |r|j                  «        y# |r|j                  «        w w xY 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- Â-Cc                 ó&   — | dd dv ry| dd dk(  ryy)z;Test for JPEG data with JFIF or Exif markers; and raw JPEG.é   é
   )s   JFIFs   ExifÚjpegNé   s   ÿØÿÛ© ©r   r   s     r   Ú	test_jpegr!   +   s+   € àˆˆ2€wÐ$Ñ$ØØ	
ˆ2ˆAˆÐ%Ò	%Øð 
&ó    c                 ó(   — | j                  d«      ryy)zVerify if the image is a PNG.s   ‰PNG

ÚpngN©Ú
startswithr    s     r   Útest_pngr'   4   s   € à‡|�|Ð(Ô)Øð *r"   c                 ó   — | dd dv ryy)z3Verify if the image is a GIF ('87 or '89 variants).Nr   )s   GIF87as   GIF89aÚgifr   r    s     r   Útest_gifr*   ;   s   € àˆˆ!€uÐ&Ñ&Øð 'r"   c                 ó   — | dd dv ryy)zGVerify if the image is a TIFF (can be in Motorola or Intel byte order).Né   )s   MMs   IIÚtiffr   r    s     r   Ú	test_tiffr.   B   s   € àˆˆ!€u�ÑØð r"   c                 ó(   — | j                  d«      ryy)ztest for the SGI image library.s   ÚÚrgbNr%   r    s     r   Útest_rgbr1   I   ó   € à‡|�|�KÔ Øð !r"   c                 óf   — t        | «      dk\  r#| d   t        d«      k(  r| d   dv r	| d   dv ryy	y	y	y	)
z/Verify if the image is a PBM (portable bitmap).r   r   ó   Pé   s   14r,   ó    	
ÚpbmN©ÚlenÚordr    s     r   Útest_pbmr;   P   óE   € ä
ˆ1ƒv�‚{Ø	ˆ!‰”�D“	Ò˜a ™d e™m°°!±¸
Ñ0BØð 1C˜mÐð r"   c                 óf   — t        | «      dk\  r#| d   t        d«      k(  r| d   dv r	| d   dv ryy	y	y	y	)
z0Verify if the image is a PGM (portable graymap).r   r   r4   r5   s   25r,   r6   ÚpgmNr8   r    s     r   Útest_pgmr?   X   r<   r"   c                 óf   — t        | «      dk\  r#| d   t        d«      k(  r| d   dv r	| d   dv ryy	y	y	y	)
z/Verify if the image is a PPM (portable pixmap).r   r   r4   r5   s   36r,   r6   ÚppmNr8   r    s     r   Útest_ppmrB   `   r<   r"   c                 ó(   — | j                  d«      ryy)ztest for the Sun raster file.s   Y¦j•ÚrastNr%   r    s     r   Ú	test_rastrE   h   s   € à‡|�|Ð'Ô(Øð )r"   c                 ó(   — | j                  d«      ryy)z/Verify if the image is a X bitmap (X10 or X11).s   #define ÚxbmNr%   r    s     r   Útest_xbmrH   o   r2   r"   c                 ó(   — | j                  d«      ryy)z"Verify if the image is a BMP file.s   BMÚbmpNr%   r    s     r   Útest_bmprK   v   s   € à‡|�|�EÔØð r"   c                 ó:   — | j                  d«      r
| dd dk(  ryyy)zVerify if the image is a WebP.s   RIFFé   é   s   WEBPÚwebpNr%   r    s     r   Ú	test_webprP   }   s&   € à‡|�|�GÔ  1 R ¨GÒ!3Øð "4Ðr"   c                 ó(   — | j                  d«      ryy)z-verify is the image ia a OpenEXR fileOpenEXR.s   v/1ÚexrNr%   r    s     r   Útest_exrrS   „   s   € à‡|�|Ð'Ô(Øð )r"   c                  ó\  — dd l } d}| j                  dd  r#| j                  d   dk(  r| j                  dd…= d}	 | j                  dd  rt        | j                  dd  |d«       y t        dg|d«       y # t        $ r/ | j                  j                  d«       | j                  d«       Y y w xY w)Nr   r5   z-rr,   ú.z
[Interrupted]
)ÚsysÚargvÚtestallÚKeyboardInterruptÚstderrÚwriteÚexit)rV   Ú	recursives     r   Útestr^   �   s�   € ÛØ€IØ
‡x�x���|˜Ÿ™ ™ tÒ+Ø�H‰H�Q�q�SˆMØˆ	ðØ�8‰8�A�B‰<Ü�C—H‘H˜Q˜R�L )¨QÕ/ä�S�E˜9 aÕ(øÜò Ø�
‰
×ÑÐ,Ô-Ø�‰�Žðús   º)A3 Á$A3 Á35B+Â*B+c                 óø  — dd l }dd l}| D ]Ó  }|j                  j                  |«      rwt	        |dz   d¬«       |s|rWt	        d«       dd l}|j                  |j                  j                  |j                  |«      d«      «      }t        ||d«       Œ‰t	        d«       Œ•t	        |dz   d¬«       |j                  j                  «        	 t	        t        |«      «       ŒÕ y # t        $ r t	        d	«       Y Œíw xY w)
Nr   z/:ú )Úendzrecursing down:Ú*z*** directory (use -r) ***ú:z*** not found ***)rV   ÚosÚpathÚisdirÚprintÚglobÚjoinÚescaperX   ÚstdoutÚflushr   ÚOSError)Úlistr]   ÚtoplevelrV   rd   Úfilenamerh   Únamess           r   rX   rX   ž   sÊ   € ÛÛØò +ˆØ�7‰7�=‰=˜Ô"Ü�(˜T‘/ sÕ+Ù™HÜÐ'Ô(ÛØŸ	™	 "§'¡'§,¡,¨t¯{©{¸8Ó/DÀcÓ"JÓK�Ü˜˜y¨!Õ,äÐ2Õ3ä�(˜S‘. cÕ*Ø�J‰J×ÑÔð+Ü”d˜8“nÕ%ñ+øô ò +ÜÐ)Ö*ð+ús   ÃC"Ã"C9Ã8C9Ú__main__)N)Ú__doc__rd   r   ÚwarningsÚ__all__Ú_deprecatedÚ__name__r   r   r!   Úappendr'   r*   r.   r1   r;   r?   rB   rE   rH   rK   rP   rS   r^   rX   r   r"   r   ú<module>ry      sJ  ðÙ Bå Û àˆ(€ð €× Ñ �X gÕ .óð2 	€òð ‡�ˆYÔ òð
 ‡�ˆXÔ òð
 ‡�ˆXÔ òð
 ‡�ˆYÔ òð
 ‡�ˆXÔ òð ‡�ˆXÔ òð ‡�ˆXÔ òð ‡�ˆXÔ òð
 ‡�ˆYÔ òð
 ‡�ˆXÔ òð
 ‡�ˆXÔ òð
 ‡�ˆYÔ òð
 ‡�ˆXÔ òò+ð* ˆzÒÙ…Fð r"   