mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-19 10:47:07 +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():
|
if form.is_valid():
|
||||||
# print(f"new_image_form(): 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"]
|
descrip = form.cleaned_data["description"]
|
||||||
editor = form.cleaned_data["who_are_you"]
|
editor = form.cleaned_data["who_are_you"]
|
||||||
editor = git_string(editor)
|
editor = git_string(editor)
|
||||||
@@ -326,10 +326,10 @@ def new_image_form(request, path):
|
|||||||
# date and time from exif data
|
# date and time from exif data
|
||||||
if 36867 in exif_dict['Exif'] and 36880 in exif_dict['Exif']:
|
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()}"
|
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:
|
else:
|
||||||
year = current_expo() # replace with year from photo exif if possible
|
|
||||||
exif = None
|
exif = None
|
||||||
|
|
||||||
width, height = i.size
|
width, height = i.size
|
||||||
|
|||||||
Reference in New Issue
Block a user