%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/PIL/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/PIL/__pycache__/EpsImagePlugin.cpython-312.pyc

�

��e/>���ddlmZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZ
ddlmZej d�Zej d�Zdadad	�Zdd
�ZGd�d�Zd
�ZGd�de
j�Zdd�Ze	j6ej8ee�e	j:ej8e�e	j<ej8ddg�e	j>ej8d�y)�)�annotationsN�)�Image�	ImageFile)�i32le)�	deprecatez^%%([^:]*):[ \t]*(.*)[ \t]*$z^%[%!\w]([^:]*)[ \t]*$c�\�t��tjjd�r6t�"ddl}dD]}|j
|���|andatatduS	tjddgtj��datduStduS#t$rdaYtduSwxYw)N�winr)�gswin32c�gswin64c�gsFr
z	--version)�stdout)�	gs_binary�sys�platform�
startswith�gs_windows_binary�shutil�which�
subprocess�
check_call�DEVNULL�OSError)r�binarys  �4/usr/lib/python3/dist-packages/PIL/EpsImagePlugin.py�has_ghostscriptr-s������<�<�"�"�5�)� �(��<�.�F��|�|�F�+�7�,2�)��.�
).�%�)�I��E�!�!�
"��%�%�t�[�&9�*�BT�BT�U� �	��E�!�!�9�E�!�!���
"�!�	��E�!�!�
"�s�)B�B+�*B+c�b�t�s
d}t|��|d\}}}}|\}	}
t|�xsd}|d|z}|d|z}d|z|
d|
dz
z}
d|z|
d|
dz
z}tj�\}}tj|�d}t|d�r6t
jj|j�r
|j}n�tj�\}}tj|�|}t|d	�5}|jdtj�|j�}|jd�|}|dkDrC|j!t#|d
��}|sn%|t%|�z}|j'|�|dkDr�Cddd�|rdnd}t(d
d|d�d|d��d|
d�d|d��dddd|��d|��d|
d�d|
d�d�d|ddg}	d}t*j,j/d�r7t1j2�}|xj4t0j6zc_t1j8||��t;j|�}|j=�	tj>|�|rtj>|�|j@jC�}|j
�|S#1swY��7xYw#t$rY�DwxYw#	tj>|�|rtj>|�ww#t$rYwwxYwxYw)z!Render an image using Ghostscriptz%Unable to locate Ghostscript on pathsrrgR@��N�name�wbi��pngalpha�ppmrawz-qz-g�d�xz-r�fz-dBATCHz	-dNOPAUSEz-dSAFERz	-sDEVICE=z
-sOutputFile=z-c� z
 translatez-f�showpager
)�startupinfo)"rr�int�tempfile�mkstemp�os�close�hasattr�path�existsr �open�seek�io�SEEK_END�tell�read�min�len�writerrrrr�STARTUPINFO�dwFlags�STARTF_USESHOWWINDOWrr�load�unlink�im�copy)�tile�size�fp�scale�transparency�msg�decoder�offset�data�length�bbox�width�height�res_x�res_y�out_fd�outfile�infile_temp�infile�in_fdr&�fsize�
lengthfile�s�device�commandr)�out_imr@s                             r�Ghostscriptr\Ds����5���c�l��#'�q�'��G�T�6�4��L�F�D�
��J�O�!�E���G�e�O�E�
�!�W�u�_�F��5�L�D��G�d�1�g�-�.�E��6�M�T�!�W�t�A�w�.�/�E��&�&�(�O�F�G��H�H�V���K��r�6��r�w�w�~�~�b�g�g�6�����%�-�-�/���{�
�������
�+�t�
$�
	���G�G�A�r�{�{�#��G�G�I�E�
�G�G�A�J��J��q�.��G�G�C�
�J�7�8�����c�!�f�$�
�����
��q�.�
	�(�Z�X�F�	��
�U�1�I�Q�v�a�j�!�
�U�1�I�Q�u�Q�i� ����
�F�8��
��y�!����G�8�*�A�t�A�w�h�Z�z�*�����#�G�*����<�<�"�"�5�)�$�0�0�2�K����:�#B�#B�B�����g�;�?����G�$�����
�	��I�I�g����	�	�+�&�
�����	�B�
�L�L�N�
�I�s
	�
	��h�	��	��		��I�I�g����	�	�+�&����	��	�sP�BK�&BK/�;,K �K� 	K,�+K,�/L.�1,L�L.�	L+�(L.�*L+�+L.c�:�eZdZdZd�Zejfd�Zd�Zy)�PSFilez�
    Wrapper for bytesio object that treats either CR or LF as end of line.
    This class is no longer used internally, but kept for backwards compatibility.
    c�<�tddd��||_d|_y)Nr^�zSIf you need the functionality of this class you will need to implement it yourself.)�action)rrD�char)�selfrDs  r�__init__zPSFile.__init__�s%�����6�	
������	�c�J�d|_|jj||�y�N)rbrDr3)rcrI�whences   rr3zPSFile.seek�s����	������V�V�$rec��|jxsdg}d|_|jjd�}|dvrGt|�r<|j	|�|jjd�}|dvrt|�r�<|jjd�|_|jdvrd|_dj|�j
d�S)Nrer�
�latin-1)rbrDr7r9�append�join�decode)rcrX�cs   r�readlinezPSFile.readline�s���
�Y�Y�
�#�����	��G�G�L�L��O�����S��V�
�H�H�Q�K������Q��A����S��V��G�G�L�L��O��	��9�9����D�I��x�x��{�!�!�)�,�,reN)	�__name__�
__module__�__qualname__�__doc__rdr4�SEEK_SETr3rp�rerr^r^�s���
�#%�+�+�%�-rer^c�R�|dddk(xst|�dk\xrt|�dk(S)N��%!PS��P�
)r9�i32)�prefixs r�_acceptr}�s/���"�1�:�� �T�S��[�A�%5�%S�#�f�+��:S�Trec�@�eZdZdZdZdZddddd�Zd	�Zd
�Zdd�Z	d�Z
y
)�EpsImageFilez.EPS File Parser for the Python Imaging Library�EPSzEncapsulated Postscript�L�LAB�RGB�CMYK)rrrrxc��������j�j�\���jj��d�_d�_td�}t
|�}d}d}d�d��fd�}�����fd�}	�jjd�}|d	k(r|dk(rJ�n�|d
vr|dk(r?�2|dk\r+|dtd�k(r
d}t|��|r	|�d}d}|d||<|dz
}�p|r�|dtd�k7s|dd
dk(r
|�d}��t|d|d�}	||	�s�tj|	�}
|
r<|
jd�}|dddk(r|dd�jd<n�d�j|<n�|	ddk(rn�d}t|��|dddk(rY|d|j!dd�}d�|ddD�\}
}}}|dk(rd�_n|dk(r	�j"|�_nn=|
|f�_y�r#�r!|dddk(rn&t|d|d�}	||	�n
|dddk(rd�d}���|��js
d}t|��y#t$$rY�,wxYw)Nr��rTFc�r��d�jvr
d}t|��d�jvr
d}t|��y)N�PS-Adobez'EPS header missing "%!PS-Adobe" comment�BoundingBoxz*EPS header missing "%%BoundingBox" comment)�info�SyntaxError)rGrcs �r�check_required_header_commentsz:EpsImageFile._open.<locals>.check_required_header_comments�s@�������*�?��!�#�&�&��D�I�I�-�B��!�#�&�&�.rec���	tj|�}|r�|jdd�\}}|�j|<|dk(r|dk(rd�
y�jr�ri�
rg	|j�D�cgc]}tt|����}}|d|dz
|d|dz
f�_d	d
�jz�	�|ffg�_yyy#tj$r}d}t	|�|�d}~wwxYwcc}w#t$rYywxYw)N�not an EPS filerrr�z(atend)Trr�eps�rr)
�split�match�re�errorr��groupr��_sizer*�floatrCrB�	Exception)
rX�m�erG�k�v�i�boxrKrI�reading_trailer_commentsrc�trailer_reacheds
        �����r�
_read_commentz)EpsImageFile._open.<locals>._read_comment�s���
.��K�K��N��
��w�w�q�!�}���1� ��	�	�!���
�%��I�~�37�0��"�Z�Z�'�,D�
!�;<�'�'�)�"D�Q�3�u�Q�x�=�"D�C�"D�),�Q��#�a�&��#�a�&�3�q�6�/�)I�D�J�!&�����(:�F�V�S�M� R�)�D�I�
�)��	�8�8�
.�'��!�#�&�A�-��
.��"#E��
 )�!� ��!�s;�C�C2�.C-�	8C2�C*�C%�%C*�-C2�2	C>�=C>rrerj�%r��
s
%%EndCommentsrk�r��	�zbad EPS headerr`s%ImageData:�c3�2K�|]}t|����y�wrg)r*)�.0�values  r�	<genexpr>z%EpsImageFile._open.<locals>.<genexpr>Ws����5�#(�C��J�5�s�rx�1�s%%EOFs	%%Trailerz!cannot determine EPS bounding box)�_find_offsetrDr3�_moder��	bytearray�
memoryviewr7�ordr��str�fieldr�r�r�rr��mode_map�
ValueError)rc�byte_arr�bytes_mv�
bytes_read�reading_header_commentsr�r��byterGrXr�r��image_data_values�columns�rows�	bit_depth�mode_idrKrIr�r�s`                @@@@r�_openzEpsImageFile._open�s�����,�,�T�W�W�5����	
�����V����
���
��S�>���h�'���
�"&��#(� ���	'�	�	�<��7�7�<�<��?�D��s�{���?�������?����$� ��{�c�#�h�.�/��)�#�.�.�2�:�<�6;�3�&'�
�'+�A�w���$��a��
��&��A�;�#�c�(�*�h�s��m�?O�.O�2�4�.3�+�����*�-�y�9��$�Q�'����A��A���G�G�A�J���R�a�5�J�.�45�a�b�E�D�I�I�j�1�+-�D�I�I�a�L��1�����.��%�c�l�*��#�2��.�0�%-�R�
�$;�$A�$A�$��$J�!�5�,=�b�q�,A�5�1���y�'���>�!$�D�J��!�^��%)�]�]�7�%;��
��$�d�]��
�� �%=�
�B�Q�<�8�+�����*�-�y�9���a� ��"�1���-�"&���J�M�P	'�(��z�z�5�C��#�,����/&����s�I�	I�Ic�(�|jd�}|dk(r6|jdtj�|j	�}d}||fSt|�dk(r,|jd�}t|�}t|d�}||fSd}t
|��)Nrxryrrzr�r�)r7r3r4r5r6r{r�)rcrDrXrKrIrGs      rr�zEpsImageFile._find_offset{s����G�G�A�J����<��G�G�A�r�{�{�#��W�W�Y�F��F��v�~����V�z�
!�����
�A���V�F���A�Y�F�
�v�~��$�C��c�"�"rec�6�|jrot|j|j|j||�|_|jj
|_|jj|_g|_tjj|�Srg)
rBr\rCrDr@�moder�r�rr>)rcrErFs   rr>zEpsImageFile.load�sc���9�9�!�$�)�)�T�Y�Y������U�D�G������D�J������D�J��D�I��{�{����%�%rec��yrgrv)rc�args�kwargss   r�	load_seekzEpsImageFile.load_seek�s��	
reN�rF)rqrrrsrt�format�format_descriptionr�r�r�r>r�rvrerrr�s4��8�
�F�2���5�U�v�6�H�b�H�.&�
rerc���|j�|jdk(rd}n1|jdk(rd}n|jdk(rd}n
d}t|��|r�|jd�|jd	�|jd
|jz�|jd�|jd�|jd
�|jd|jz�|jd|z�|jd�|jd�|jd|jd|dzz�|jd|jz�|jd|jz�|jd|jd|jd|jdfz�|jd�|j|ddz�t|d�r|j
�tj||dd|jzddfg�|jd�|jd �t|d�r|j
�yy)!z*EPS Writer for the Python Imaging Library.r�)r�rsimager�)r�rsfalse 3 colorimager�)r�rxsfalse 4 colorimagezimage mode is not supporteds%!PS-Adobe-3.0 EPSF-3.0
s%%Creator: PIL 0.1 EpsEncode
s%%%%BoundingBox: 0 0 %d %d
s%%Pages: 1
s%%EndComments
s%%Page: 1 1
s%%ImageData: %d %d s%d %d 0 1 1 "%s"
sgsave
s10 dict begin
s/buf %d string def
rrs%d %d scale
s%d %d 8
s[%d 0 0 -%d 0 %d]
s+{ currentfile buf readhexstring pop } bind
r�
�flushr�r�Ns
%%%%EndBinary
s
grestore end
)	r>r�r�r:rCr/r�r�_save)r@rD�filenamer��operatorrGs      rr�r��s����G�G�I�
�w�w�#�~�#��	���E�	�0��	���F�	�0��+����o��
�
���-�.�
���2�3�
���0�2�7�7�:�;�
����!�
���#�$�
���!�"�
���'�"�'�'�1�2�
���&��1�2��H�H�Z���H�H�
� ��H�H�
$�����
�X�a�[�(@�
A�B��H�H�
����
'�(��H�H�\�B�G�G�
#�$��H�H�
#�r�w�w�q�z�2�7�7�1�:�r�w�w�q�z�&J�
J�K��H�H�
<�=��H�H�X�a�[�5�
 �!��r�7��
���
�
�O�O�B��e�V�b�g�g�%5�q�$�?�@�A��H�H�
!�"��H�H�
���r�7��
���
�rez.psz.epszapplication/postscriptr�)r) �
__future__rr4r-r�rrr+r�rr�_binaryrr{�
_deprecater�compiler�r�rrrr\r^r}rr��
register_openr��
register_save�register_extensions�
register_mimervrer�<module>r�s���,#�	�	�	��
���!�!�
	��
�
�2�3����
�
�,�-���	���"�.Z�z"-�"-�JU�O
�9�&�&�O
�j.�h����L�'�'��w�?�����L�'�'��/�����,�-�-��v��?�����L�'�'�)A�Bre

Zerion Mini Shell 1.0