[libcamera-devel] qcam: Tell user if we have TIFF support
diff mbox series

Message ID Y+gPY+MVLSQrQToX@duo.ucw.cz
State Changes Requested
Headers show
Series
  • [libcamera-devel] qcam: Tell user if we have TIFF support
Related show

Commit Message

Pavel Machek Feb. 11, 2023, 9:57 p.m. UTC
User may wonder why he can't take images. Add line to help text
expaining if we have TIFF support.
    
Signed-off-by: Pavel Machek <pavel@ucw.cz>

Comments

Kieran Bingham Feb. 18, 2023, 11:13 p.m. UTC | #1
Quoting Pavel Machek via libcamera-devel (2023-02-11 21:57:55)
> User may wonder why he can't take images. Add line to help text
> expaining if we have TIFF support.
>     
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> diff --git a/src/apps/qcam/main.cpp b/src/apps/qcam/main.cpp
> index 36cb93a5..36ee16ab 100644
> --- a/src/apps/qcam/main.cpp
> +++ b/src/apps/qcam/main.cpp
> @@ -46,8 +46,14 @@ OptionsParser::Options parseOptions(int argc, char *argv[])
>                          "Print verbose log messages", "verbose");
>  
>         OptionsParser::Options options = parser.parse(argc, argv);
> -       if (options.isSet(OptHelp))
> +       if (options.isSet(OptHelp)) {
>                 parser.usage();
> +#ifdef HAVE_TIFF
> +               qInfo() << "TIFF/DNG support available.";
> +#else
> +               qInfo() << "TIFF/DNG support NOT available, taking still images not possible";
> +#endif
> +       }

This worries me as a bit overtly verbose, and not consistent (Should we
report every other configuration option in this way?)

I'd rather see something extended on the meson.build summary perhaps to
say that qcam doesn't support raw files maybe?

--
Kieran

>  
>         return options;
>  }
> 
> -- 
> People of Russia, stop Putin before his war on Ukraine escalates.
Laurent Pinchart Feb. 18, 2023, 11:53 p.m. UTC | #2
On Sat, Feb 18, 2023 at 11:13:25PM +0000, Kieran Bingham via libcamera-devel wrote:
> Quoting Pavel Machek via libcamera-devel (2023-02-11 21:57:55)
> > User may wonder why he can't take images. Add line to help text
> > expaining if we have TIFF support.
> >     
> > Signed-off-by: Pavel Machek <pavel@ucw.cz>
> > 
> > diff --git a/src/apps/qcam/main.cpp b/src/apps/qcam/main.cpp
> > index 36cb93a5..36ee16ab 100644
> > --- a/src/apps/qcam/main.cpp
> > +++ b/src/apps/qcam/main.cpp
> > @@ -46,8 +46,14 @@ OptionsParser::Options parseOptions(int argc, char *argv[])
> >                          "Print verbose log messages", "verbose");
> >  
> >         OptionsParser::Options options = parser.parse(argc, argv);
> > -       if (options.isSet(OptHelp))
> > +       if (options.isSet(OptHelp)) {
> >                 parser.usage();
> > +#ifdef HAVE_TIFF
> > +               qInfo() << "TIFF/DNG support available.";
> > +#else
> > +               qInfo() << "TIFF/DNG support NOT available, taking still images not possible";
> > +#endif
> > +       }
> 
> This worries me as a bit overtly verbose, and not consistent (Should we
> report every other configuration option in this way?)
> 
> I'd rather see something extended on the meson.build summary perhaps to
> say that qcam doesn't support raw files maybe?

Furthermore, will a user who wonders why the raw save button isn't
available think about running `qcam -h` ? It could be more user-friendly
to always create the button in the toolbar, and leave it in a disabled
state with DNG support is unavailable, possibly with a tooltip message
that indicates why.

> >  
> >         return options;
> >  }

Patch
diff mbox series

diff --git a/src/apps/qcam/main.cpp b/src/apps/qcam/main.cpp
index 36cb93a5..36ee16ab 100644
--- a/src/apps/qcam/main.cpp
+++ b/src/apps/qcam/main.cpp
@@ -46,8 +46,14 @@  OptionsParser::Options parseOptions(int argc, char *argv[])
 			 "Print verbose log messages", "verbose");
 
 	OptionsParser::Options options = parser.parse(argc, argv);
-	if (options.isSet(OptHelp))
+	if (options.isSet(OptHelp)) {
 		parser.usage();
+#ifdef HAVE_TIFF
+		qInfo() << "TIFF/DNG support available.";
+#else
+		qInfo() << "TIFF/DNG support NOT available, taking still images not possible";
+#endif
+	}
 
 	return options;
 }