From 6e702b3b3b09baac815e76ee0aef6f94699f18f9 Mon Sep 17 00:00:00 2001 From: Antoine VAN ELSTRAETE Date: Fri, 17 May 2019 18:42:23 +0200 Subject: [PATCH] Analyze only exif enabled files --- exv.py | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/exv.py b/exv.py index 9499933..f9cf59d 100755 --- a/exv.py +++ b/exv.py @@ -7,6 +7,30 @@ import json from os.path import isfile, isdir from os import walk +TYPES = [ + "JPEG", + "JPG", + "EXV", + "CR2", + "CRW", + "MRW", + "TIFF", + "TIF", + "WEBP", + "DNG", + "NEF", + "FEF", + "ARW", + "RW2", + "SR2", + "SRW", + "ORF", + "PNG", + "PGF", + "RAF", + "PSD", + "JP2" + ] def extractor(input_files, start, end, recursive): if not isinstance(input_files, type(list())): @@ -30,7 +54,8 @@ def extractor(input_files, start, end, recursive): if isdir(item): for (dirpath, dirnames, filenames) in walk(item): for filename in filenames: - files.append("{}/{}".format(dirpath, filename)) + if filename.split(".")[-1].upper() in TYPES: + files.append("{}/{}".format(dirpath, filename)) if not recursive: break else: