From 63202b53f1a8ddcf48df30c3c4e3ef3a4eb4fc74 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 20 Oct 2020 23:59:32 +0900 Subject: [PATCH] add -p for only list unset GPS long/lat entries --- bin/reverse_geolocate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/reverse_geolocate.py b/bin/reverse_geolocate.py index 6056742..e317ee6 100755 --- a/bin/reverse_geolocate.py +++ b/bin/reverse_geolocate.py @@ -748,6 +748,13 @@ parser.add_argument('-u', '--unset-only', help='Only list unset XMP files' ) +# only list unset GPS codes +parser.add_argument('-p', '--unset-gps-only', + dest='unset_gps_only', + action='store_true', + help='Only list unset XMP files for GPS fields' + ) + # don't try to do auto adjust in list view parser.add_argument('-a', '--no-autoadjust', dest='no_autoadjust', @@ -1111,7 +1118,7 @@ for xmp_file in work_files: print("### => XMP: {}:{} => {}".format(xmp_fields[xmp_field], xmp_field, data_set[xmp_field])) if args.read_only: # view only if list all or if data is unset - if not args.unset_only or (args.unset_only and '' in data_set.values()): + if (not args.unset_only and not args.unset_gps_only) or (args.unset_only and '' in data_set.values()) or (args.unset_gps_only and (not data_set['GPSLatitude'] or not data_set['GPSLongitude'])): # for read only we print out the data formatted # headline check, do we need to print that count['read'] = printHeader(header_line.format(page_no=page_no, page_all=page_all), count['read'], header_repeat)