I am getting this error message:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
From this code:
from PIL import Image
import os
image_name = "mypic"
count = 0
for filename in os.listdir('pictures'):
if filename.endswith('.jpg'):
image_file = open('pictures/' +filename)
image = Image.open(image_file)
# next 3 lines strip exif
data = list(image.getdata())
image_without_exif = Image.new(image.mode, image.size)
image_without_exif.putdata(data)
image_without_exif.save('new-pictures/' + image_name + str(count) + '.jpg')
count = count + 1;
Not sure why, as this was working yesterday...