Patch Detail
Show a patch.
GET /api/1.1/patches/4031/?format=api
{ "id": 4031, "url": "https://patchwork.libcamera.org/api/1.1/patches/4031/?format=api", "web_url": "https://patchwork.libcamera.org/patch/4031/", "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": "<20200611183914.92503-1-niklas.soderlund@ragnatech.se>", "date": "2020-06-11T18:39:14", "name": "[libcamera-devel,v2] qcam: dng_writer: Record creation time in the EXIF directory", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "95ceaa8e40c1885b597f1846a5b0ce3f9942ad71", "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/4031/mbox/", "series": [ { "id": 994, "url": "https://patchwork.libcamera.org/api/1.1/series/994/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=994", "date": "2020-06-11T18:39:14", "name": "[libcamera-devel,v2] qcam: dng_writer: Record creation time in the EXIF directory", "version": 2, "mbox": "https://patchwork.libcamera.org/series/994/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/4031/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/4031/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0773B61027\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Jun 2020 20:39:19 +0200 (CEST)", "from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid d313e982-ac12-11ea-86ee-0050569116f7;\n\tThu, 11 Jun 2020 20:39:06 +0200 (CEST)" ], "X-Halon-ID": "d313e982-ac12-11ea-86ee-0050569116f7", "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 20:39:14 +0200", "Message-Id": "<20200611183914.92503-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 v2] qcam: dng_writer: Record creation time\n\tin the 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 18:39:20 -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 some entries in the EXIF\ndirectory and that makes tiffinfo happy.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n* Changes since v1\n- Also set EXIFTAG_DATETIMEORIGINAL\n---\n src/qcam/dng_writer.cpp | 12 ++++++++++++\n 1 file changed, 12 insertions(+)", "diff": "diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp\nindex 8470908816e3e408..946d46d84c73397e 100644\n--- a/src/qcam/dng_writer.cpp\n+++ b/src/qcam/dng_writer.cpp\n@@ -427,6 +427,18 @@ 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_DATETIMEORIGINAL, strTime);\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", "v2" ] }