%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/hplip/base/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/hplip/base/__pycache__/imagesize.cpython-312.pyc

�

=	f��X�ddlZddlZddlZddlZejdej
�Zejdej
�Zejdej
ejz�Z	ejdej
�Z
ejdej
�Zejd�Zd$d�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zejd�defejd�defejd�defejd�defejd�defejd�defejd�defejd�defejd �d!efejd"�defi
Zd%d#�Zy)&�Nz2^\#define\s*\S*\s*(\d+)\s*\n\#define\s*\S*\s*(\d+)z("\s*(\d+)\s+(\d+)(\s+\d+\s+\d+){1,2}\s*"z^\#.*z^(P[1-6])\s+(\d+)\s+(\d+)zIMGINFO:(\d+)x(\d+)z
II\x2a\x00c�R�|dk7r|j|d�|j|�S)Nr)�seek�read)�stream�length�offsets   �"/usr/share/hplip/base/imagesize.py�readinr
(s&��
��{����F�A���;�;�v���c���d\}}tjt|d��}	t|j	d��}t|j	d��}||fS#Y||fSxYw�N����r���)�xbm_pat�matchr
�int�group�r�width�heightrs    r	�xbmsizer/si���M�E�6��M�M�&���-�.�E�
��E�K�K��N�#���U�[�[��^�$���&�=���
���&�=��s�4A�A%c���d\}}tjtt|d��}	t	|jd��}t	|jd��}||fS#Y||fSxYwr
)�re�search�xpm_patr
rrrs    r	�xpmsizer<sk���M�E�6��I�I�g�v�f�d�3�4�E�
��E�K�K��N�#���U�[�[��^�$���&�=���
���&�=��s�4A#�#A*c��d\}}t|dd�dvr(tjd|jd��\}}||fS)Nr��)�IHDR�MHDRz!II�)r
�struct�unpackr�rrrs   r	�pngsizer)HsC���M�E�6�
�f�a��� 0�0��
�
�e�V�[�[��^�<�
�����<�rc�D�d\}}|jd�	d}t||�}	tjd|�\}}}|dk7r	||fSdt	|�cxkrdkr)nn&d}tjd	t||��\}}nt||dz
���#Y||fSxYw)
Nrrr!z!c c h�ÿ����z!xhh)rr
r&r'�ord)rrrr�buffer�marker�codes       r	�jpegsizer3Qs����M�E�6�
�K�K��N�
������'��	�#)�=�=��6�#B� �F�D�&��V����&�=���3�t�9�$��$��F�"�M�M�&�&���2H�I�M�F�E�
�6�6�!�8�$�!��
	���&�=��s�B�Bc���d\}}tjtdt|d��}tj|�}d}	|j
d�}t|j
d��}t|j
d��}|dk(rNtj|�}	t|j
d��}t|j
d��}||fS||fS#Y�[xYw#Y||fSxYw)Nr�rrr��P7)	r�sub�ppm_pat1r
�ppm_pat2rrr�ppm_pat3)rrr�headerr�typs      r	�ppmsizer>is����M�E�6�
�V�V�H�b�&���"6�
7�F��N�N�6�"�E�
�C�
��k�k�!�n���E�K�K��N�#���U�[�[��^�$���d�{����v�&��	�����A��'�E�����Q��(�F��&�=��5�&�=���
���	���&�=��s�AC�#4C&�C#�&C-c�h�t|d�}d}tj|�}|�d}t|dd�}tjd|z|�d}tjd|zt|d|��d}|dz
}||dzz}d	\}}	t|d|�}	|	d
k(s||kDr	||fS|dz
}tjd|z|	dd�d}
tjd|z|	dd�d}|
dk(r tjd|z|	dd�d}n$|
d
k(rtjd|z|	dd�d}��)Nr!�>�<z%sirz%sHrr"rr5�r%i)r
�tiff_endian_patrr&r')rr<�endianr�inputr�
num_direntrr�ifd�tag�types            r	�tiffsizerJ�s_��
�F�A�
�F�
�F��!�!�&�)�E������6�1�a� �E�
�]�]�5�6�>�5�
1�!�
4�F����u�v�~�v�f�a��/H�I�!�L�J�
�a�K�F���B��'�J��M�E�6�
��V�R��(���"�9���+���&�=��	�"����m�m�E�6�M�3�q��8�4�Q�7���}�}�U�V�^�S��1�X�6�q�9���&�=��M�M�%�&�.�#�a��)�<�Q�?�E�
�F�]��]�]�5�6�>�3�q��9�=�a�@�F�rc�R�tjdt|dd��\}}||fS)Nz<IIr%�)r&r'r
r(s   r	�bmpsizerM�s)���M�M�%����2�)>�?�M�E�6��&�=�rc�\�t|dd�}tjd|�\}}}}}||fS)N��z<HHBBB)r
r&r')r�bufrr�flags�bci�pars       r	�gifsizerU�s7�����A�
�C�%+�]�]�8�S�%A�"�F�E�5�#�s��&�=�rz^GIF8[7,9]az	image/gifu^ÿØz
image/jpegu
^‰PNG

z	image/pngz^P[1-7]zimage/x-portable-pixmapz\#define\s+\S+\s+\d+zimage/x-xbitmapz
\/\* XPM \*\/zimage/x-xpixmapz^MM*z
image/tiffz^II\*z^BMzimage/x-bitmapu
^ŠMNG

c��d\}}t|d�}|jd�}|s,tD]#}|j|�}|��t|\}}n|rr|j	d�||�\}}nd\}}|j�|||fS)Nr�rir)�openr�TYPE_MAPrr�close)	�filename�	mime_typerr�fr0�tr�funcs	         r	�	imagesizer`�s����M�E�6��X�s��A�
�V�V�D�\�F���	�A��H�H�V�$�E�� �"*�1�+��	�4��		��T�	���q�	��Q��
��v��
��v��G�G�I��5�)�#�#r)r)r5)�os�os.pathrr&�compile�
IGNORECASErr�	MULTILINEr9r:r;rCr
rrr)r3r>rJrMrUrYr`�rr	�<module>rgs���4
��	�
��"�*�*�J�B�M�M�
Z��
�"�*�*�@�"�-�-�
P���2�:�:�h��
�
���� <�=���2�:�:�2�B�M�M�B���2�:�:�,�b�m�m�<���"�*�*�]�+���
�	���0�0�D�
	�
�B�J�J�}�%�k�7�5K�
�R�Z�Z��
$�|�X�6N�
�R�Z�Z�2�
3�{�G�6L�
�R�Z�Z�	�
"�7P�RY�6Z�
�R�Z�Z�.�
/�7H�'�6R�
�R�Z�Z��
(�7H�'�6R�
�R�Z�Z�
�
&�|�X�6N�
�R�Z�Z��
$�|�X�6N�
�R�Z�Z��
�7G��6Q�
�R�Z�Z�2�
3�{�G�6L�

��$r

Zerion Mini Shell 1.0