Python script parameter not working as it supposed to

I tried to use on my MacBook a script I found that does 1. changes some filters of an imported image and 2. changes the metadata of it. After adjusting a bit it worked but the metadata did not change using the parameters from the script as you can see. (On the left is the original image and on the right is the exported one by the script). My point is, how can the data that is written on the script be applied? (a random device name, a random creation date etc). Any other improvement is welcome please.

The script code i used:

import os
import random
import shutil
from PIL import Image, ImageEnhance, ImageFilter
import piexif
import datetime


def clean_photo(photo_path, output_path):
    # Load the photo
    photo = Image.open(photo_path)

    if "exif" in photo.info:
        exif_dict = piexif.load(photo.info["exif"])
        exif_dict.clear()
        exif_bytes = piexif.dump(exif_dict)
        photo_info = photo.info.copy()
        photo_info["exif"] = exif_bytes
    else:
        photo_info = photo.info.copy()

    photo.info["Location"] = "United States"

    exposure = random.randint(-2, 2)
    brilliance = random.randint(-2, 2)
    highlights = random.randint(-2, 2)
    contrast = random.randint(-2, 2)
    brightness = random.randint(-2, 2)
    saturation = random.randint(-2, 2)
    vibrancy = random.randint(-2, 2)

    margin_pixels = random.randint(5, 20)  # Number of pixels to cut from each margin
    width, height = photo.size
    left = margin_pixels
    upper = margin_pixels
    right = width - margin_pixels
    lower = height - margin_pixels
    photo = photo.crop((left, upper, right, lower))
    photo = photo.filter(ImageFilter.GaussianBlur(radius=random.randint(1, 3)))

    camera_make = random.choice(["Canon", "Nikon", "Sony", "Fuji"])
    camera_model = random.choice(["Model A", "Model B", "Model C"])

    if "exif" in photo.info:
        exif_dict = piexif.load(photo.info["exif"])
        exif_dict["0th"][piexif.ImageIFD.Make] = camera_make
        exif_dict["0th"][piexif.ImageIFD.Model] = camera_model
    else:
        exif_dict = {"0th": {piexif.ImageIFD.Make: camera_make, piexif.ImageIFD.Model: camera_model}}
    exif_bytes = piexif.dump(exif_dict)
    photo_info["exif"] = exif_bytes

    random_date = datetime.datetime(
        random.randint(2000, 2021),
        random.randint(1, 12),
        random.randint(1, 28),
        random.randint(0, 23),
        random.randint(0, 59),
        random.randint(0, 59)
    )
    creation_date = random_date.strftime("%Y:%m:%d %H:%M:%S")

    if "exif" in photo_info:
        exif_dict = piexif.load(photo_info["exif"])
        exif_dict["0th"][piexif.ImageIFD.DateTime] = creation_date.encode("utf-8")
    else:
        exif_dict = {"0th": {piexif.ImageIFD.DateTime: creation_date.encode("utf-8")}}
    exif_bytes = piexif.dump(exif_dict)
    photo_info["exif"] = exif_bytes

    random_filename = ''.join(random.choices('01234567890', k=10))
    filename, ext = os.path.splitext(photo_path)
    output_filename = f"IMG_{random_filename}{ext}"

    output_file_path = os.path.join(output_path, output_filename)
    photo.save(output_file_path)


def clean_photos(main_folder, usedpics_folder, num_iterations):
    output_folder = os.path.join(main_folder, "CleanedPics")
    os.makedirs(output_folder, exist_ok=True)

    usedpics_path = os.path.join(main_folder, usedpics_folder)
    usedpics = os.listdir(usedpics_path)

    for i in range(num_iterations):
        iteration_folder = os.path.join(main_folder, f"Iteration_{i+1}")
        os.makedirs(iteration_folder, exist_ok=True)

        for usedpic in usedpics:
            usedpic_path = os.path.join(usedpics_path, usedpic)
            clean_photo(usedpic_path, iteration_folder)


main_folder = "/Users/macpro/Downloads/script”
usedpics_folder = “used”

num_iterations = 5

clean_photos(main_folder, usedpics_folder, num_iterations)
```[enter image description here](https://i.sstatic.net/xFW4Eg5i.jpg)


I am expecting some more experienced people to help me out and correct the code or give another suggestion

New contributor

Alexnovikov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật