diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-05-15 11:03:18 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-05-15 11:03:18 +0200 |
commit | dee4a265f9e0bbac7e1cf3921164e30f8c867ce2 (patch) | |
tree | 3d38700b1b15b580d9d6594fd04ade8b94de8ca0 /bin | |
parent | 677773ee975073a8b4557796c22f4325a4cf6664 (diff) |
support sorting thumbnails by exif time
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pyggle | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) |