a
    éaÃ  ã                   @   s:   d dl Z d dlZd dlZdeeeedœdd„Zdd„ ZdS )	é    NÚ )Úold_nameÚfile_extÚextra_valueÚreturnc                 C   s:   |dks|dkr |   ||d ¡} d t ¡ tj ¡ j| ¡S )Nz.PNGz.pngz{}-{}-{})ÚreplaceÚformatÚ	shortuuidÚuuidÚdatetimeÚnowÚmicrosecond)r   r   r   © r   úX/var/www/html/photolab-dontdelete/python-photolab-01/do_photo_editor/utils/master_lib.pyÚget_unique_str   s    r   c                 C   s:   |   d¡}|  d¡ t d |¡}td|ƒ |s2d S d| S )Ni   r   r   Ú.)ÚreadÚseekÚimghdrZwhatÚprint)ÚstreamÚheaderr   r   r   r   Úvalidate_image   s    


r   )r   )r   r	   r   Ústrr   r   r   r   r   r   Ú<module>   s   