o
    wrfQ                     @   s.   d dl Z d dlmZ dededefddZdS )    N)Imageinput_folderoutput_folder
resolutionc              
   C   s   t j|st | tdd t | D }g }t|ddD ]K\}}t j| |}t	|3}|
d}||}|dd}	|t j||	 ||	 d|d	  d
|d   W d    n1 sew   Y  qtd |D ]}
t|
 qqd S )Nc                 S   s   g | ]}|  d r|qS ))ZpngZjpgZjpeg)lowerendswith).0f r
   C/workspaces/Masterarbeit/13_resize_and_rename_images/output_1_0S.py
<listcomp>
   s    z,resize_and_rename_images.<locals>.<listcomp>   )startRGBZ03z.jpgz: r   z x zModified images resolutions:)ospathexistsmakedirssortedlistdir	enumeratejoinr   openconvertresizesaveappendprint)r   r   r   Zimage_filesZresolutionsifilenameZimg_pathimgZnew_filenameresr
   r
   r   resize_and_rename_images   s$   


$
r"   )r   PILr   strtupler"   r
   r
   r
   r   <module>   s    