Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Last active January 31, 2019 16:30
Show Gist options
  • Save sergiolucero/7b243a4a932b12a8663d23bee3f9a896 to your computer and use it in GitHub Desktop.
Save sergiolucero/7b243a4a932b12a8663d23bee3f9a896 to your computer and use it in GitHub Desktop.
bunch of pics to ppt
import glob, os, pptx, scipy.misc
from PIL import Image
size = 800,600
prs = pptx.Presentation()
for fn in glob.glob('*.jpg'):
img = Image.open(fn)
img.thumbnail(size, Image.ANTIALIAS)
img.save(fn)
slide = prs.slides.add_slide(prs.slide_layouts[6])
pic = slide.shapes.add_picture(fn, 0, 0)
prs.save("slideshow.pptx")
@sergiolucero
Copy link
Author

puts all JPEGs in current directory into a powerpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment