HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/PIL/__pycache__/FliImagePlugin.cpython-38.pyc
U

g�
^-�@slddlmZmZmZddlmZmZmZ	m
Z
dd�ZGdd�dej�Ze�
ejee�e�ejddg�d	S)
�)�Image�	ImageFile�ImagePalette)�i8�i16le�i32le�o8cCs t|�dkot|dd��dkS)N�����i�)�len�i16)�prefix�r�4/usr/lib/python3/dist-packages/PIL/FliImagePlugin.py�_acceptsrc@s`eZdZdZdZdZdd�Zdd�Zedd	��Z	ed
d��Z
dd
�Zdd�Zdd�Z
dd�ZdS)�FliImageFileZFLIzAutodesk FLI/FLC AnimationFcCs�|j�d�}t|dd��}|dkrHt|dd��dkrH|dd	�d
ksPtd��t|dd��|_d
|_t|dd��t|dd��f|_t|dd��}|dkr�|dd}||jd<dd�t	d�D�}|j�d�}d|_
t|dd��dk�r|j
t|�|_
|j�d�}t|dd��dk�rv|j�d�}t|dd��dk�rT|�|d�n"t|dd��dk�rv|�|d�dd�|D�}t�
dd�|��|_d|_|j|_|j��|_|�d�dS) N�r
r	r��)����sznot an FLI/FLC file��P�
�ri��F�durationcSsg|]}|||f�qSrr)�.0�arrr�
<listcomp>Csz&FliImageFile._open.<locals>.<listcomp>�i�i����rcSs*g|]"\}}}t|�t|�t|��qSr)r)r!�r�g�brrrr#VsZRGB����)�fp�readr�SyntaxError�_FliImageFile__framecount�modeZ_size�i32�info�range�_FliImageFile__offset�_paletter�raw�join�palette�_FliImageFile__frame�_FliImageFile__fp�tell�_FliImageFile__rewind�seek)�self�s�magicr r8rrr�_open)sD���"
zFliImageFile._openc
Cs�d}tt|j�d���D]�}|j�d�}|t|d�}t|d�}|dkrPd}|j�|d�}tdt|�d�D]R}t||�|>}t||d�|>}t||d�|>}	|||	f||<|d7}qpqdS)Nrr&rr$r)r3rr,r-rr
)
r>r8�shift�i�er?�nr'r(r)rrrr5_szFliImageFile._palettecCs|jS�N�r/�r>rrr�n_framesqszFliImageFile.n_framescCs
|jdkS)NrrGrHrrr�is_animateduszFliImageFile.is_animatedcCsJ|�|�sdS||jkr"|�d�t|jd|d�D]}|�|�q6dS)Nrr)Z_seek_checkr9�_seekr3)r>�frame�frrrr=ys


zFliImageFile.seekcCs�|dkr$d|_|j�|j�d|_n|��||jdkrFtd|��||_|j|_|j�|j�|j�d�}|svt	�t
|�}||_dd|j|jdfg|_
|j|7_dS)	Nrr+rrzcannot seek to frame %dr
Zfli)rr)r9r:r=r<r4�load�
ValueErrorr,r-�EOFErrorr1Zdecodermaxblock�sizeZtile)r>rLr?Z	framesizerrrrK�s"zFliImageFile._seekcCs|jSrF)r9rHrrrr;�szFliImageFile.tellcCsBz4z|j|jkr|j��Wntk
r0YnXW5d|_XdSrF)r:r,�close�AttributeErrorrHrrr�
_close__fp�s
zFliImageFile._close__fpN)�__name__�
__module__�__qualname__�formatZformat_descriptionZ!_close_exclusive_fp_after_loadingrAr5�propertyrIrJr=rKr;rTrrrrr#s6

	rz.fliz.flcN)�rrrZ_binaryrrrrr1rrrZ
register_openrXZregister_extensionsrrrr�<module>s