zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
U
T±dã@s€ddlZddlmZmZmZddlmZddlmZ    ddlm
Z
dd„Z Gd    d
„d
ejƒZ e  e je e ¡e e jd d g¡dS) éNé)ÚImageÚ    ImageFileÚ ImagePalette)Úi16le)Úi32le©Úo8cCs(t|ƒdko&t|dƒdko&t|dƒdkS)Néé)é¯i¯é)ré)ÚlenÚi16)Úprefix©rúId:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PIL/FliImagePlugin.pyÚ_accepts
  ÿ ýrc@s@eZdZdZdZdZdd„Zdd„Zdd    „Zd
d „Z    d d „Z
dS)Ú FliImageFileZFLIzAutodesk FLI/FLC AnimationFc
CsÎ|j d¡}t|ƒr$|dd…dks0d}t|ƒ‚t|dƒ|_|jdk|_d|_t|d    ƒt|d
ƒf|_t    |d ƒ}t|d ƒ}|d krŒ|dd}||j
d<dd„t dƒDƒ}|j d ¡}d|_ t|d ƒdkrä|j t    |ƒ|_ |j d ¡}t|d ƒdkr„t|dƒ}d}t |ƒD]x}|dk    r,|j  |dtj¡|j d¡}t|d ƒ}    |    dkrl| ||    dkr`dnd¡q„t    |ƒ}|s
q„q
dd„|Dƒ}t dd |¡¡|_d|_|j|_|j ¡|_|  d¡dS)Né€éésznot an FLI/FLC filer
rÚPéé
ér r ièéFÚdurationcSsg|]}|||f‘qSrr)Ú.0ÚarrrÚ
<listcomp>Fsz&FliImageFile._open.<locals>.<listcomp>éiñiúñ)r é r#ércSs*g|]"\}}}t|ƒt|ƒt|ƒ‘qSrr)rÚrÚgÚbrrrr!asÚRGBóéÿÿÿÿ)ÚfpÚreadrÚ SyntaxErrorrZn_framesZ 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Úmagicr:Znumber_of_subchunksÚ
chunk_sizeÚ_Z
chunk_typerrrÚ_open/sN   
 
 
 
 
 
 
 
 zFliImageFile._openc
Cs¶d}tt|j d¡ƒƒD]˜}|j d¡}||d}|d}|dkrHd}|j |d¡}tdt|ƒdƒD]F}|||>}||d|>}||d|>}    |||    f||<|d7}qhqdS)Nrr$rr"r)r2rr+r,r)
r?r:ÚshiftÚiÚer@Únr%r&r'rrrr7js   zFliImageFile._palettecCsJ| |¡sdS||jkr"| d¡t|jd|dƒD]}| |¡q6dS)Nrr)Z _seek_checkr;Ú_seekr2)r?ÚframeÚfrrrr4|s 
 
 
zFliImageFile.seekcCs´|dkr$d|_|j |j¡d|_n| ¡||jdkrLd|›}t|ƒ‚||_|j|_|j |j¡|j d¡}|s|t    ‚t
|ƒ}||_ dd|j |jdfg|_ |j|7_dS)    Nrr*rrzcannot seek to frame r Zfli)rr)r;r<r4r>r3ÚloadÚ
ValueErrorr+r,ÚEOFErrorr0ZdecodermaxblockÚsizeZtile)r?rKrAr@Z    framesizerrrrJ…s$
 zFliImageFile._seekcCs|jS)N)r;)r?rrrr=¢szFliImageFile.tellN) Ú__name__Ú
__module__Ú __qualname__ÚformatÚformat_descriptionZ!_close_exclusive_fp_after_loadingrEr7r4rJr=rrrrr*s;    rz.fliz.flc)r5ÚrrrÚ_binaryrrrr0r    rrZ register_openrTZregister_extensionsrrrrÚ<module>s