I am working on a project and my first task is converting some tiff files to jpeg. I am working with a script i previously used and it worked so i modified the path to fix my current project. i want to convert these files and then save them in the same location. my script will run and i added print to make sure the program can access the files correctly but if i add print i the loop after im.save() i just get NONE so something isn't correct here but i cant figure out what im doing incorrectly.
#!/usr/bin/env python3
import os
import sys
from PIL import Image
cwd = os.getcwd()
path = cwd + '/supplier-data/images/'
for files in os.listdir(path):
print(files)
if not files.startswith('.') and not files.startswith('README')and not files.startswith('LICENSE'):
with Image.open(path + files) as im:
im=im.convert('RGB').resize((600, 400))
im=im.save(path + files, 'jpeg', quality=100)
print(im)