mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-18 22:37:10 +00:00
year fixed if not in exif data
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user