Comment out or delete this line.
#fp = open(original_path)Make sure that pillow is the newest.
pip install pillow --upgradeNow i test code with one image,as the loop dos just same with more images.
C:\code\img λ ptpython >>> import PIL.Image >>> # Now open directly in pillow,do not need a file object >>> img = PIL.Image.open('day.png') >>> # Set 100 x 100 which is set first in code and remove "self" for this test. >>> width = 100 >>> height = 100 >>> resizedImage = img.resize((width, height), PIL.Image.ANTIALIAS) # Test what's done in code >>> # Show image is now resized to 100 x 100 >>> resizedImage.show()Do of course work the same with a path when not in same folder as image,as you use in the code.
>>> original_path = 'C:\\code\\img\\day.png' >>> img = PIL.Image.open(original_path) >>> img.show()