diff --git a/exif_rad.py b/exif_rad.py index d5aa56f..8ffc907 100755 --- a/exif_rad.py +++ b/exif_rad.py @@ -33,19 +33,19 @@ parser.add_argument('photos', metavar='Photo', type=str, nargs='+', args = parser.parse_args() -for photo in args.photos: - # Load Image and EXIF data - im = Image.open(photo) - exif_dict = piexif.load(im.info["exif"]) +# Import GeigerCounter log +with open(args.csv, "r") as f: + csvreader = csv.reader(filter(lambda row: row[0]!='#', f), delimiter=',', skipinitialspace=True) - picrawtime = exif_dict["Exif"][piexif.ExifIFD.DateTimeOriginal].decode('ASCII') - picisotime = datetime.strptime(picrawtime, "%Y:%m:%d %H:%M:%S") + for photo in args.photos: + # Load Image and EXIF data + im = Image.open(photo) + exif_dict = piexif.load(im.info["exif"]) - print("Timestamp of image: ", picisotime) + picrawtime = exif_dict["Exif"][piexif.ExifIFD.DateTimeOriginal].decode('ASCII') + picisotime = datetime.strptime(picrawtime, "%Y:%m:%d %H:%M:%S") - # Import GeigerCounter log - with open("testdata/test.hisdb.his", "r") as f: - csvreader = csv.reader(filter(lambda row: row[0]!='#', f), delimiter=',', skipinitialspace=True) + print("Timestamp of image: ", picisotime) for _, csvrawtime, csvrawcpm, _ in csvreader: csvisotime = datetime.fromisoformat(csvrawtime)