From patchwork Thu Jun 16 08:49:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 16233 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 79557BD161 for ; Thu, 16 Jun 2022 08:51:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C38E465631; Thu, 16 Jun 2022 10:51:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655369480; bh=cpEFNr1BTzt0R+ZrRsQfMIYz/nJtXxZJYfR/uEiG9rI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=IoKaAPDziU0wdynsr/MYZTRfv8BuooWTJLY5s0WMDDf6ahL8XhirMBs6pypmL4cXY ffpEsY9yLhyBiMwYtWAprFxs5NyZXmivI2HTMP8+0F/0ufLRvUN183gqOg1NF3Ig+Z xn3mejdQ/+jBoYPrpee9jmkfK/IfacUwAL/8frb23ebgUsdB7qII38/MQOYV3ciV02 ncdcl7NB6B2sQbSJCkG/mB3WD61naMT7ATfSZWoeUzbmsTcQ/w+N5Yzd6+hZwrR7s5 97Ci5pTTzruU2dt/uzQ9Oj4u421Dpsr3xgTyG6X19X+cNUZIBCOGcIKbkTWZgH0i8I M/OI0FxYg+v5g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 78A92601F1 for ; Thu, 16 Jun 2022 10:51:18 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="X1xXK7+b"; dkim-atps=neutral Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:64d1:a349:8ac7:1dd0]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 25D8E415; Thu, 16 Jun 2022 10:51:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655369478; bh=cpEFNr1BTzt0R+ZrRsQfMIYz/nJtXxZJYfR/uEiG9rI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X1xXK7+baB0usCXf893P6vybLztIDBdj+7nRBIniBDyaKg1cS6rXi/QILaED16XkO sytfZDiq+jPRRcE2J76lFLv++0JwRi3KveUTcrhX8zi1YYPyil7tgih0PaqWT7/5W1 rmEEEXbfcxYMmk+Q4LV5ipqXKopwVsMTm2JLi1CY= To: libcamera-devel@lists.libcamera.org Date: Thu, 16 Jun 2022 10:49:41 +0200 Message-Id: <20220616084940.63177-1-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616084642.59823-1-jeanmichel.hautbois@ideasonboard.com> References: <20220616084642.59823-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1.1] qcam: dng: Make TIFFTAG_CFAPATTERN variable count X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jean-Michel Hautbois via libcamera-devel From: Jean-Michel Hautbois Reply-To: Jean-Michel Hautbois Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Since libtiff version 20201219, the CFAPATTERN tag is using a variable count and not the fixed 4 values size. For reference, the commit introducing this is: commit 2eb5a954cb7b7ad61559da00743c4b0e2fce34d0 Author: Sam Hasinoff Date: Sun Mar 8 21:23:16 2020 +0100 Make TIFFTAG_CFAPATTERN variable count Add a version check in the DNGWriter::write function when this tag is written as this breaks the raw capture in qcam. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart --- v1.1: Corrects a typo in the if -> /me should really always compile before sending -_- --- src/qcam/dng_writer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp index 34c8df5a..06491b92 100644 --- a/src/qcam/dng_writer.cpp +++ b/src/qcam/dng_writer.cpp @@ -506,7 +506,10 @@ int DNGWriter::write(const char *filename, const Camera *camera, TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); TIFFSetField(tif, TIFFTAG_CFAREPEATPATTERNDIM, cfaRepeatPatternDim); - TIFFSetField(tif, TIFFTAG_CFAPATTERN, info->pattern); + if (TIFFLIB_VERSION < 20201219) + TIFFSetField(tif, TIFFTAG_CFAPATTERN, info->pattern); + else + TIFFSetField(tif, TIFFTAG_CFAPATTERN, 4, info->pattern); TIFFSetField(tif, TIFFTAG_CFAPLANECOLOR, 3, cfaPlaneColor); TIFFSetField(tif, TIFFTAG_CFALAYOUT, 1);