+
     iB  c                  s   ^ RI Ht ^ RIt^ RIt^ RIHtHtHt ^RIH	t	H
t
HtHtHt ^RIHt ^RIHt R R ltR	 R
 lt ! R R]P(                  4      t]	P,                  ! ]P.                  ]4       ]	P0                  ! ]P.                  ]4       ]	P2                  ! ]P.                  R4       ]	P4                  ! ]P.                  R4       R# )    )annotationsN)IOAnycast)Image	ImageFileImageSequenceJpegImagePluginTiffImagePlugin)o32le)DeferredErrorc               (    V ^8  d   QhRRRRRRRR/# 	   imzImage.Imagefpz	IO[bytes]filenamezstr | bytesreturnNone format   "9/usr/lib64/python3.14/site-packages/PIL/MpoImagePlugin.py__annotate__r   %   s(     , ,k ,y ,K ,D ,    c                s4    \         P                  ! WV4       R # N)r   _save)r   r   r   s   &&&r   r   r   %   s    "(+r   c               r   r   r   r   r   r   r   r   )   s(     7 7+ 79 7 7 7r   c           
     s   V P                   P                  R . 4      pV'       g"   \        V RR4      '       g   \        WV4       R# ^p. pV .VOp\	        R V 4       4      pV EF  p\
        P                  ! V4       EFm  p	V'       Eg   ^B^V,          ,           p
R\        P                  ! R^V
,           4      ,           R,           RV
,          ,           V	P                   R	&   V	P                   P                  R
4      p\        V\        P                  4      '       d   VP                  4       pWP                   R
&   V'       d   V^\        V4      ,           ,          p\        P                  ! WV4       VP                  VP!                  4       4       EK  V	P#                  V 4      pV	P%                  VR4       Wn         VP                  VP!                  4       VR,          ,
          4       EKp  	  EK  	  \&        P(                  ! 4       pRVR&   \        V4      VR&   Rp^ p\+        V4       FL  w  ppV^ 8X  d   RpM^ pV\        P                  ! RVVV^ ^ 4      ,          pV^ 8X  d	   W,          pVV,          pKN  	  WR&   VP-                  V4       VP/                  R\1        ^4      ,           VP                  ^4      ,           4       VP-                  ^ \2        P4                  4       R# )append_imagesis_animatedFNc              3  s<   "   T F  p\        VR ^4      x  K  	  R# 5i)n_framesN)getattr)Z.0Zseqs   & r   Z	<genexpr>Z_save_all.<locals>.<genexpr>2   s     D|Z++|s   s   z>Hs   MPF s    ZextraexifZJPEGs   0100i     r   i   z<LLLHH  s   II* )encoderinfogetr    r   Zsumr   ZIteratorstructZpack
isinstancer   ZExifZtobyteslenr   ZappendtellZ_attach_default_encoderinfoZsaver	   ZImageFileDirectory_v2Z	enumerateseekZwriter
   osZSEEK_END)r   r   r   r   Z
mpf_offsetZoffsetsZim_sequencesZtotalZim_sequenceZim_frameZ
ifd_lengthr!   r%   ZifdZ	mpentriesZdata_offsetZisizeZmptypes   &&&                r   	_save_allr.   )   sZ   NN&&;M]E!B!BbhJG''LD|DDE#%..{;H7"u*_
kk$J78 Z'( $$W-  ++//7dEJJ//<<>D37((0!c$i-/J%%hH=rwwy)&BB2Fb&)'2$rwwy72;67/ < $4 
/
/
1CCKg,CKIKW%46FFV[[64aKK	6%Kt & KGGJHH]U1X%A67GGAr{{r   c                  s|    ] tR t^gtRtRtRtR R ltRR R lltR	 R
 lt	R R lt
R R lt]RR R ll4       tRtR# )MpoImageFileZMPOzMPO (CIPA DC-007)Fc                   V ^8  d   QhRR/# )r   r   r   r   r   r   r   r   MpoImageFile.__annotate__l   s        t  r   c                	s    V P                   P                  ^ 4       \        P                  P	                  V 4       V P                  4        R# )r    N)r   r+   r   JpegImageFile_open_after_jpeg_openself   &r   r3   ZMpoImageFile._openl   s1    Q%%++D1r   Nc                    V ^8  d   QhRRRR/# )r   mpheaderdict[int, Any] | Noner   r   r   r   r   r   r   r1   q   s      )> $ r   c                	s   Ve   TMV P                  4       V n        V P                  f   Rp\        V4      hV P                  R,          V n        V P                  R,           Uu. uF#  q3R,          V P                  R,          ,           NK%  	  upV n        ^ V P
                  ^ &   V P                  \        V P
                  4      8X  g   Q hV P                  R V P                  ^8  V n        V P                  V n	        V P                  P                  V P
                  ^ ,          4       ^ V n        ^ V n        ^V n        R # u upi )Nz(Image appears to be a malformed MPO filer"   r#   Z
DataOffsetZmpoffset)Z_getmpmpinfo
ValueErrorr   info_MpoImageFile__mpoffsetsr)   r   r   _fpr+   _MpoImageFile__frameoffsetreadonly)r6   r9   msgZmpent   &&  r   r4   ZMpoImageFile._after_jpeg_openq   s   "*"6hDKKM;;<CS/!F+EI[[QWEX
EXE,$))J"777EX
   }}D$4$4 5555IIj!==1,77d&&q)*
s   $)D?c               r8   )r   posintr   r   r   r   r   r   r   r1      s      S T r   c                	s    \        V P                  \        4      '       d   V P                  P                  hV P                  P	                  V4       R # r   )r(   r?   r   exr+   )r6   rE   s   &&r   	load_seekZMpoImageFile.load_seek   s1    dhh..((++cr   c               r8   )r   framerF   r   r   r   r   r   r   r   r1      s      # $ r   c                	s   V P                  V4      '       g   R # \        V P                  \        4      '       d   V P                  P                  hV P                  V n        V P                  V,          V n        V P                  P                  R4      pRV P                  9   d   V P                  R V P
                  P                  V P                  ^,           4       V P
                  P                  ^4      '       g   Rp\        V4      hV P
                  P                  V P                  4       \        P                  P                  V 4       V P                  P                  R4      V8w  d   V P!                  4        \"        P$                  ! RRV P&                  ,           V P                  V P(                  ^ ,          R,          4      .V n        Wn        R # )Nr!   zNo data found for frameZjpeg)r    r    r$   )Z_seek_checkr(   r?   r   rG   r   r>   rA   r=   r&   r+   Zreadr<   r   r2   r3   Z_reload_exifr   Z_Tiler-   tiler@   )r6   rI   Zoriginal_exifrC   rD   r   r+   ZMpoImageFile.seek   s<   &&dhh..((++((&&u-		f-TYY		&!T[[1_%ww||A+CS/!T[[!%%++D199== M1 OOFFTYY$6TYYq\RTEUV
	 r   c               r0   )r   r   rF   r   r   r   r   r   r1      s      c r   c                	s    V P                   # r   )r@   r5   r7   r   r*   ZMpoImageFile.tell   s    ||r   c               s$    V ^8  d   QhRRRRRR/# )r   jpeg_instancezJpegImagePlugin.JpegImageFiler9   r:   r   r/   r   r   r   r   r   r1      s&      4' 
r   c                s^    \         V n        \        \         V 4      pVP                  V4       V# )a  
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.
)r/   Z	__class__r   r4   )rK   r9   Zmpo_instances   && r   adoptZMpoImageFile.adopt   s,     #/L-8%%h/r   )
Z__frameZ__mpoffsetsr?   r   r   r;   r   rA   rB   rJ   r   )Z__name__Z
__module__Z__qualname__Z__firstlineno__r   Zformat_descriptionZ!_close_exclusive_fp_after_loadingr3   r4   rH   r+   r*   ZstaticmethodrL   Z__static_attributes__r   r   r   r/   r/   g   s@    F,(-% 
,
4  r   r/   z.mpoz	image/mpo)Z
__future__r   r,   r'   Ztypingr   r   r   Z r   r   r   r   r	   Z_binaryr
   Z_utilr   r   r.   r2   r/   Zregister_saver   Zregister_save_allZregister_extensionZregister_mimer   r   r   <module>rM      s   ( # 	         ,7|T?00 T|   L'' /   ++Y 7   ,,f 5   L'' 5r   