
    (ph                        S SK Jr  S SKrSSKJrJrJr  SSKJr	  SSKJ
r  SSKJr  SS jr " S	 S
\R
                  5      r\R                  " \R                   \\5        \R"                  " \R                   SS/5        g)    )annotationsN   )Image	ImageFileImagePalette)i16le)i32le)o8c                v    [        U 5      S:  =(       a%    [        U S5      S;   =(       a    [        U S5      S;   $ )N      )  i     )r      )leni16)prefixs    E/var/www/html/venv/lib/python3.13/site-packages/PIL/FliImagePlugin.py_acceptr      s:    Fq 	&N..	&Ov%    c                  J    \ rS rSrSrSrSrS rS rSS jr	SS jr
SS	 jrS
rg)FliImageFile+   FLIzAutodesk FLI/FLC AnimationFc           	        U R                   R                  S5      n[        U5      (       a	  USS S:X  d  Sn[        U5      e[	        US5      U l        U R
                  S:  U l        SU l        [	        US	5      [	        US
5      4U l        [        US5      n[	        US5      nUS:X  a  US-  S-  nX0R                  S'   [        S5       Vs/ s H  oUXU4PM     nnU R                   R                  S5      nSU l        [	        US5      S:X  a]  U R                  [        U5      -   U l        U R                   R                  U R                  5        U R                   R                  S5      n[	        US5      S:X  a  [	        US5      nS n[        U5       H  n	Ub-  U R                   R                  US-
  [        R                  5        U R                   R                  S5      n[	        US5      n
U
S;   a  U R!                  XjS:X  a  SOS5          O[        U5      nU(       a  M    O   U VVVs/ s H)  u  pn[#        U5      [#        U5      -   [#        U5      -   PM+     nnnn[$        R&                  " SSR)                  U5      5      U l        SU l        U R                   U l        U R                   R1                  5       U l        U R                  S5        g s  snf s  snnnf )N         s     znot an FLI/FLC filer   r   P   
      r   r   i  F   duration   i   i  )r      r&      r   RGBr   )fpreadr   SyntaxErrorr   n_framesis_animated_mode_sizei32inforange_FliImageFile__offsetseekosSEEK_CUR_paletter
   r   rawjoinpalette_FliImageFile__frame_fptell_FliImageFile__rewind)selfsmsgr$   magicar;   number_of_subchunks
chunk_size_
chunk_typergbs                 r   _openFliImageFile._open0   sV   GGLL

qBx;6'Cc"" Aq	==1, 
AYAr
*
 q":Aq	F? 4B.H (		* ',Cj1jq9j1GGLLq!9 MMCF2DMGGLL'R Aq!9"%a)J./)GGLLa=GGLLO AY
(MM'b0@1aH V
!z 0 ;BB'YaA2a52a5=2a5('B#''sxx/@A 77		!G 28 Cs   K,0Kc                   Sn[        [        U R                  R                  S5      5      5       H  nU R                  R                  S5      nX5S   -   nUS   nUS:X  a  SnU R                  R                  US-  5      n[        S[	        U5      S5       H)  nXV   U-  nXVS-      U-  nXVS-      U-  n	XxU	4X'   US-  nM+     M     g )Nr   r'   r   r%   r   )r3   r   r*   r+   r   )
r@   r;   shiftierA   nrI   rJ   rK   s
             r   r8   FliImageFile._palettel   s     s477<<?+,AQAaDA!AAvQU#A1c!fa(DEM!eH%!eH%AY
Q ) -r   c                    U R                  U5      (       d  g XR                  :  a  U R                  S5        [        U R                  S-   US-   5       H  nU R                  U5        M     g )Nr   r   )_seek_checkr<   _seekr3   )r@   framefs      r   r5   FliImageFile.seek~   sT    &&<<JJqMt||a'3AJJqM 4r   c                D   US:X  a4  SU l         U R                  R                  U R                  5        SU l        OU R                  5         XR                   S-   :w  a  SU 3n[        U5      eXl         U R                  U l        U R                  R                  U R                  5        U R                  R                  S5      nU(       d  Sn[        U5      e[        U5      nX@l        SS	U R                  -   U R                  S 4/U l        U =R                  U-  sl        g )
Nr   r)   r   r   zcannot seek to frame r   zmissing frame sizefli)r   r   )r<   r=   r5   r?   r4   load
ValueErrorr*   r+   EOFErrorr1   decodermaxblocksizetile)r@   rW   rB   rA   	framesizes        r   rV   FliImageFile._seek   s    A:DLHHMM$--(DM IIKLL1$$)%1CS/! ((T]]#GGLLO&C3-F	(Vdii/EF	"r   c                    U R                   $ )N)r<   )r@   s    r   r>   FliImageFile.tell   s    ||r   )__frame__offset__rewindr=   r/   r0   r_   r*   r.   r-   r;   ra   N)rW   intreturnNone)rj   ri   )__name__
__module____qualname____firstlineno__formatformat_description!_close_exclusive_fp_after_loadingrL   r8   r5   rV   r>   __static_attributes__ r   r   r   r   +   s-    F5(-%:x$#<r   r   z.fliz.flc)r   bytesrj   bool)
__future__r   r6    r   r   r   _binaryr   r   r	   r1   r
   r   r   register_openrp   register_extensionsrt   r   r   <module>r|      sk   " # 	 , , ! ! {9&& {B   L''w ?   ,--/? @r   