From ccb3a9e06fd54c91bcdad274d124c4a8f8d686b8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 3 Jul 2021 21:38:02 +0200 Subject: add --scrub-metadata option --- bin/pyggle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'bin') diff --git a/bin/pyggle b/bin/pyggle index 4a2e74a..a7e6ec5 100755 --- a/bin/pyggle +++ b/bin/pyggle @@ -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) -- cgit v1.2.3