U
    Ú²gW  ã                   @  sN   d dl mZ ddlmZmZ G dd„ dejƒZe eje¡ e ejd¡ dS )é    )Úannotationsé   )ÚImageÚ	ImageFilec                   @  s0   e Zd ZdZdZddœdd„Zddœdd„Zd	S )
ÚPcdImageFileZPCDzKodak PhotoCDÚNone)Úreturnc                 C  s˜   | j d k	st‚| j  d¡ | j  d¡}|d d… dkrBd}t|ƒ‚|d d@ }d | _|dkrdd| _n|dkrrd	| _d
| _d| _dd| j dd fg| _	d S )Ni   é   s   PCD_znot a PCD filei  é   r   éZ   i¦ÿÿÿZRGB)i   i   Zpcd)r   r   i   )
ÚfpÚAssertionErrorÚseekÚreadÚSyntaxErrorÚtile_post_rotateÚ_modeÚ_sizeÚsizeZtile)ÚselfÚsÚmsgZorientation© r   ú6/tmp/pip-unpacked-wheel-xela2va7/PIL/PcdImagePlugin.pyÚ_open   s    zPcdImageFile._openc                 C  s2   | j r.| jd k	st‚| j | j ¡| _| jj| _d S )N)r   Zimr   Úrotater   r   )r   r   r   r   Úload_end4   s    zPcdImageFile.load_endN)Ú__name__Ú
__module__Ú__qualname__ÚformatÚformat_descriptionr   r   r   r   r   r   r      s   r   z.pcdN)	Ú
__future__r   Ú r   r   r   Zregister_openr    Zregister_extensionr   r   r   r   Ú<module>   s   &