diff --git a/lib/resize_images.py b/lib/resize_images.py index 6300e0e..272e309 100644 --- a/lib/resize_images.py +++ b/lib/resize_images.py @@ -3,15 +3,14 @@ from PIL import Image from tqdm import tqdm -def resize_images(folder_path): +def resize_images(folder_path, processed_players): # Loop through all files in the folder - for filename in tqdm(os.listdir(folder_path), desc="Resizing Images"): - # Check if the file is a PNG image - if filename.endswith('.png'): - # Full path to the image file - image_path = os.path.join(folder_path, filename) - # Open the image file - with Image.open(image_path) as img: - # Resize the image to 256x256 - img_resized = img.resize((256, 256)) - img_resized.save(os.path.join(folder_path, filename)) \ No newline at end of file + for player in tqdm(processed_players, desc="Resizing Images"): + player = f"{player}.png" + # Full path to the image file + image_path = os.path.join(folder_path, player) + # Open the image file + with Image.open(image_path) as img: + # Resize the image to 256x256 + img_resized = img.resize((256, 256)) + img_resized.save(os.path.join(folder_path, player)) \ No newline at end of file