From 9f35e45b17f88e7e59c6645e68be45441b46c38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Mon, 16 Feb 2026 15:47:07 +0100 Subject: [PATCH] apps: qcam: Show `QImageWriter` errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Kieran Bingham --- 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 96a2d509..5a88c5aa 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()