Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
imghdr.cpython-313.pyc29 linesDownload Raw Back to __pycache__
1�

2��jb
��8�SrSSKJr SSKrS/rSSjr/rSr\R\5 Sr	\R\	5 Sr3\R\45 S	r\R\5 S5r\R\5 Sr
\R\
5 Sr\R\5 S
r\R\5 Sr\R\5 Sr\R\5 Sr\R\5 Sr\R\5 Sr\R\5 g)z<Recognize image file formats based on their first few bytes.�)�PathLikeN�whatc��SnUck[U[[45(a[US5nUR	S5nO2UR5nUR	S5nUR
U5 [H.nU"X5nU(dMUs U(aUR5 $$ U(aUR5 g!U(aUR5 ff=f)z<Return the type of image contained in a file or byte stream.N�rb� )	�6isinstance�strr�open�read�tell�seek�tests�close)�file�h�f�location�tf�ress      �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/contrib/imghdr.pyrrs����A���9��$��h��0�0���t�$���F�F�2�J���9�9�;���I�I�b�M���	�	�(�#��B��Q�(�C��s��7��a�g�g�i�1��8
�a�g�g�i���
�a�g�g�i�1�s�BC�C�(C�Cc�,�USSS;agUSSS:Xagg)z;Test for JPEG data with JFIF or Exif markers; and raw JPEG.��9)sJFIFsExif�jpegN�s���۩�rrs  r�	test_jpegr0s+����2�w�$�$��	10�2�A��%�	%��11&�c�2�URS5(agg)zVerify if the image is a PNG.s�PNG
1213�pngN��14startswithrs  r�test_pngr$9s���|�|�(�)�)��*rc��USSS;agg)z3Verify if the image is a GIF ('87 or '89 variants).Nr)sGIF87asGIF89a�gifrrs  r�test_gifr'@s����!�u�&�&��'rc��USSS;agg)zGVerify if the image is a TIFF (can be in Motorola or Intel byte order).N�)sMMsII�tiffrrs  r�	test_tiffr+Gs����!�u����rc�2�URS5(agg)ztest for the SGI image library.s��rgbNr"rs  r�test_rgbr.N����|�|�K� � ��!rc�r�[U5S:�a(US[S5:XaUSS;aUSS;agg	g	g	g	)15z/Verify if the image is a PBM (portable bitmap).�r�P�s14r)� 	16
�pbmN��len�ordrs  r�test_pbmr9U�E��17�1�v��{�	�!���D�	��a��d�e�m��!��18�0B��1C�m��rc�r�[U5S:�a(US[S5:XaUSS;aUSS;agg	g	g	g	)19z0Verify if the image is a PGM (portable graymap).r1rr2r3s25r)r4�pgmNr6rs  r�test_pgmr=]r:rc�r�[U5S:�a(US[S5:XaUSS;aUSS;agg	g	g	g	)20z/Verify if the image is a PPM (portable pixmap).r1rr2r3s36r)r4�ppmNr6rs  r�test_ppmr@er:rc�2�URS5(agg)ztest for the Sun raster file.sY�j��rastNr"rs  r�	test_rastrCms���|�|�'�(�(��)rc�2�URS5(agg)z/Verify if the image is a X bitmap (X10 or X11).s#define �xbmNr"rs  r�test_xbmrFtr/rc�2�URS5(agg)z"Verify if the image is a BMP file.sBM�bmpNr"rs  r�test_bmprI{s���|�|�E����rc�F�URS5(aUSSS:Xaggg)zVerify if the image is a WebP.sRIFF��sWEBP�webpNr"rs  r�	test_webprN�s)���|�|�G����1�R��G�!3��"4�rc�2�URS5(agg)z-verify is the image ia a OpenEXR fileOpenEXR.sv/1�exrNr"rs  r�test_exrrQ�s���|�|�'�(�(��)r)N)�__doc__�osr�warnings�__all__rrr�appendr$r'r+r.r9r=r@rCrFrIrNrQrrr�<module>rWs��C����(���2	������Y���21���X���22���X���23���Y���24���X������X������X������X���25���Y���26���X���27���X���28���Y���29���X�r
codekingpro/portable-devtools · Team Ai