o
    ha                     @  s|   d dl mZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 dZdddZG dd de
Zeejee eejd dS )    )annotations   )Image)i32le)DeferredError)PcxImageFileih:prefixbytesreturnboolc                 C  s   t | dkot| tkS )N   )leni32MAGIC)r    r   T/var/www/html/optinet_system/venv/lib/python3.10/site-packages/PIL/DcxImagePlugin.py_accept!   s   r   c                   @  s6   e Zd ZdZdZdZdddZdd
dZdddZdS )DcxImageFileDCXz	Intel DCXFr
   Nonec                 C  s   | j d}t|sd}t|g | _tdD ]}t| j d}|s% n| j| q| j | _d| _	t
| j| _| jdk| _| d d S )Nr   znot a DCX filei   r   r   )fpreadr   SyntaxError_offsetranger   append_fpframer   n_framesis_animatedseek)selfsmsgioffsetr   r   r   _open.   s   zDcxImageFile._openr   intc                 C  sP   |  |sd S t| jtr| jj|| _| j| _| j| j|  t	
|  d S N)_seek_check
isinstancer   r   exr   r   r!   r   r   r'   )r"   r   r   r   r   r!   C   s   
zDcxImageFile.seekc                 C  s   | j S r)   )r   )r"   r   r   r   tellM   s   zDcxImageFile.tellN)r
   r   )r   r(   r
   r   )r
   r(   )	__name__
__module____qualname__formatformat_description!_close_exclusive_fp_after_loadingr'   r!   r-   r   r   r   r   r   )   s    


r   z.dcxN)r   r	   r
   r   )
__future__r    r   _binaryr   r   _utilr   PcxImagePluginr   r   r   r   register_openr1   register_extensionr   r   r   r   <module>   s   
(