[libcamera-devel] [PATCH] qcam: saveImageAs: Set image quality explicitly

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Mar 18 16:41:09 CET 2020


Hi Kieran,

Thank you for the patch.

On Wed, Mar 18, 2020 at 03:13:36PM +0000, Kieran Bingham wrote:
> The QImageWriter defines a method to set the output image quality.
> Explicitly set it to 95 to override any defaults.

You could add, although it's a Qt implementation detail, that by default
the JPEG image handler uses a quality of 75, which isn't considered high
enough ?

> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  src/qcam/main_window.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index ae1760dfd647..1869fdfc8679 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -360,6 +360,7 @@ void MainWindow::saveImageAs()
>  		return;
>  
>  	QImageWriter writer(filename);
> +	writer.setQuality(95);
>  	writer.write(image);
>  }
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list