[{"id":14749,"web_url":"https://patchwork.libcamera.org/comment/14749/","msgid":"<20210125110358.bap25zd4sea3zwlr@uno.localdomain>","date":"2021-01-25T11:03:58","subject":"Re: [libcamera-devel] [PATCH v4 2/8] android: jpeg: exif: Fix\n\tsetOrientation EXIF values","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Paul,\n\nOn Mon, Jan 25, 2021 at 04:14:38PM +0900, Paul Elder wrote:\n> The input to setOrientation is angle clockwise from the sensor\n> orientation, while the EXIF output values were swapped for 90\n> and 270 degrees.\n>\n> From the EXIF spec:\n>\n> 6 = The 0th row is the visual right-hand side of the image, and the\n>     0th column is the visual top.\n> 8 = The 0th row is the visual left-hand side of the image, and the\n>     0th column is the visual bottom.\n>\n> 6 should be 90 degrees clockwise, while 8 should 270 degrees clockwise.\n> Fix this.\n>\n> As Android defines the rotation as the clockwise angle by which the\n> image needs to be rotated to appear in the correct orientation on the\n> device screen, the previous values would be correct if the input angle\n> was from the camera orientation. Since the correct input should be the\n> requested JPEG orientation, these new values are the correct ones.\n>\n\nThanks for the much more clear commit message.\n\nIf I got this right, this has nothing to do with the camera\nrotation, but only depends on the ANDROID_JPEG_ORIENTATION control\nvalue.\n\nWith this confirmed:\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> ---\n> No change in v3\n>\n> Changes in v2\n> - expand commit message\n> ---\n>  src/android/jpeg/exif.cpp | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp\n> index 89343323..204a237a 100644\n> --- a/src/android/jpeg/exif.cpp\n> +++ b/src/android/jpeg/exif.cpp\n> @@ -306,13 +306,13 @@ void Exif::setOrientation(int orientation)\n>  \t\tvalue = 1;\n>  \t\tbreak;\n>  \tcase 90:\n> -\t\tvalue = 8;\n> +\t\tvalue = 6;\n>  \t\tbreak;\n>  \tcase 180:\n>  \t\tvalue = 3;\n>  \t\tbreak;\n>  \tcase 270:\n> -\t\tvalue = 6;\n> +\t\tvalue = 8;\n>  \t\tbreak;\n>  \t}\n>\n> --\n> 2.27.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 D590DBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Jan 2021 11:03:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 75627682BA;\n\tMon, 25 Jan 2021 12:03:41 +0100 (CET)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8F576030E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Jan 2021 12:03:39 +0100 (CET)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id E51671BF203;\n\tMon, 25 Jan 2021 11:03:37 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Mon, 25 Jan 2021 12:03:58 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<20210125110358.bap25zd4sea3zwlr@uno.localdomain>","References":"<20210125071444.26252-1-paul.elder@ideasonboard.com>\n\t<20210125071444.26252-3-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210125071444.26252-3-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 2/8] android: jpeg: exif: Fix\n\tsetOrientation EXIF values","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@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]