I\'m trying to run the following script which simply reads and image and saves it again:
from PIL import Image
import os
rootdir = \'/home/user/Desktop/samp
You're going to need to provide a fully qualified path, because file
holds only the tail, not the entire path.
You can use os.path.join
to join the root
to the tail:
for root, dirs, files in os.walk(rootdir):
for file in files:
path = os.path.join(root, file)
im = Image.open(path)
im.save(path)