I am trying to read pictures from the file and inserting them into the slide. So far its working fine. But today its giving me an error : "'Image' object has no attribute '_ext'". I can see that image is same as other images and it is a .jpg image. I dont know why it is giving me this error. ValueError: unsupported image format, expected one of: dict_keys(['BMP', 'GIF', 'JPEG', 'PNG', 'TIFF', 'WMF']), got 'MPO'. I am using :
for file in os.listdir("C:/Users/me/Desktop/imageSourceFile") :
print(file)
pic = Slide.shapes.add_picture("C:/Users/me/Desktop/imageSourceFile"
+ '/' + file, left=Inches(3), top=Inches(3), width= Inches(3),
height=Inches(3))
prs.save('C:/Users/me/Desktop/mypresentation.pptx')
Except this picture everything else is getting pulled into the slides. I am not able to understand what to do with this error. Thank you in advance.