[{"id":23421,"web_url":"https://patchwork.libcamera.org/comment/23421/","msgid":"<YqryrCSM4wHscMJA@pendragon.ideasonboard.com>","date":"2022-06-16T09:06:52","subject":"Re: [libcamera-devel] [PATCH v1.1] qcam: dng: Make\n\tTIFFTAG_CFAPATTERN variable count","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jean-Michel,\n\nThank you for the patch.\n\nOn Thu, Jun 16, 2022 at 10:49:41AM +0200, Jean-Michel Hautbois via libcamera-devel wrote:\n> Since libtiff version 20201219, the CFAPATTERN tag is using a variable\n> count and not the fixed 4 values size.\n> For reference, the commit introducing this is:\n> \n> \tcommit 2eb5a954cb7b7ad61559da00743c4b0e2fce34d0\n> \tAuthor: Sam Hasinoff <hasinoff@google.com>\n> \tDate:   Sun Mar 8 21:23:16 2020 +0100\n> \tMake TIFFTAG_CFAPATTERN variable count\n> \n> Add a version check in the DNGWriter::write function when this tag is\n> written as this breaks the raw capture in qcam.\n> \n> Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> v1.1: Corrects a typo in the if\n>         -> /me should really always compile before sending -_-\n\nSometimes I even think that testing is also a good idea ;-) I have\nstopped counting how many times that has happened to me as well. \"It's a\nsimple change, it can't break anything\".\n\n> ---\n>  src/qcam/dng_writer.cpp | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp\n> index 34c8df5a..06491b92 100644\n> --- a/src/qcam/dng_writer.cpp\n> +++ b/src/qcam/dng_writer.cpp\n> @@ -506,7 +506,10 @@ int DNGWriter::write(const char *filename, const Camera *camera,\n>  \tTIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);\n>  \tTIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT);\n>  \tTIFFSetField(tif, TIFFTAG_CFAREPEATPATTERNDIM, cfaRepeatPatternDim);\n> -\tTIFFSetField(tif, TIFFTAG_CFAPATTERN, info->pattern);\n> +\tif (TIFFLIB_VERSION < 20201219)\n> +\t\tTIFFSetField(tif, TIFFTAG_CFAPATTERN, info->pattern);\n> +\telse\n> +\t\tTIFFSetField(tif, TIFFTAG_CFAPATTERN, 4, info->pattern);\n>  \tTIFFSetField(tif, TIFFTAG_CFAPLANECOLOR, 3, cfaPlaneColor);\n>  \tTIFFSetField(tif, TIFFTAG_CFALAYOUT, 1);\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 5D803BD161\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 16 Jun 2022 09:07:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 891E865635;\n\tThu, 16 Jun 2022 11:07:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B579601F1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 16 Jun 2022 11:07:03 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7B7AD415;\n\tThu, 16 Jun 2022 11:07:02 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655370424;\n\tbh=+F+kD2pzCyb9EOiPq0G4B4Sb/mz21zO7qmFSROHn7v4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=H8j+6iXlh+Wt1iw04Jsgl7ghtkC5O63WhA2L4yTkuL8p+wQ5vAa5uqNCY7wXT9EMh\n\tjeY+4uhbNf9Y1vSLwT9tgDb9KC3GcinW9tWdSMBSSO5nCe5TUZkNqmxGfl68lphiiA\n\tgrBtZbwlnnQKhh/2JOHL+hauOdWd251f3qt1Wwr+jo6yFIYKcQ7eVWKxvOfrmX6TiB\n\t3Et2OKg8NWxsDTbVmV/eWiRo7tnHaRZkSi8pnZQrIYF9xDF5GOf11y80eO/LRCTMlg\n\tj/K0s0jt5i3yPdZ4fZ4m+GyocNEuVuD31Cq4D+XOmtEHOJbEH6OHFuaY1PPXIu1ks1\n\tKatilIHrXVbPw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1655370422;\n\tbh=+F+kD2pzCyb9EOiPq0G4B4Sb/mz21zO7qmFSROHn7v4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=qiapIr91bsYK7vUI7CvlnfKvBzmPAudAc1cmMkbqovwEVEQ5t6gzE6Lz/CQ0oz6uC\n\t3/uPyAqZF5CTN7Ebe6/72LlpPWVGanoTO6URGh/YwdvkxHF+AjbhWoWmFGh5VZ1eoj\n\th0xjYOLkPnJPBsFquaubw9W/6ClIK2U6Ie2SlYk4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"qiapIr91\"; dkim-atps=neutral","Date":"Thu, 16 Jun 2022 12:06:52 +0300","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<YqryrCSM4wHscMJA@pendragon.ideasonboard.com>","References":"<20220616084642.59823-1-jeanmichel.hautbois@ideasonboard.com>\n\t<20220616084940.63177-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220616084940.63177-1-jeanmichel.hautbois@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v1.1] qcam: dng: Make\n\tTIFFTAG_CFAPATTERN variable count","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]