summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-06-18 22:59:46 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-06-18 22:59:46 +0200
commitc33ab5cfb517b35885b3b76b0ca118d6e33adc28 (patch)
tree36f431014f2ddc66616aa46311ee1d852212dc4d
parent4824c7d4d65ec6738e05eaf71d516f5ec68a6b15 (diff)
add external thumbnail support, e.g. for video files
-rwxr-xr-xbin/pyggle8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/pyggle b/bin/pyggle
index 1c29295..4a2e74a 100755
--- a/bin/pyggle
+++ b/bin/pyggle
@@ -573,7 +573,13 @@ if __name__ == "__main__":
try:
im = Image.open(filename)
except PIL.UnidentifiedImageError:
- continue
+ try:
+ im = Image.open(f".thumbnail.for.{filename}")
+ except FileNotFoundError:
+ continue
+ except PIL.UnidentifiedImageError:
+ # perhaps raise a warning?
+ continue
thumbnails.append(
Thumbnail(filename, im, size=args.size, with_gps=args.with_nominatim)