Rezing gambar seluruh dataset di Python

f = r'C://Users/xx/Desktop/testimages'
for file in os.listdir(f):
    f_img = f+"/"+file
    img = Image.open(f_img)
    img = img.resize((2296,1724))
    img.save(f_img)
Glorious Gannet