Patch Detail
Show a patch.
GET /api/1.1/patches/4020/?format=api
{ "id": 4020, "url": "https://patchwork.libcamera.org/api/1.1/patches/4020/?format=api", "web_url": "https://patchwork.libcamera.org/patch/4020/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200611014614.1683623-1-niklas.soderlund@ragnatech.se>", "date": "2020-06-11T01:46:14", "name": "[libcamera-devel] qcam: dng_writer: Record creation time in the EXIF directory", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "8f23675315301d9902203a7a445bf2c6bd0c55e7", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/4020/mbox/", "series": [ { "id": 989, "url": "https://patchwork.libcamera.org/api/1.1/series/989/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=989", "date": "2020-06-11T01:46:14", "name": "[libcamera-devel] qcam: dng_writer: Record creation time in the EXIF directory", "version": 1, "mbox": "https://patchwork.libcamera.org/series/989/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/4020/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/4020/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22334600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Jun 2020 03:46:19 +0200 (CEST)", "from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 5344f8ae-ab85-11ea-933e-005056917a89;\n\tThu, 11 Jun 2020 03:46:13 +0200 (CEST)" ], "X-Halon-ID": "5344f8ae-ab85-11ea-933e-005056917a89", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 11 Jun 2020 03:46:14 +0200", "Message-Id": "<20200611014614.1683623-1-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.27.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] qcam: dng_writer: Record creation time in\n\tthe EXIF directory", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Thu, 11 Jun 2020 01:46:19 -0000" }, "content": "If the EXIF directory is empty due to no metadata being available tools\nsuch as tiffinfo complains that the directory is malformed.\n\n TIFFFetchDirectory: Sanity check on directory count failed, this is probably not a valid IFD offset.\n TIFFReadCustomDirectory: Failed to read custom directory at offset 0.\n\nAlways record the creation time in the EXIF directory instead of adding\ncomplexity to skip creating the EXIF directory if there is no metadata\nto record. This ensures there are at least one entry in the EXIF\ndirectory and that makes tiffinfo happy.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/qcam/dng_writer.cpp | 11 +++++++++++\n 1 file changed, 11 insertions(+)", "diff": "diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp\nindex 330b169af25b7ac7..c1c3833740d96630 100644\n--- a/src/qcam/dng_writer.cpp\n+++ b/src/qcam/dng_writer.cpp\n@@ -426,6 +426,17 @@ int DNGWriter::write(const char *filename, const Camera *camera,\n \t/* Create a new IFD for the EXIF data and fill it. */\n \tTIFFCreateEXIFDirectory(tif);\n \n+\t/* Store creation time. */\n+\ttime_t rawtime;\n+\tstruct tm *timeinfo;\n+\tchar strTime[20];\n+\n+\ttime(&rawtime);\n+\ttimeinfo = localtime(&rawtime);\n+\tstrftime(strTime, 20, \"%Y:%m:%d %H:%M:%S\", timeinfo);\n+\n+\tTIFFSetField(tif, EXIFTAG_DATETIMEDIGITIZED, strTime);\n+\n \tif (metadata.contains(controls::AnalogueGain)) {\n \t\tfloat gain = metadata.get(controls::AnalogueGain);\n \t\tuint16_t iso = std::min(std::max(gain * 100, 0.0f), 65535.0f);\n", "prefixes": [ "libcamera-devel" ] }