# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
from PIL import Image
import os
 
def resize_image(input_image_path,output_image_path,size):
    original_image = Image.open(input_image_path)
    width, height = resized_image.size
    if width<height:
        size=(150, 180)
    resized_image = original_image.resize(size)
    resized_image.save(output_image_path)
    
    
for file in os.listdir('/Users/mila1/Downloads/test/'):
    resize_image(input_image_path='/Users/mila1/Downloads/test/'+file,
                 output_image_path='/Users/mila1/Downloads/test/sm'+file,
                 size=(300, 180))
# -



StarcoderdataJupyterScriptsDedupFiltered