add: yield the db info for each img processed

main
rrr-marble 5 years ago
parent cbf5362588
commit 622a58984e

@ -52,8 +52,16 @@ def process_pictures():
# Q: do we strip exif from originals?
move(path.join(root, filename), DEST_ORIGINAL)
# update the database
pass
# return the freshly processed picture info
yield {
"ResizedImage": path.join(DEST_STRUNK, filename),
"OriginalImage": path.join(DEST_ORIGINAL, filename),
"DateTimeOriginal": exif["DateTimeOriginal"], # Q: normalize it?
"GPSLatitude": exif["GPSLatitude"],
"GPSLatitudeRef": exif["GPSLatitudeRef"],
"GPSLongitude": exif["GPSLongitude"],
"GPSLongitudeRef": exif["GPSLongitudeRef"],
}
def update_database():
@ -80,6 +88,8 @@ def main():
exit(1)
# process each pic and add it to the database
for pic in process_pictures():
print(pic) # just print into strout for now
if __name__ == "__main__":

Loading…
Cancel
Save