summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-05-15 11:03:18 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-05-15 11:03:18 +0200
commitdee4a265f9e0bbac7e1cf3921164e30f8c867ce2 (patch)
tree3d38700b1b15b580d9d6594fd04ade8b94de8ca0
parent677773ee975073a8b4557796c22f4325a4cf6664 (diff)
support sorting thumbnails by exif time
-rwxr-xr-xbin/pyggle4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/pyggle b/bin/pyggle
index ecef2b1..92f055c 100755
--- a/bin/pyggle
+++ b/bin/pyggle
@@ -330,6 +330,7 @@ if __name__ == "__main__":
help="Zoom Level for reverse geocoding",
)
parser.add_argument("--size", type=int, default=250, help="Thumbnail size [px]")
+ parser.add_argument("--sort", type=str, default="none", help="sort images")
parser.add_argument(
"--spacing", type=float, default=1.1, help="Thumbnail spacing ratio"
)
@@ -363,6 +364,9 @@ if __name__ == "__main__":
Thumbnail(filename, im, size=args.size, with_gps=args.with_nominatim)
)
+ if args.sort == "time":
+ thumbnails = sorted(thumbnails, key=lambda t: t.exif_dt)
+
for i, thumbnail in enumerate(thumbnails):
html_buf += thumbnail.to_html(i)