Changed CSV variable, only write Exif tags that hava values to fill in.

This commit is contained in:
Marcus Scholz 2020-03-10 21:53:43 +01:00
parent c19a94374e
commit 92b08170f2
2 changed files with 6 additions and 4 deletions

View File

@ -61,7 +61,9 @@ class Photo:
# Create metadata object with all data to write
for key, value in zip(keys, values):
metadata[key] = pyexiv2.ExifTag(key, value)
# Only create object if there is anything to fill with
if value is not None:
metadata[key] = pyexiv2.ExifTag(key, value)
# Write Exif tags to file, if not in dry-run mode
if dry_run == 'True':

View File

@ -56,10 +56,10 @@ position_list = []
# Import GeigerCounter log
with open(args.csv, "r") as f:
csv_reader = csv.reader(filter(lambda row: row[0] != '#', f),
delimiter=',', skipinitialspace=True)
csv = csv.reader(filter(lambda row: row[0] != '#', f),
delimiter=',', skipinitialspace=True)
for _, csv_raw_time, csv_raw_cpm, _ in csv_reader:
for _, csv_raw_time, csv_raw_cpm, _ in csv:
radiation = Radiation(csv_raw_time, csv_raw_cpm, local_timezone, args.sifactor)
radiation_list.append(radiation)
#print(radiation_list)