Add exif keywords

This commit is contained in:
Nyymix 2025-04-09 09:22:46 +03:00
parent eb74c65b5b
commit 83662c2910
2 changed files with 14 additions and 0 deletions

View file

@ -107,6 +107,10 @@
<div class="uk-width-expand" uk-leader>Focal Length in 35mm</div>
<div>{{ photo.exif.FocalLengthIn35mmFilm|exif_focallength }}</div>
</div>
<div class="uk-grid-small" uk-grid>
<div class="uk-width-expand" uk-leader>Keywords</div>
<div>{{ photo.exif.Keywords|exif_keywords }}</div>
</div>
</div>
</li>
</ul>

View file

@ -43,5 +43,15 @@ def exif_isospeedratings(value):
"""Convert ISO Speed Ratings"""
try:
return f"{int(value)}"
except:
return ""
@register.filter(name="exif_keywords")
def exif_keywords(value):
"""Convert Keywords"""
try:
words = list(dict.fromkeys(value))
return ", ".join(words)
except:
return ""