| Message ID | 20260216145410.495478-1-barnabas.pocze@ideasonboard.com |
|---|---|
| State | Accepted |
| Headers | show |
| Series |
|
| Related | show |
Quoting Barnabás Pőcze (2026-02-16 14:54:10) > 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 <barnabas.pocze@ideasonboard.com> Already worth adding indeed. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > 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 <QFileDialog> > #include <QImage> > #include <QImageWriter> > +#include <QMessageBox> > #include <QMutexLocker> > #include <QStandardPaths> > #include <QStringList> > @@ -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() > -- > 2.53.0 >
Quoting Barnabás Pőcze (2026-03-23 07:20:59) > Hi all > > I would like to merge this change. Any further comments? I think this can be merged already too. -- Kieran > > > 2026. 02. 16. 15:54 keltezéssel, Barnabás Pőcze írta: > > 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 <barnabas.pocze@ideasonboard.com> > > --- > > 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 <QFileDialog> > > #include <QImage> > > #include <QImageWriter> > > +#include <QMessageBox> > > #include <QMutexLocker> > > #include <QStandardPaths> > > #include <QStringList> > > @@ -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() >
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 <QFileDialog> #include <QImage> #include <QImageWriter> +#include <QMessageBox> #include <QMutexLocker> #include <QStandardPaths> #include <QStringList> @@ -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()
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 <barnabas.pocze@ideasonboard.com> --- src/apps/qcam/main_window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)