[{"id":31380,"web_url":"https://patchwork.libcamera.org/comment/31380/","msgid":"<87ed563i3a.fsf@redhat.com>","date":"2024-09-26T09:00:25","subject":"Re: [PATCH 1/2] apps: Replace HAVE_DNG with HAVE_TIFF","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> Support for DNG capture is conditioned by the availability of libtiff,\n> which is indicated by the HAVE_TIFF macro set by meson. The dng_writer.h\n> header then defines HAVE_DNG, which is used is a couple of places to\n\n... *in* a couple ...\n\n> conditionally compile DNG-related code. Most of the other locations\n> where conditional compilation is required use HAVE_TIFF.\n>\n> Using both HAVE_TIFF and HAVE_DNG is confusing. HAVE_DNG would be a\n> better name, but as the macro is defined in dng_writer.h, it would\n> require all files that need to test for DNG support to include that\n> header. Failure to include it (directly or indirectly) would result in\n> the code covered by the macro to be silently disabled.\n>\n> To avoid the confusion, standardize on using HAVE_TIFF everywhere and\n> drop HAVE_DNG.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  src/apps/common/dng_writer.h  | 1 -\n>  src/apps/qcam/main_window.cpp | 4 ++--\n>  2 files changed, 2 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/apps/common/dng_writer.h b/src/apps/common/dng_writer.h\n> index 917713e61001..aaa8a852b307 100644\n> --- a/src/apps/common/dng_writer.h\n> +++ b/src/apps/common/dng_writer.h\n> @@ -8,7 +8,6 @@\n>  #pragma once\n>  \n>  #ifdef HAVE_TIFF\n> -#define HAVE_DNG\n>  \n>  #include <libcamera/camera.h>\n>  #include <libcamera/controls.h>\n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index dd2aa19618a1..5144c6b3eb30 100644\n> --- a/src/apps/qcam/main_window.cpp\n> +++ b/src/apps/qcam/main_window.cpp\n> @@ -211,7 +211,7 @@ int MainWindow::createToolbars()\n>  \taction->setShortcut(QKeySequence::SaveAs);\n>  \tconnect(action, &QAction::triggered, this, &MainWindow::saveImageAs);\n>  \n> -#ifdef HAVE_DNG\n> +#ifdef HAVE_TIFF\n>  \t/* Save Raw action. */\n>  \taction = toolbar_->addAction(QIcon::fromTheme(\"camera-photo\",\n>  \t\t\t\t\t\t      QIcon(\":aperture.svg\")),\n> @@ -646,7 +646,7 @@ void MainWindow::captureRaw()\n>  void MainWindow::processRaw(FrameBuffer *buffer,\n>  \t\t\t    [[maybe_unused]] const ControlList &metadata)\n>  {\n> -#ifdef HAVE_DNG\n> +#ifdef HAVE_TIFF\n>  \tQString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);\n>  \tQString filename = QFileDialog::getSaveFileName(this, \"Save DNG\", defaultPath,\n>  \t\t\t\t\t\t\t\"DNG Files (*.dng)\");","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 0FABDC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Sep 2024 09:00:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BCAC96350E;\n\tThu, 26 Sep 2024 11:00:33 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DEC92634F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 11:00:31 +0200 (CEST)","from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n\t[209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-60-p61XwxR2NCCIeemzvKKwCQ-1; Thu, 26 Sep 2024 05:00:29 -0400","by mail-wr1-f71.google.com with SMTP id\n\tffacd0b85a97d-3780c8d689bso314848f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 02:00:28 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-37ccc23b92bsm2699911f8f.26.2024.09.26.02.00.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 26 Sep 2024 02:00:26 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Fk+LjiXo\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1727341230;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=IQIM9ZBdQc/1ogApW6ZxeoJZvUdFLY1rDtLOaObMFA8=;\n\tb=Fk+LjiXoPNLosB68BO31F3Feq1E28jmJmFl0prquEW8VZRCcL9iMNqPzAlBSmcO5MY7FFn\n\tiQE778Uf6yxCQL4t/oSXPX6H3gI3DHESVkpI88hq09xmF9pX7fawP9pWLVEf3E2IglikIJ\n\t4pZD6/PMLkyWR9gNyMxHaRMMKj5eTAA=","X-MC-Unique":"p61XwxR2NCCIeemzvKKwCQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1727341227; x=1727946027;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=IQIM9ZBdQc/1ogApW6ZxeoJZvUdFLY1rDtLOaObMFA8=;\n\tb=EQ8MMtpaRM0tVBKGiGzqkxQvnPvdyz6fSOoMautTh+sthVP+geXU0fG2ErV72IUpOE\n\t2ExSWeChJXR36djsXlqqoidESCJWtG0WDep6QuxJFGnutnm4zhEJcoOWvlhWUJUwMepk\n\tenyVGQHAem58ocVzXLMdE00OY4oKk3YXOr7fqZkD5GC2IjC/CFCx80aTp8G9HAcYI38G\n\tPhsPd8VAb/FEKd7+LDL7cB7fTF+IonwQ/k1uWuDY17z4jL979YoT4e41BFtylBIDfn2c\n\tYzM27hEhhCVQN/n+igdB50T5PIZyFxhc4U9v8fdO/B28E1ytEKvpLhlK1lF4cltJL7Ay\n\tpAJw==","X-Gm-Message-State":"AOJu0YxlwxWlosafN2ztNqWb8LQd7Dj3SPnrE5jbAK5qGaVV2wqkSytz\n\t28FQBNbhbnc1eRUwCUfAYnEGPM43W7TXRi7dntHinuYQEhkCcY/GYVWlJjdgdjrVmCM7SaYngD5\n\tlGAmjf1BLxV+iwmeVTH6uFVAlaJ1ja8CyY71yoADIe3jVuERdouKumna767P75mna+PCyL/zgbV\n\tZiGYo=","X-Received":["by 2002:a05:6000:1886:b0:368:117c:84fd with SMTP id\n\tffacd0b85a97d-37cc2461a09mr4207299f8f.3.1727341227254; \n\tThu, 26 Sep 2024 02:00:27 -0700 (PDT)","by 2002:a05:6000:1886:b0:368:117c:84fd with SMTP id\n\tffacd0b85a97d-37cc2461a09mr4207275f8f.3.1727341226774; \n\tThu, 26 Sep 2024 02:00:26 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFGMViIokyWkPSI3Bo6ye9IxxIAtrMDAcjANOxzNm/Mc+yV4lF9L69ymFNcx3PCPODuFI2Huw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Arne Caspari\n\t<arne.caspari@theimagingsource.com>","Subject":"Re: [PATCH 1/2] apps: Replace HAVE_DNG with HAVE_TIFF","In-Reply-To":"<20240925152134.20284-2-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Wed, 25 Sep 2024 18:21:33 +0300\")","References":"<20240925152134.20284-1-laurent.pinchart@ideasonboard.com>\n\t<20240925152134.20284-2-laurent.pinchart@ideasonboard.com>","Date":"Thu, 26 Sep 2024 11:00:25 +0200","Message-ID":"<87ed563i3a.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}},{"id":31403,"web_url":"https://patchwork.libcamera.org/comment/31403/","msgid":"<iziovjdbnkqkfrjnjbn3k43b4aneyaa2q5bbq4habykj5ddc3p@6yulo5djbarb>","date":"2024-09-26T13:16:19","subject":"Re: [PATCH 1/2] apps: Replace HAVE_DNG with HAVE_TIFF","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Laurent\n\nOn Wed, Sep 25, 2024 at 06:21:33PM GMT, Laurent Pinchart wrote:\n> Support for DNG capture is conditioned by the availability of libtiff,\n> which is indicated by the HAVE_TIFF macro set by meson. The dng_writer.h\n> header then defines HAVE_DNG, which is used is a couple of places to\n> conditionally compile DNG-related code. Most of the other locations\n> where conditional compilation is required use HAVE_TIFF.\n>\n> Using both HAVE_TIFF and HAVE_DNG is confusing. HAVE_DNG would be a\n> better name, but as the macro is defined in dng_writer.h, it would\n> require all files that need to test for DNG support to include that\n> header. Failure to include it (directly or indirectly) would result in\n> the code covered by the macro to be silently disabled.\n>\n> To avoid the confusion, standardize on using HAVE_TIFF everywhere and\n> drop HAVE_DNG.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  src/apps/common/dng_writer.h  | 1 -\n>  src/apps/qcam/main_window.cpp | 4 ++--\n>  2 files changed, 2 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/apps/common/dng_writer.h b/src/apps/common/dng_writer.h\n> index 917713e61001..aaa8a852b307 100644\n> --- a/src/apps/common/dng_writer.h\n> +++ b/src/apps/common/dng_writer.h\n> @@ -8,7 +8,6 @@\n>  #pragma once\n>\n>  #ifdef HAVE_TIFF\n> -#define HAVE_DNG\n>\n>  #include <libcamera/camera.h>\n>  #include <libcamera/controls.h>\n> diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp\n> index dd2aa19618a1..5144c6b3eb30 100644\n> --- a/src/apps/qcam/main_window.cpp\n> +++ b/src/apps/qcam/main_window.cpp\n> @@ -211,7 +211,7 @@ int MainWindow::createToolbars()\n>  \taction->setShortcut(QKeySequence::SaveAs);\n>  \tconnect(action, &QAction::triggered, this, &MainWindow::saveImageAs);\n>\n> -#ifdef HAVE_DNG\n> +#ifdef HAVE_TIFF\n>  \t/* Save Raw action. */\n>  \taction = toolbar_->addAction(QIcon::fromTheme(\"camera-photo\",\n>  \t\t\t\t\t\t      QIcon(\":aperture.svg\")),\n> @@ -646,7 +646,7 @@ void MainWindow::captureRaw()\n>  void MainWindow::processRaw(FrameBuffer *buffer,\n>  \t\t\t    [[maybe_unused]] const ControlList &metadata)\n>  {\n> -#ifdef HAVE_DNG\n> +#ifdef HAVE_TIFF\n>  \tQString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);\n>  \tQString filename = QFileDialog::getSaveFileName(this, \"Save DNG\", defaultPath,\n>  \t\t\t\t\t\t\t\"DNG Files (*.dng)\");\n> --\n> Regards,\n>\n> Laurent Pinchart\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 C3362C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Sep 2024 13:16:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 726FC6350F;\n\tThu, 26 Sep 2024 15:16:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B2D69634F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 15:16:23 +0200 (CEST)","from ideasonboard.com (mob-5-90-51-229.net.vodafone.it\n\t[5.90.51.229])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8239E169;\n\tThu, 26 Sep 2024 15:14:55 +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=\"Y4r8abPE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727356495;\n\tbh=TL1hDVkxYRU/eBxMqdSsd9fWt8Tu+xwXyG58FmN1JXA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Y4r8abPEnpmLiGp4UCQBPCIXOgOW5dIN6LXX2lr2QGWuxDouhBG235Slvr1gHhgrV\n\tR7Vg3SA/1UfrUW1WLgCkjSlEKxtf4XZIR1q2ZGQa7Q2rqEhGll/kHuBDI2B96mgeJ0\n\tM5GS/pDOV6tqbqBw6KooCKbFe/4yZ03TDYJ+bOec=","Date":"Thu, 26 Sep 2024 15:16:19 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tArne Caspari <arne.caspari@theimagingsource.com>","Subject":"Re: [PATCH 1/2] apps: Replace HAVE_DNG with HAVE_TIFF","Message-ID":"<iziovjdbnkqkfrjnjbn3k43b4aneyaa2q5bbq4habykj5ddc3p@6yulo5djbarb>","References":"<20240925152134.20284-1-laurent.pinchart@ideasonboard.com>\n\t<20240925152134.20284-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240925152134.20284-2-laurent.pinchart@ideasonboard.com>","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>"}}]