From 2160b24d884991d4cfd01bacbd22939a3430be4b Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Mon, 13 May 2024 23:32:20 -0700 Subject: [PATCH] Add sampling date --- jcvi/graphics/grabseeds.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jcvi/graphics/grabseeds.py b/jcvi/graphics/grabseeds.py index df80cd32..80c4211d 100644 --- a/jcvi/graphics/grabseeds.py +++ b/jcvi/graphics/grabseeds.py @@ -10,6 +10,7 @@ import sys from collections import Counter +from datetime import date from math import cos, pi, sin from typing import Any, List, Optional, Tuple @@ -91,7 +92,7 @@ def __init__( self.circularity = 4 * pi * props.area / props.perimeter**2 self.rgb = rgb self.colorname = closest_color(rgb) - self.datetime = exif.get("exif:DateTimeOriginal", "none") + self.datetime = exif.get("exif:DateTimeOriginal", date.today()) self.rgbtag = triplet_to_rgb(rgb) self.pixeltag = f"length={self.length} width={self.width} area={self.area}" self.hashtag = " ".join((self.rgbtag, self.colorname))