am ead2b496: am 871af5c3: Merge commit \'64af6148cfd55ad55ea491473ed42c168299c94e\' into HEAD

* commit 'ead2b4961589267398006d83fe2a91c66b42b442':
diff --git a/exif.c b/exif.c
index 30cd66d..472c45e 100644
--- a/exif.c
+++ b/exif.c
@@ -711,12 +711,37 @@
                 strncpy(ImageInfo.CameraModel, (char *)ValuePtr, ByteCount < 39 ? ByteCount : 39);
                 break;
 
+            case TAG_SUBSEC_TIME:
+                strlcpy(ImageInfo.SubSecTime, (char *)ValuePtr, sizeof(ImageInfo.SubSecTime));
+                break;
+
+            case TAG_SUBSEC_TIME_ORIG:
+                strlcpy(ImageInfo.SubSecTimeOrig, (char *)ValuePtr,
+                        sizeof(ImageInfo.SubSecTimeOrig));
+                break;
+
+            case TAG_SUBSEC_TIME_DIG:
+                strlcpy(ImageInfo.SubSecTimeDig, (char *)ValuePtr,
+                        sizeof(ImageInfo.SubSecTimeDig));
+                break;
+
+            case TAG_DATETIME_DIGITIZED:
+                strlcpy(ImageInfo.DigitizedTime, (char *)ValuePtr,
+                        sizeof(ImageInfo.DigitizedTime));
+
+                if (ImageInfo.numDateTimeTags >= MAX_DATE_COPIES){
+                    ErrNonfatal("More than %d date fields!  This is nuts", MAX_DATE_COPIES, 0);
+                    break;
+                }
+                ImageInfo.DateTimeOffsets[ImageInfo.numDateTimeTags++] =
+                    (char *)ValuePtr - (char *)OffsetBase;
+                break;
+
             case TAG_DATETIME_ORIGINAL:
                 // If we get a DATETIME_ORIGINAL, we use that one.
                 strncpy(ImageInfo.DateTime, (char *)ValuePtr, 19);
                 // Fallthru...
 
-            case TAG_DATETIME_DIGITIZED:
             case TAG_DATETIME:
                 if (!isdigit(ImageInfo.DateTime[0])){
                     // If we don't already have a DATETIME_ORIGINAL, use whatever
diff --git a/jhead.h b/jhead.h
index a3825e8..0c4ccbb 100644
--- a/jhead.h
+++ b/jhead.h
@@ -67,6 +67,12 @@
 // i.e.: 11 * 6 + 3(‘/’) + 2(’,’) + 1(\0) = 72
 #define MAX_BUF_SIZE    72
 
+// Sub second tag string length (including null termination character), with
+// nano-second precision. e.g. 0.123456789s is represented as a null terminated
+// string "123456789". Although it can be any length, it is limited to 9 digits
+// here as we limit the precision to nano-second.
+#define SUB_SEC_SIZE    10
+
 typedef struct {
     uint32_t num;
     uint32_t denom;
@@ -83,6 +89,13 @@
     char  CameraMake   [32];
     char  CameraModel  [40];
     char  DateTime     [20];
+    char  DigitizedTime[20];
+    // Fractions of seconds for DateTime tag, with milisecond precision.
+    char  SubSecTime[SUB_SEC_SIZE];
+    // Fractions of seconds for DateTimeOriginal tag, with milisecond precision.
+    char  SubSecTimeOrig[SUB_SEC_SIZE];
+    // Fractions of seconds for DateTimeDigitized tag, with milisecond precision.
+    char  SubSecTimeDig[SUB_SEC_SIZE];
     int   Height, Width;
     int   Orientation;
     int   IsColor;
diff --git a/main.c b/main.c
index ace5bdd..c36683b 100644
--- a/main.c
+++ b/main.c
@@ -602,6 +602,23 @@
         bufLen = addKeyValueString(&buf, bufLen, "DateTime", ImageInfo.DateTime);
         if (bufLen == 0) return NULL;
     }
+    if (ImageInfo.DigitizedTime[0]) {
+        bufLen = addKeyValueString(&buf, bufLen, "DateTimeDigitized", ImageInfo.DigitizedTime);
+        if (bufLen == 0) return NULL;
+    }
+    if (ImageInfo.SubSecTime[0]) {
+        bufLen = addKeyValueString(&buf, bufLen, "SubSecTime", ImageInfo.SubSecTime);
+        if (bufLen == 0) return NULL;
+    }
+    if (ImageInfo.SubSecTimeOrig[0]) {
+        bufLen = addKeyValueString(&buf, bufLen, "SubSecTimeOriginal", ImageInfo.SubSecTimeOrig);
+        if (bufLen == 0) return NULL;
+    }
+    if (ImageInfo.SubSecTimeDig[0]) {
+        bufLen = addKeyValueString(&buf, bufLen, "SubSecTimeDigitized", ImageInfo.SubSecTimeDig);
+        if (bufLen == 0) return NULL;
+    }
+
     bufLen = addKeyValueInt(&buf, bufLen, "ImageWidth", ImageInfo.Width);
     if (bufLen == 0) return NULL;