From patchwork Mon Feb 16 14:54:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 26161 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 ACEF7C0DA4 for ; Mon, 16 Feb 2026 14:54:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E9669621F4; Mon, 16 Feb 2026 15:54:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="IEP4DDJc"; dkim-atps=neutral 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 E185062084 for ; Mon, 16 Feb 2026 15:54:13 +0100 (CET) Received: from pb-laptop.local (185.221.141.206.nat.pool.zt.hu [185.221.141.206]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 031254B3 for ; Mon, 16 Feb 2026 15:53:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1771253603; bh=BvwPA7Te1g4WSqkPpRPt2SceanWUVV1BZ3jbLZlb9X4=; h=From:To:Subject:Date:From; b=IEP4DDJcuy3J83k2bsCWeVlapmpTdvWnTgSN1Ayg2SkXeYEqshVYc1ML8oFmrKY2a ikQEf18lWYXDvGVuNm87G6bHALkD/y9bgkHboeeFXTDjTDYHX0US5R6hUte5LDmX/U Y1r7/6c6Rcx0MubS9/Rrnus4StVTfJP7ZEsCkieg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] apps: qcam: Show `QImageWriter` errors Date: Mon, 16 Feb 2026 15:54:10 +0100 Message-ID: <20260216145410.495478-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When saving the current iamge, `QImageWriter::write()` may fail for various reasons. However, this is currently not reported in any way. Use a simple `QMessageBox` to report the issues. Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/313 Signed-off-by: Barnabás Pőcze --- src/apps/qcam/main_window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index 96a2d5090..5a88c5aa8 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -637,7 +638,8 @@ void MainWindow::saveImageAs() QImageWriter writer(filename); writer.setQuality(95); - writer.write(image); + if (!writer.write(image)) + QMessageBox::warning(this, "Failed to save image", writer.errorString()); } void MainWindow::captureRaw()