From dee4a265f9e0bbac7e1cf3921164e30f8c867ce2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 15 May 2021 11:03:18 +0200 Subject: support sorting thumbnails by exif time --- bin/pyggle | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin') 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) -- cgit v1.2.3