From 9a4916cc58919b54006bc0866cb551a8761dfce8 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 8 Mar 2025 07:09:50 +0000 Subject: year fixed if not in exif data --- core/views/editor_helpers.py | 8 ++++---- 1 file 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 -- cgit v1.2.3