Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/PIL/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/PIL/__pycache__/FliImagePlugin.cpython-312.pyc

�

&ٜgC���ddlmZddlZddlmZmZmZddlmZ	ddlm
ZddlmZd
d�Z
Gd	�d
ej
�Zejej ee
�ej"ej ddg�y)�)�annotationsN�)�Image�	ImageFile�ImagePalette)�i16le)�i32le��o8c�^�t|�dk\xrt|d�dvxrt|d�dvS)N��)��i��)r�)�len�i16)�prefixs �=/usr/local/lib/python3.12/site-packages/PIL/FliImagePlugin.py�_acceptrs:���F��q��	&����N�.�.�	&����O�v�%��c�@�eZdZdZdZdZd
d�Zdd�Zdd�Zdd�Z	d
d�Z
y	)�FliImageFile�FLIzAutodesk FLI/FLC AnimationFc�$�|jjd�}t|�r|dddk(s
d}t|��t	|d�|_|j
dkD|_d|_t	|d	�t	|d
�f|_t|d�}t	|d�}|d
k(r|dzdz}||jd<td�D�cgc]}|||f��	}}|jjd�}d|_t	|d�dk(r]|jt|�z|_|jj|j�|jjd�}t	|d�dk(r�t	|d�}d}t|�D]�}	|�-|jj|dz
tj�|jjd�}t	|d�}
|
dvr|j!||
dk(rdnd�nt|�}|r��nt#j$ddj'd�|D���|_d|_|j|_|jj/�|_|jd�ycc}w)N���sznot an FLI/FLC filer
r�P��
�rri��F�duration�i�i��)r�r&�r�RGBrc3�jK�|]+\}}}t|�t|�zt|�z���-y�w�Nr
)�.0�r�g�bs    r�	<genexpr>z%FliImageFile._open.<locals>.<genexpr>ds,����K�7�i�q�!�Q�B�q�E�B�q�E�M�B�q�E�1�7�s�13���)�fp�readr�SyntaxErrorr�n_frames�is_animated�_mode�_size�i32�info�range�_FliImageFile__offset�seek�os�SEEK_CUR�_paletter�raw�join�palette�_FliImageFile__frame�_fp�tell�_FliImageFile__rewind)�self�s�msgr$�magic�arB�number_of_subchunks�
chunk_size�_�
chunk_types           r�_openzFliImageFile._open0s/���G�G�L�L������
�q��B�x�;�6�'�C��c�"�"��A�q�	��
��=�=�1�,�����
���A�Y��A�r�
�*��
��q�"�:���A�q�	���F�?� �4��B�.�H� (��	�	�*��',�C�j�1�j��A�q�!�9�j��1��G�G�L�L������
��q�!�9��� �M�M�C��F�2�D�M��G�G�L�L����'������R� �A��q�!�9���"%�a��)��%)�J��.�/���)��G�G�L�L��a�����=��G�G�L�L��O�� ��A�Y�
���(��M�M�'�
�b�0@�1�a�H�� ��V�
�!��0�$�'�'��3�8�8�K�7�K�K�
���
����7�7����������
��	�	�!���I2s�J
c��d}tt|jjd���D]�}|jjd�}||dz}|d}|dk(rd}|jj|dz�}tdt	|�d�D]-}|||z}||dz|z}||dz|z}	|||	f||<|dz
}�/��y)Nrr'rr%r)r:rr1r2r)
rGrB�shift�i�erH�nr,r-r.s
          rr?zFliImageFile._palettems���
���s�4�7�7�<�<��?�+�,�A������Q��A��A�a�D��A��!��A��A�v��������Q��U�#�A��1�c�!�f�a�(���a�D�E�M���a�!�e�H��%���a�!�e�H��%����A�Y���
��Q���)�-rc���|j|�sy||jkr|jd�t|jdz|dz�D]}|j|��y)Nrr)�_seek_checkrC�_seekr:)rG�frame�fs   rr<zFliImageFile.seeksS������&���4�<�<���J�J�q�M��t�|�|�a�'����3�A��J�J�q�M�4rc�^�|dk(r4d|_|jj|j�d|_n|j�||jdzk7rd|��}t
|��||_|j|_|jj|j�|jjd�}|s
d}t|��t|�}||_tjdd	|jz|j�g|_|xj|z
c_y)
Nrr0rrzcannot seek to frame rzmissing frame size�fli)rr)rCrDr<rFr;�load�
ValueErrorr1r2�EOFErrorr8�decodermaxblockr�_Tile�size�tile)rGrYrIrH�	framesizes     rrXzFliImageFile._seek�s����A�:��D�L��H�H�M�M�$�-�-�(��D�M�
�I�I�K��D�L�L�1�$�$�)�%��1�C��S�/�!�����(�(��������T�]�]�#��G�G�L�L��O���&�C��3�-����F�	�(����_�_�U�F�T�Y�Y�,>��
�
�N�O��	��
�
��"�
rc��|jSr*)rC)rGs rrEzFliImageFile.tell�s���|�|�rN)�return�None)rBzlist[tuple[int, int, int]]rR�intrfrg)rYrhrfrg)rfrh)�__name__�
__module__�__qualname__�format�format_description�!_close_exclusive_fp_after_loadingrPr?r<rXrE�rrrr+s-��
�F�5��(-�%�;�z�$�#�<rrz.fliz.flc)r�bytesrf�bool)�
__future__rr=�rrr�_binaryrrr	r8rrr�
register_openrl�register_extensionsrorr�<module>rwso��"#�	�,�,�!�!���|�9�&�&�|�D����L�'�'��w�?�����,�-�-���/?�@r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists