Created
August 7, 2018 15:27
-
-
Save eyJhb/e8faf1ea57bc4b70e03e61549137f6ca to your computer and use it in GitHub Desktop.
Simple image sorter for screenshots and photos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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