From 7a6a9dbb7d0e8f46c3cd56290d8506ffe5111f07 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 13 Sep 2018 11:37:39 +0200 Subject: QImageWriter: Fix default compressionratio Before asking a image format handler to save an image, QImageWriter sets the value of all supported options. For options like quality and gamma, the default value is an illegal value (-1 and 0.0 resp.), effectively telling the handler that the application has not requested any particular value. But in the case of compressionratio, the default was 0, a legal value. Fix by changing it to -1. Change-Id: Iad6d4c2dbe269b25863e7d4967aa9ed2a7d1247f Reviewed-by: Allan Sandfeld Jensen --- src/gui/image/qimagewriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 62eeb74727..5ce7e309bb 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -264,7 +264,7 @@ QImageWriterPrivate::QImageWriterPrivate(QImageWriter *qq) deleteDevice = false; handler = 0; quality = -1; - compression = 0; + compression = -1; gamma = 0.0; optimizedWrite = false; progressiveScanWrite = false; -- cgit v1.2.3