Removed default value fuckery. The matching class wil have to provide proper values.

This commit is contained in:
Marcus Scholz 2020-03-14 20:42:01 +01:00
parent 13555a0505
commit 4a7de7b518
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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