summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-11-28 05:24:34 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-11-28 05:24:34 +0100
commit961759d49f0da67032c066e8f1878c003e98cf43 (patch)
treebbc7f77a38e323fa015ff6e2341bf34360a4d85f
parenta355b97e8ee5a8cf584e51cdc99f7439f8930491 (diff)
Hide zero f / F values (e.g. when using a manual lens)HEADmain
-rwxr-xr-xbin/pyggle9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/pyggle b/bin/pyggle
index 5032f3b..fb167f3 100755
--- a/bin/pyggle
+++ b/bin/pyggle
@@ -137,7 +137,7 @@ class ImageHTML:
self, f_num, exposure, focal_length, focal_length35, crop_factor, iso
):
entries = list()
- if f_num is not None:
+ if f_num is not None and float(f_num) > 0:
self.f_num = f"""<span class="fnumber">f/{format_f(f_num)}</span>"""
entries.append(self.f_num)
@@ -156,7 +156,7 @@ class ImageHTML:
)
entries.append(self.exposure)
- if focal_length is not None:
+ if focal_length is not None and float(focal_length) > 0:
entry = f"{format_f(focal_length)}mm"
if focal_length35 is not None and focal_length35 != focal_length:
entry += f" (≙ {format_f(focal_length35)}mm)"
@@ -595,6 +595,9 @@ class Thumbnail:
location_cache[latlon][str(args.nominatim_zoom)] = location
except TypeError as e:
location = latlon
+ except Exception as e:
+ print(e)
+ return
self.gps = GPSData(lat, lon, location)
self.html.set_gps(self.gps)
@@ -613,7 +616,7 @@ class Thumbnail:
try:
lens = self.exif_tag["EXIF LensModel"]
- if lens:
+ if lens and str(lens):
model += f" + {lens}"
except KeyError:
# Unknown or built-in lens