[{"id":19499,"web_url":"https://patchwork.libcamera.org/comment/19499/","msgid":"<CAO5uPHONJfoTbnqKRe-ry5YwcvLmUbKRVN1wqko-odZq+7qL-A@mail.gmail.com>","date":"2021-09-07T09:19:51","subject":"Re: [libcamera-devel] [PATCH] wip: android: Fix generation of EXIF\n\tthumbnail","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Umang, thank you for the patch.\n\nOn Tue, Sep 7, 2021 at 3:01 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Generation of EXIF thumbnail seems to have regressed due to\n> 1264628d3c92(\"android: jpeg: Configure thumbnailer based on request\n> metadata\"). The patch tries to fix the issue of\n> ANDROID_JPEG_THUMBNAIL_SIZE not being available in request metadata\n> template.\n>\n> However, there are a few open questions marked as comments in the\n> patch, which should be addressed before merging the fix.\n>\n> Signed-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(-)\n>\n> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> index 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>          */\n>         constexpr Size maxJpegThumbnail(160, 160);\n>         std::vector<Size> thumbnailSizes;\n> -       thumbnailSizes.push_back({ 0, 0 });\n> +       // thumbnailSizes.push_back({ 0, 0 }); not sure why this was added in first place?\n\nLooking at the spec, (0, 0) is required.\nIf JPEG_THUMNAIL_SIZE is (0, 0), we should not generate a thumbnail.\n(0, 0) indicates no thumbnail generation is supported.\nhttps://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES\n\n>         for (const auto &entry : streamConfigurations_) {\n>                 if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB)\n>                         continue;\n> @@ -1364,6 +1364,21 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con\n>         requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n>                                   entry.data.i32, 2);\n>\n> +       /*\n> +        * Get Thumbnail sizes from static metadata and add to template.\n> +        *\n> +        * \\todo Make sure you update entry size and byte size above to\n> +        *  incorporate this.\n> +        */\n> +       found = staticMetadata_->getEntry(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,\n> +                                         &entry);\n> +       if (!found) {\n> +               LOG(HAL, Error) << \"ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES not found\";\n> +               // return here?\n> +       }\n> +       requestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,\n> +                                 entry.data.i32, 2);\n> +\n\nI think Size should be added here.\nWe should set just some non zero resolution just as a default.\nNow I can understand why you would like to remove (0, 0) in the above.\nI think we may want to add the second element of AVAILABLE_THUMBNAIL_SIZES?\n\n-Hiro\n\n>         uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;\n>         requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);\n>\n> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\n> index 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>                         generateThumbnail(source, thumbnailSize, quality, &thumbnail);\n>                         if (!thumbnail.empty())\n>                                 exif.setThumbnail(thumbnail, Exif::Compression::JPEG);\n> +                       LOG(JPEG, Info) << \"====THUMBNAIL GENERATED AND SET====\";\n>                 }\n>\n>                 resultMetadata->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE, data, 2);\n> --\n> 2.31.0\n>","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 8EA88BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 09:20:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 10AE46916A;\n\tTue,  7 Sep 2021 11:20:04 +0200 (CEST)","from mail-ej1-x634.google.com (mail-ej1-x634.google.com\n\t[IPv6:2a00:1450:4864:20::634])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AABCF69167\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 11:20:02 +0200 (CEST)","by mail-ej1-x634.google.com with SMTP id lc21so18347020ejc.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Sep 2021 02:20:02 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"CSaWG54r\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=j8mhcC/L+8e4L9dnTTieNqAOH4dHqh9oueEEN7e0NEs=;\n\tb=CSaWG54rEIgJEXgr5BFEcqrB4cE3URLtofgZlJWsHw1HBHvCPoKhfXSPJBZSbks5Cr\n\t83GF1P6jEh5g4TGNMxck9bssXd2l5tbTRPFB4JZSQRqnS56ATZEInRsUZtFklZB3E/Xe\n\tU/cqSvae5heuh/l3K0C3eMMLzkRZoc2Qtj5DQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=j8mhcC/L+8e4L9dnTTieNqAOH4dHqh9oueEEN7e0NEs=;\n\tb=T2cazbuis+MzpPqW3suJt+/hYikQJlLDsKEDQlSImOuZSqheYR7Ys8iny9bzVmKlx8\n\tsJ5P3PwDyw2LebqrlPGGUADfi1L3veyEs9qgBy5CLiszwtg38vOtbZg/KRQnE96Qq5H3\n\tncfJrJeCbfl3ai4nuUvOQRnscqypMqRQz0Iy/tyKDeP+sZ+YzJBIxV04FTcmlBBXQRgd\n\tPQcgL8PityNqQLT1xCM94AlRRuXy4upon0KMcM9tinSx/aMFx6UBUGUQ6Z6prpyjzycv\n\tNQ5aeOowz1YPMHUaNAbQDlHPwgFd6JVJVpqqebpr9dW01DB2BlTXPe43TERSgU0100/D\n\tyBvg==","X-Gm-Message-State":"AOAM531juPMGtcmKxLqm/3050d6kG71t4vsB4BiFqbCFA0dZ34VxryDx\n\tToPmWHHoxqUJabxOekY5wnUkaTElSNiPWCIJ9erhHfL0dBzbTA==","X-Google-Smtp-Source":"ABdhPJxOCt97uhnswyFDR3kej2SOP0TBayhfSlh2Q7SIY3Np1SnyyAwIniTcG+Q/n0M0O1si6Uybdoy4T1GifO+QqDQ=","X-Received":"by 2002:a17:906:3146:: with SMTP id\n\te6mr17562941eje.296.1631006402247; \n\tTue, 07 Sep 2021 02:20:02 -0700 (PDT)","MIME-Version":"1.0","References":"<20210907060145.97676-1-umang.jain@ideasonboard.com>","In-Reply-To":"<20210907060145.97676-1-umang.jain@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Tue, 7 Sep 2021 18:19:51 +0900","Message-ID":"<CAO5uPHONJfoTbnqKRe-ry5YwcvLmUbKRVN1wqko-odZq+7qL-A@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19501,"web_url":"https://patchwork.libcamera.org/comment/19501/","msgid":"<589afc0c-e4e3-e76a-f170-e05939bd8c13@ideasonboard.com>","date":"2021-09-07T09:53:48","subject":"Re: [libcamera-devel] [PATCH] wip: android: Fix generation of EXIF\n\tthumbnail","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Hiro,\n\nOn 9/7/21 2:49 PM, Hirokazu Honda wrote:\n> Hi Umang, thank you for the patch.\n>\n> On Tue, Sep 7, 2021 at 3:01 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>> Generation of EXIF thumbnail seems to have regressed due to\n>> 1264628d3c92(\"android: jpeg: Configure thumbnailer based on request\n>> metadata\"). The patch tries to fix the issue of\n>> ANDROID_JPEG_THUMBNAIL_SIZE not being available in request metadata\n>> template.\n>>\n>> However, there are a few open questions marked as comments in the\n>> patch, which should be addressed before merging the fix.\n>>\n>> Signed-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(-)\n>>\n>> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n>> index 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>>           */\n>>          constexpr Size maxJpegThumbnail(160, 160);\n>>          std::vector<Size> thumbnailSizes;\n>> -       thumbnailSizes.push_back({ 0, 0 });\n>> +       // thumbnailSizes.push_back({ 0, 0 }); not sure why this was added in first place?\n> Looking at the spec, (0, 0) is required.\n> If JPEG_THUMNAIL_SIZE is (0, 0), we should not generate a thumbnail.\n> (0, 0) indicates no thumbnail generation is supported.\n> https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES\n\n\nYes, I think it's required after reading the doc. While reading the code \nit didn't made any sense as why one would require a thumbnail of 0x0.\n\n>\n>>          for (const auto &entry : streamConfigurations_) {\n>>                  if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB)\n>>                          continue;\n>> @@ -1364,6 +1364,21 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con\n>>          requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n>>                                    entry.data.i32, 2);\n>>\n>> +       /*\n>> +        * Get Thumbnail sizes from static metadata and add to template.\n>> +        *\n>> +        * \\todo Make sure you update entry size and byte size above to\n>> +        *  incorporate this.\n>> +        */\n>> +       found = staticMetadata_->getEntry(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,\n>> +                                         &entry);\n>> +       if (!found) {\n>> +               LOG(HAL, Error) << \"ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES not found\";\n>> +               // return here?\n>> +       }\n>> +       requestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,\n>> +                                 entry.data.i32, 2);\n>> +\n> I think Size should be added here.\n> We should set just some non zero resolution just as a default.\n> Now I can understand why you would like to remove (0, 0) in the above.\n> I think we may want to add the second element of AVAILABLE_THUMBNAIL_SIZES?\n\n\nI am not sure here as well. Maybe the second (or say, first non-zero \nsize) or maybe the highest size reported in AVAILABLE_THUMBNAIL_SIZES; \nthat should used as target dimensions for the thumbnail. All I care, it \nshould be non-zero :)\n\n>\n> -Hiro\n>\n>>          uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;\n>>          requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);\n>>\n>> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\n>> index 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>>                          generateThumbnail(source, thumbnailSize, quality, &thumbnail);\n>>                          if (!thumbnail.empty())\n>>                                  exif.setThumbnail(thumbnail, Exif::Compression::JPEG);\n>> +                       LOG(JPEG, Info) << \"====THUMBNAIL GENERATED AND SET====\";\n>>                  }\n>>\n>>                  resultMetadata->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE, data, 2);\n>> --\n>> 2.31.0\n>>","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 9658CBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 09:53:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 265476916A;\n\tTue,  7 Sep 2021 11:53:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B9D5969167\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 11:53:54 +0200 (CEST)","from [192.168.1.104] (unknown [103.251.226.180])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C33FB24F;\n\tTue,  7 Sep 2021 11:53:53 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"O4OWFyLi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631008434;\n\tbh=/cPNCh3/IcnC6x9V2ErbqAdeusKe02d2R7FJPzm1B9E=;\n\th=Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=O4OWFyLie3SbJQJ4aex2ZlOY5SVNQQ4ZA89inMJgJ5yMw9BTWWLX+yqOFgRz2ARWK\n\twpCzIDZ9YXR0xGZqsxr7MixR/dBoNkIJQzyZt6KLvMeJn3fQLHMmSiAPizb5iA5wv2\n\tihRwiGhkGM5EOfWwFDGmH3v0aZpxmzuZWM6y9E20=","To":"Hirokazu Honda <hiroh@chromium.org>","References":"<20210907060145.97676-1-umang.jain@ideasonboard.com>\n\t<CAO5uPHONJfoTbnqKRe-ry5YwcvLmUbKRVN1wqko-odZq+7qL-A@mail.gmail.com>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<589afc0c-e4e3-e76a-f170-e05939bd8c13@ideasonboard.com>","Date":"Tue, 7 Sep 2021 15:23:48 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<CAO5uPHONJfoTbnqKRe-ry5YwcvLmUbKRVN1wqko-odZq+7qL-A@mail.gmail.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19532,"web_url":"https://patchwork.libcamera.org/comment/19532/","msgid":"<CAO5uPHPkW77yj-C8Swr07hSACQ42gg7O8jtYvE0FL1qvnH26aQ@mail.gmail.com>","date":"2021-09-08T07:43:02","subject":"Re: [libcamera-devel] [PATCH] wip: android: Fix generation of EXIF\n\tthumbnail","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Umang,\n\nOn Tue, Sep 7, 2021 at 6:53 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Hi Hiro,\n>\n> On 9/7/21 2:49 PM, Hirokazu Honda wrote:\n> > Hi Umang, thank you for the patch.\n> >\n> > On Tue, Sep 7, 2021 at 3:01 PM Umang Jain <umang.jain@ideasonboard.com> wrote:\n> >> Generation of EXIF thumbnail seems to have regressed due to\n> >> 1264628d3c92(\"android: jpeg: Configure thumbnailer based on request\n> >> metadata\"). The patch tries to fix the issue of\n> >> ANDROID_JPEG_THUMBNAIL_SIZE not being available in request metadata\n> >> template.\n> >>\n> >> However, there are a few open questions marked as comments in the\n> >> patch, which should be addressed before merging the fix.\n> >>\n> >> Signed-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(-)\n> >>\n> >> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp\n> >> index 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> >>           */\n> >>          constexpr Size maxJpegThumbnail(160, 160);\n> >>          std::vector<Size> thumbnailSizes;\n> >> -       thumbnailSizes.push_back({ 0, 0 });\n> >> +       // thumbnailSizes.push_back({ 0, 0 }); not sure why this was added in first place?\n> > Looking at the spec, (0, 0) is required.\n> > If JPEG_THUMNAIL_SIZE is (0, 0), we should not generate a thumbnail.\n> > (0, 0) indicates no thumbnail generation is supported.\n> > https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES\n>\n>\n> Yes, I think it's required after reading the doc. While reading the code\n> it didn't made any sense as why one would require a thumbnail of 0x0.\n>\n> >\n> >>          for (const auto &entry : streamConfigurations_) {\n> >>                  if (entry.androidFormat != HAL_PIXEL_FORMAT_BLOB)\n> >>                          continue;\n> >> @@ -1364,6 +1364,21 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplatePreview() con\n> >>          requestTemplate->addEntry(ANDROID_CONTROL_AE_TARGET_FPS_RANGE,\n> >>                                    entry.data.i32, 2);\n> >>\n> >> +       /*\n> >> +        * Get Thumbnail sizes from static metadata and add to template.\n> >> +        *\n> >> +        * \\todo Make sure you update entry size and byte size above to\n> >> +        *  incorporate this.\n> >> +        */\n> >> +       found = staticMetadata_->getEntry(ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES,\n> >> +                                         &entry);\n> >> +       if (!found) {\n> >> +               LOG(HAL, Error) << \"ANDROID_JPEG_AVAILABLE_THUMBNAIL_SIZES not found\";\n> >> +               // return here?\n> >> +       }\n> >> +       requestTemplate->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE,\n> >> +                                 entry.data.i32, 2);\n> >> +\n> > I think Size should be added here.\n> > We should set just some non zero resolution just as a default.\n> > Now I can understand why you would like to remove (0, 0) in the above.\n> > I think we may want to add the second element of AVAILABLE_THUMBNAIL_SIZES?\n>\n>\n> I am not sure here as well. Maybe the second (or say, first non-zero\n> size) or maybe the highest size reported in AVAILABLE_THUMBNAIL_SIZES;\n> that should used as target dimensions for the thumbnail. All I care, it\n> should be non-zero :)\n\nI wonder now if it should be zero. If there is a thumbnail, the\ncorrect thumbnail size should be overwritten later?\n\n-Hiro\n>\n> >\n> > -Hiro\n> >\n> >>          uint8_t aeMode = ANDROID_CONTROL_AE_MODE_ON;\n> >>          requestTemplate->addEntry(ANDROID_CONTROL_AE_MODE, aeMode);\n> >>\n> >> diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp\n> >> index 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> >>                          generateThumbnail(source, thumbnailSize, quality, &thumbnail);\n> >>                          if (!thumbnail.empty())\n> >>                                  exif.setThumbnail(thumbnail, Exif::Compression::JPEG);\n> >> +                       LOG(JPEG, Info) << \"====THUMBNAIL GENERATED AND SET====\";\n> >>                  }\n> >>\n> >>                  resultMetadata->addEntry(ANDROID_JPEG_THUMBNAIL_SIZE, data, 2);\n> >> --\n> >> 2.31.0\n> >>","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 4F427BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Sep 2021 07:43:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BB91360250;\n\tWed,  8 Sep 2021 09:43:14 +0200 (CEST)","from mail-ed1-x529.google.com (mail-ed1-x529.google.com\n\t[IPv6:2a00:1450:4864:20::529])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 373B26024D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Sep 2021 09:43:13 +0200 (CEST)","by mail-ed1-x529.google.com with SMTP id z19so1607838edi.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 08 Sep 2021 00:43:13 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"PJYgDQVr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=WS2Gl/w4YW5pV7wZ9wrAVbr45ZfB0nBtaX6ODNg6fjI=;\n\tb=PJYgDQVrdxgmVsRQSTwNxrGWI5UYfPUOGmGOBsKvTPYN+qv3Ad3h+kEm3tFI9/Ri65\n\t8/yoEa8UfU+iR53DYAyZl8N8T4PczN0WdVBCNdX4F9VGobV2wMPj4zPXMjufgKXCmJzS\n\tqUaLbfCfdFYRLI4k9H6juPME1jz+3p1BMUNSY=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=WS2Gl/w4YW5pV7wZ9wrAVbr45ZfB0nBtaX6ODNg6fjI=;\n\tb=RdWhjnbEoy3Xz766FJjfwxwelYM5f9cZIzFQk8j4QKX+9PXi3ny8+tphaZ0g7cm2eX\n\toLLpVfXrZ8D7kJuFcw3M/OD8g5XXOAnXLm4QGCCui+k7u4BMM5NCGZHQxgzJzmMrqOfQ\n\tL6DT8ILs+NuN89+KH6O3hDlNE9Xv+CLbR5ibpsZWI87wreqK6ZN7g11ddE83TpEkv/Xg\n\t3XQWZ+bm//xqUIym4/CILby2GaghKsgkMUSdrtWc7Sl2dxbvSFdhuaHhra+GVx9w33DW\n\tz5t96T5Kw9X82LchuJYoLiUMkMzWXnUYC2x5PmeH88JSI8l7HtNsn9RXGam2+nO1FSg9\n\t3ZGw==","X-Gm-Message-State":"AOAM5322U7i4OZan6pTQyhXfnhtytmUpr/6VL1XuI88YvctWfs96sgoE\n\tO2Gc+cmfgm0DKaCiDsno731f5DqPas+2dSnHlf/pKerYYYw=","X-Google-Smtp-Source":"ABdhPJynK9P3UVM0EQWFit9BzPJ3NeWLwCfTI/PDYtp0Qt/EsRWUyMJ+N6CRjlSxf1ljA8MyDAsNUf9Rz26Jnn86HXs=","X-Received":"by 2002:a50:f1c6:: with SMTP id y6mr2441411edl.354.1631086992729;\n\tWed, 08 Sep 2021 00:43:12 -0700 (PDT)","MIME-Version":"1.0","References":"<20210907060145.97676-1-umang.jain@ideasonboard.com>\n\t<CAO5uPHONJfoTbnqKRe-ry5YwcvLmUbKRVN1wqko-odZq+7qL-A@mail.gmail.com>\n\t<589afc0c-e4e3-e76a-f170-e05939bd8c13@ideasonboard.com>","In-Reply-To":"<589afc0c-e4e3-e76a-f170-e05939bd8c13@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Wed, 8 Sep 2021 16:43:02 +0900","Message-ID":"<CAO5uPHPkW77yj-C8Swr07hSACQ42gg7O8jtYvE0FL1qvnH26aQ@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]