From 0330e1bc5b1620769262b7563bc8384a6b08d875 Mon Sep 17 00:00:00 2001 From: rrr-marble Date: Thu, 1 Jul 2021 21:30:33 +0300 Subject: [PATCH] add: get all the imgs from cmd provided dir --- util/import_photos.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/import_photos.py b/util/import_photos.py index d405f8e..84978a4 100644 --- a/util/import_photos.py +++ b/util/import_photos.py @@ -25,6 +25,13 @@ def process_pictures(): Return a dict for each image processed for database collection. """ # walk every pic + # We only care about files in the root of the path + # Ignore any nested directories + (root, _, filenames) = next(walk(argv[1], topdown=True), (None, None, [])) + for filename in filenames: + # skip any non-image files + if not filetype.image_match(path.join(root, filename)): + continue # process it with imagemagick # move them to the processed folder # update the database