Advertisement
here2share

# Strip_EXIF.py

Sep 28th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. # Strip_EXIF.py
  2.  
  3. import Image
  4. import os
  5. import sys
  6. Dir = '/'.join(sys.argv[-1].split('\\')[:-1])
  7. print Dir
  8. filD = os.listdir(Dir)
  9. for fiD in filD:
  10.     print fiD
  11.     if fiD.endswith((".jpg", ".jpeg")):
  12.         imG = ("%s/%s" % (Dir, fiD))
  13.         print "Accessing... %s" % fiD
  14.         imF = open(imG)
  15.         image = Image.open(imF)
  16.         data = list(image.getdata())
  17.         iwE = Image.new(image.mode, image.size)
  18.         iwE.putdata(data)
  19.         iwE.save(imG)
  20.         print "[OK] %s" % fiD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement