Renamed photo class attribute.

Figured how to acces class objects.
Moved write_exif to own Exif class to compile GPS coords and write them all.
This commit is contained in:
2020-03-12 19:24:27 +01:00
parent 2ad8b4a1fb
commit f07eb0c691
2 changed files with 20 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ DateTimeOriginal from Exif tag to DateTime in a csv log
of a GeigerMuellerCounter and writes its value to the UserComment
Exif tag in µS/h '''
from datetime import datetime
import csv
import argparse
import pytz
@@ -74,10 +75,9 @@ if args.gpx is not None:
for track in gpx_reader.tracks:
for segment in track.segments:
for point in segment.points:
position = [point.time, point.latitude, point.longitude]
position = [point.time, point.latitude, point.longitude, point.elevation]
position_list.append(position)
#print(position_list)
# print(position_list)
# Inform the user about what is going to happen
if args.dry is True:
@@ -90,13 +90,15 @@ else:
for src_photo in args.photos:
photo = Photo(src_photo, local_timezone, args.outdir, args.dry)
print(photo)
print(photo.get_target_photo, photo.get_date)
# Here the matching magic has to happen
latitude = '51.0234024'
longitude = '7.248347'
radiation = '9001'
# Write exif data
# exif_tags = Photo.write_exif(photo, radiation, latitude, longitude, args.dry)
# print(exif_tags)
#exif_tags = Photo.write_exif(photo.get_target_photo, radiation, latitude, longitude, args.dry)
#print(exif_tags)
# Print table header
print('{:<15} {:<25} {:<22}'.format('filename', 'date / time', 'Exif UserComment'))
print('{:<15} {:<25} {:<22}'.format('filename', 'date / time', 'Exif UserComment'))