Skip to content

Commit

Permalink
Allow setting ownership template if date is empty
Browse files Browse the repository at this point in the history
This should fix bug #239 (The problem occurs because I didn't update
this module when changing "empty" metadata from 'None' to an empty
Photini data type.)
  • Loading branch information
jim-easterbrook committed Jun 5, 2024
1 parent bad7efb commit 18b06fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/photini/ownership.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Photini - a simple photo metadata editor.
## http://github.com/jim-easterbrook/Photini
## Copyright (C) 2021-23 Jim Easterbrook [email protected]
## Copyright (C) 2021-24 Jim Easterbrook [email protected]
##
## This program is free software: you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -349,10 +349,10 @@ def init_template(self):
template = {}
for image in self.app.image_list.get_selected_images():
date_taken = image.metadata.date_taken
if date_taken is None:
date_taken = datetime.now()
else:
if date_taken:
date_taken = date_taken['datetime']
else:
date_taken = datetime.now()
year = str(date_taken.year)
for key in self.widgets:
value = self._get_value(image, key)
Expand Down

0 comments on commit 18b06fd

Please sign in to comment.