o
    rf&                     @   s    d dl Z d dlmZ dd ZdS )    N)Imagec                 C   s   t j|st | dd t | D }|  d}t|D ]=\}}t j| |}t	|
d}||}|d dd}	t j||	}
||
 ||	 d|d	  d
|d  d7 }qt| d S )Nc                 S   s   g | ]}|  d r|qS ))pngjpgjpeg)lowerendswith).0img r
   C/workspaces/Masterarbeit/13_resize_and_rename_images/output_5_0S.py
<listcomp>   s    z,resize_and_rename_images.<locals>.<listcomp>zModified images resolutions:
RGB   03z.jpgz: r   z x 
)ospathexistsmakedirslistdirsort	enumeratejoinr   openconvertresizesaveprint)input_folderoutput_folder
resolutionimagesZmodified_images_infoiZimg_nameimg_pathr	   Znew_img_namenew_img_pathr
   r
   r   resize_and_rename_images   s   


$r%   )r   PILr   r%   r
   r
   r
   r   <module>   s    