From 4a7de7b5186812927292694f3e25f1620b1f15d9 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sat, 14 Mar 2020 20:42:01 +0100 Subject: [PATCH] Removed default value fuckery. The matching class wil have to provide proper values. --- functions.py | 10 +++++----- rad_tag.py | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/functions.py b/functions.py index 1b6ada2..2c5b3ef 100644 --- a/functions.py +++ b/functions.py @@ -107,9 +107,9 @@ class Exif: Exif-Comment that has been written (incl. radiation) ''' - def __init__(self, photo, dry_run, radiation=False, latitude=False, longitude=False, elevation=False): - self.write_exif = self._write_exif(photo, radiation, latitude, - longitude, elevation, dry_run) + def __init__(self, photo, dry_run, radiation, latitude, longitude, elevation): + self.write_exif = self._write_exif(photo, dry_run, radiation, latitude, + longitude, elevation) def __repr__(self): return 'Position: %s, %s: %s ' % self.write_exif @@ -133,7 +133,7 @@ class Exif: metadata = pyexiv2.ImageMetadata(photo) metadata.read() - if latitude or longitude: + if latitude and longitude: latitude_degree = self._to_degree(latitude, ["S", "N"]) longitude_degree = self._to_degree(longitude, ["W", "E"]) @@ -163,7 +163,7 @@ class Exif: if radiation: # Set new UserComment - new_comment = 'Radiation ☢ ' + str(radiation) + ' µS/h' + new_comment = 'Radiation ☢ : ' + str(radiation) + ' µS/h' metadata['Exif.Photo.UserComment'] = new_comment else: new_comment = None diff --git a/rad_tag.py b/rad_tag.py index 43d3415..8432c02 100755 --- a/rad_tag.py +++ b/rad_tag.py @@ -90,13 +90,14 @@ for src_photo in args.photos: print(photo.get_target_photo, photo.get_date) # Here the matching magic has to happen - #latitude = 51.0234024 - #longitude = 7.248347 + + latitude = 51.0234024 + longitude = 7.248347 radiation = 9001.15 - #elevation = 56.079345703125 + elevation = 56.079345703125 # Write exif data - exif_tags = Exif(photo=photo.get_target_photo, dry_run=args.dry) + exif_tags = Exif(photo.get_target_photo, args.dry, radiation, latitude, longitude, elevation) print(exif_tags) # Print table header