o
    >ed                     @  s2   d dl mZ d dlZddlmZ G dd dZdS )    )annotationsN   o8c                   @  s$   e Zd ZdZdZdd Zdd ZdS )GimpPaletteFilez'File handler for GIMP's palette format.RGBc                 C  s   dd t dD | _| d d dkrd}t|t dD ]K}| }|s( nBtd|r/qt|dkr;d	}t|ttt	|
 d d
 }t|d
krTd}t|t|d t|d  t|d  | j|< qd| j| _d S )Nc                 S  s   g | ]}t |d  qS )   r   ).0i r   T/var/www/html/humari/django-venv/lib/python3.10/site-packages/PIL/GimpPaletteFile.py
<listcomp>   s    z,GimpPaletteFile.__init__.<locals>.<listcomp>      s   GIMP Paletteznot a GIMP palette files   \w+:|#d   zbad palette filer   zbad palette entryr   r          )rangepalettereadlineSyntaxErrorrematchlentuplemapintsplit
ValueErrorr   join)selffpmsgr
   svr   r   r   __init__   s&   ,zGimpPaletteFile.__init__c                 C  s   | j | jfS )N)r   rawmode)r    r   r   r   
getpalette8   s   zGimpPaletteFile.getpaletteN)__name__
__module____qualname____doc__r&   r%   r'   r   r   r   r   r      s
    r   )
__future__r   r   _binaryr   r   r   r   r   r   <module>   s   