summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-07-03 21:38:02 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-07-03 21:38:02 +0200
commitccb3a9e06fd54c91bcdad274d124c4a8f8d686b8 (patch)
tree232327139fe3f35a89a660b707c26d6f269c06e1
parentc33ab5cfb517b35885b3b76b0ca118d6e33adc28 (diff)
add --scrub-metadata option
-rwxr-xr-xbin/pyggle20
1 files changed, 20 insertions, 0 deletions
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)