{"id":13709,"url":"https://patchwork.libcamera.org/api/patches/13709/?format=json","web_url":"https://patchwork.libcamera.org/patch/13709/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210907060145.97676-1-umang.jain@ideasonboard.com>","date":"2021-09-07T06:01:45","name":"[libcamera-devel] wip: android: Fix generation of EXIF thumbnail","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"ea12e5502f78b60e27c28109d72c58f27992faf2","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/?format=json","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"delegate":{"id":12,"url":"https://patchwork.libcamera.org/api/users/12/?format=json","username":"uajain","first_name":"Umang","last_name":"Jain","email":"umang.jain@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/13709/mbox/","series":[{"id":2485,"url":"https://patchwork.libcamera.org/api/series/2485/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2485","date":"2021-09-07T06:01:45","name":"[libcamera-devel] wip: android: Fix generation of EXIF thumbnail","version":1,"mbox":"https://patchwork.libcamera.org/series/2485/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13709/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13709/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 04FB4BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 06:01:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 66F9E6916C;\n\tTue,  7 Sep 2021 08:01:54 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F4BD69168\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 08:01:52 +0200 (CEST)","from perceval.ideasonboard.com (unknown [103.251.226.180])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C7582499;\n\tTue,  7 Sep 2021 08:01:50 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"C10jaiET\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630994511;\n\tbh=T8P5omgSbIbYVbHyDNTLeEpJaIfDQA8VlrI5LPqnjf4=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=C10jaiETUfiqqZfGbw/ckpUGJZfZaMWou2bl1XebI1vBB1AdpSVLBg49AdnedwEEn\n\tIiOhiFpeKPVZF0VKEgtusaTSJT4HEkcUqli28LDGZLPVe/htgLvN760x8EpjWv9ZMm\n\toB4on6Z7eL01mhaDbXYEsj5dE3vgRhxIpVNs/XVw=","From":"Umang Jain <umang.jain@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  7 Sep 2021 11:31:45 +0530","Message-Id":"<20210907060145.97676-1-umang.jain@ideasonboard.com>","X-Mailer":"git-send-email 2.31.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] wip: android: Fix generation of EXIF\n\tthumbnail","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Generation of EXIF thumbnail seems to have regressed due to\n1264628d3c92(\"android: jpeg: Configure thumbnailer based on request\nmetadata\"). The patch tries to fix the issue of\nANDROID_JPEG_THUMBNAIL_SIZE not being available in request metadata\ntemplate.\n\nHowever, there are a few open questions marked as comments in the\npatch, which should be addressed before merging the fix.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/android/camera_capabilities.cpp      | 17 ++++++++++++++++-\n src/android/jpeg/post_processor_jpeg.cpp |  1 +\n 2 files changed, 17 insertions(+), 1 deletion(-)","diff":"diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\nindex e92bca42..e7f91020 100644\n--- a/src/android/camera_capabilities.cpp\n+++ b/src/android/camera_capabilities.cpp\n@@ -951,7 +951,7 @@ int CameraCapabilities::initializeStaticMetadata()\n \t */\n \tconstexpr Size maxJpegThumbnail(160, 160);\n \tstd::vector<Size> thumbnailSizes;\n-\tthumbnailSizes.push_back({ 0, 0 });\n+\t// thumbnailSizes.push_back({ 0, 0 }); not sure why this was added in first place?\n \tfor (const auto &entry : streamConfigurations_) {\n \t\tif (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB)\n \t\t\tcontinue;\n@@ -1364,6 +1364,21 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con\n \trequestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n \t\t\t\t  entry.data.i32, 2);\n \n+\t/*\n+\t * Get Thumbnail sizes from static metadata and add to template.\n+\t *\n+\t * \\todo Make sure you update entry size and byte size above to\n+\t *  incorporate this.\n+\t */\n+\tfound = staticMetadata_->getEntry(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,\n+\t\t\t\t\t  &entry);\n+\tif (!found) {\n+\t\tLOG(HAL, Error) << \"ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES not found\";\n+\t\t// return here?\n+\t}\n+\trequestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,\n+\t\t\t\t  entry.data.i32, 2);\n+\n \tuint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;\n \trequestTemplate->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);\n \ndiff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\nindex 3160a784..2671a1ab 100644\n--- a/src/android/jpeg/post_processor_jpeg.cpp\n+++ b/src/android/jpeg/post_processor_jpeg.cpp\n@@ -150,6 +150,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,\n \t\t\tgenerateThumbnail(source, thumbnailSize, quality, &thumbnail);\n \t\t\tif (!thumbnail.empty())\n \t\t\t\texif.setThumbnail(thumbnail, Exif::Compression::JPEG);\n+\t\t\tLOG(JPEG, Info) << \"====THUMBNAIL GENERATED AND SET====\";\n \t\t}\n \n \t\tresultMetadata->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE, data, 2);\n","prefixes":["libcamera-devel"]}