diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-03-08 07:09:50 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-03-08 07:09:50 +0000 |
commit | 9a4916cc58919b54006bc0866cb551a8761dfce8 (patch) | |
tree | 9885db50c63b5a150e90184b629e6aa390257ac2 | |
parent | ec3f513308c7e2c5ff6aef8535d3d28f5f785313 (diff) | |
download | troggle-9a4916cc58919b54006bc0866cb551a8761dfce8.tar.gz troggle-9a4916cc58919b54006bc0866cb551a8761dfce8.tar.bz2 troggle-9a4916cc58919b54006bc0866cb551a8761dfce8.zip |
year fixed if not in exif data
-rw-r--r-- | core/views/editor_helpers.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py index e3c0d76..7b4a4e1 100644 --- a/core/views/editor_helpers.py +++ b/core/views/editor_helpers.py @@ -295,7 +295,7 @@ def new_image_form(request, path): if form.is_valid(): # print(f"new_image_form(): form is valid ") - year = form.cleaned_data["year"] + fyear = form.cleaned_data["year"] descrip = form.cleaned_data["description"] editor = form.cleaned_data["who_are_you"] editor = git_string(editor) @@ -326,10 +326,10 @@ def new_image_form(request, path): # date and time from exif data if 36867 in exif_dict['Exif'] and 36880 in exif_dict['Exif']: descrip += f"\n\n{exif_dict['Exif'][36867].decode()} {exif_dict['Exif'][36880].decode()}" - if not year: - year = exif_dict['Exif'][36867].decode()[:4] + year = exif_dict['Exif'][36867].decode()[:4] + else: + year = fyear # replace with year from photo exif if possible else: - year = current_expo() # replace with year from photo exif if possible exif = None width, height = i.size |