Sixem

Python Strip EXIF

Nov 9th, 2014
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import Image
  2. import os
  3. import sys
  4. cmdargs = str(sys.argv)
  5. Dir = str(sys.argv[1])
  6. filD = os.listdir(Dir)
  7. for fiD in filD:
  8.     if fiD.endswith((".jpg", ".jpeg")):
  9.         imG = ("%s/%s" % (Dir, fiD))
  10.         imF = open(imG)
  11.         image = Image.open(imF)
  12.         data = list(image.getdata())
  13.         iwE = Image.new(image.mode, image.size)
  14.         iwE.putdata(data)
  15.         iwE.save(imG)
  16.         print ("[OK] %s" % fiD)
Advertisement
Add Comment
Please, Sign In to add comment