summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qcam/dng_writer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp
index 84709088..77e2333b 100644
--- a/src/qcam/dng_writer.cpp
+++ b/src/qcam/dng_writer.cpp
@@ -427,6 +427,23 @@ int DNGWriter::write(const char *filename, const Camera *camera,
/* Create a new IFD for the EXIF data and fill it. */
TIFFCreateEXIFDirectory(tif);
+ /* Store creation time. */
+ time_t rawtime;
+ struct tm *timeinfo;
+ char strTime[20];
+
+ time(&rawtime);
+ timeinfo = localtime(&rawtime);
+ strftime(strTime, 20, "%Y:%m:%d %H:%M:%S", timeinfo);
+
+ /*
+ * \todo Handle timezone information by setting OffsetTimeOriginal and
+ * OffsetTimeDigitized once libtiff catches up to the specification and
+ * has EXIFTAG_ defines to handle them.
+ */
+ TIFFSetField(tif, EXIFTAG_DATETIMEORIGINAL, strTime);
+ TIFFSetField(tif, EXIFTAG_DATETIMEDIGITIZED, strTime);
+
if (metadata.contains(controls::AnalogueGain)) {
float gain = metadata.get(controls::AnalogueGain);
uint16_t iso = std::min(std::max(gain * 100, 0.0f), 65535.0f);