diff --git a/main.py b/main.py index 7d1d008..ce70f90 100644 --- a/main.py +++ b/main.py @@ -18,21 +18,6 @@ def get_datetime_from_str(time: str): return dt.strptime(time, format_string) -def print_memory_info(memory: json): - """ - Takes a memory object from the ``memories.json`` file and prints out all necessarily information like: - - names from the images - - the taken time - - the location if available - """ - print(" - BeReal Moment: %s\n - Time Taken: %s\n - Front Image: %s\n - Back Image: %s\n - Location: %s\n - isLate: %s" - % (memory['berealMoment'], - memory['takenTime'], - get_img_filename(memory['frontImage']), get_img_filename(memory['backImage']), - get_memory_location(memory), - memory['isLate'])) - - def apply_memory_on_imgs(memory: json): """ Makes a copy of the front and back images and adds information from the memory object as exif tags to the image @@ -55,23 +40,10 @@ def apply_memory_on_imgs(memory: json): params=["-P", "-overwrite_original"]) - - if __name__ == '__main__': f = open('memories.json') - apply_memory_on_imgs(json.load(f)[0]) - - # et().set_tags("2024-09-01_12-54-39_front.jpg", tags={"File:FileCreateDate": dt.strftime(dt.now(), "%Y:%m:%d %H:%M:%S")}, params=["-P", "-overwrite_original"]) - # n = 0 - # for i in json.load(f): - # print("\nBeReal Nr. %s: " % n) - # print_memory_info(i) - # n+=1 - - # for d in et().get_metadata("./Photos/post/ZB_-vUE7j2JePeEN.webp"): - # for k, v in d.items(): - # print(f"{k} = {v}") - + for i in json.load(f): + apply_memory_on_imgs(i) f.close()