Skip to content

Instantly share code, notes, and snippets.

@wakwanza
Created November 17, 2016 09:54
Show Gist options
  • Save wakwanza/e25057aa897effe1341047d907784e3b to your computer and use it in GitHub Desktop.
Save wakwanza/e25057aa897effe1341047d907784e3b to your computer and use it in GitHub Desktop.
Optimize pngs and remove the EXIF data embedded in them
#!/usr/bin/python
import os
import subprocess
for root, dirs, files in os.walk("."):
for file in files:
if file.endswith(".png"):
fpath = os.join.path(root,file)
subprocess.call(["exiv2","delete",fpath]); subprocess.call(["optipng","-o7",fpath])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment