Skip to content

Instantly share code, notes, and snippets.

@eyJhb
Created August 7, 2018 15:27
Show Gist options
  • Save eyJhb/e8faf1ea57bc4b70e03e61549137f6ca to your computer and use it in GitHub Desktop.
Save eyJhb/e8faf1ea57bc4b70e03e61549137f6ca to your computer and use it in GitHub Desktop.
Simple image sorter for screenshots and photos
import exifread
import shutil
import os
for f in os.listdir("images/"):
if not os.path.isfile("images/"+f):
continue
fb = open("images/"+f, "rb")
tags = exifread.process_file(fb)
fb.close()
# image
if len(tags) > 0:
target_loc = "0-billeder/"+f
#screenshot
else:
target_loc = "0-screenshot/"+f
shutil.move("images/"+f, target_loc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment