diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-07-03 21:38:02 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-07-03 21:38:02 +0200 |
commit | ccb3a9e06fd54c91bcdad274d124c4a8f8d686b8 (patch) | |
tree | 232327139fe3f35a89a660b707c26d6f269c06e1 | |
parent | c33ab5cfb517b35885b3b76b0ca118d6e33adc28 (diff) |
add --scrub-metadata option
-rwxr-xr-x | bin/pyggle | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -537,6 +537,11 @@ if __name__ == "__main__": help="Zoom Level for reverse geocoding", ) parser.add_argument("--reverse", action="store_true", help="Reverse sort order") + parser.add_argument( + "--scrub-metadata", + action="store_true", + help="Scrub EXIF metadata from images (IN-PLACE EDIT)", + ) parser.add_argument("--size", type=int, default=250, help="Thumbnail size [px]") parser.add_argument( "--sort", @@ -585,6 +590,21 @@ if __name__ == "__main__": Thumbnail(filename, im, size=args.size, with_gps=args.with_nominatim) ) + if args.scrub_metadata: + subprocess.run( + [ + "exiftool", + "-q", + "-overwrite_original", + "-EXIF:SerialNumber=", + "-EXIF:LensSerialNumber=", + "-Makernotes:all=", + "-geotag=", + "-ThumbnailImage=", + filename, + ] + ) + if args.sort == "time": thumbnails = sorted(thumbnails, key=lambda t: t.exif_dt, reverse=args.reverse) |