diff --git a/src/server/services/wms/qgswmsutils.cpp b/src/server/services/wms/qgswmsutils.cpp index 4e88256ee00..baf49267ccc 100644 --- a/src/server/services/wms/qgswmsutils.cpp +++ b/src/server/services/wms/qgswmsutils.cpp @@ -153,7 +153,14 @@ namespace QgsWms if ( outputFormat != UNKN ) { response.setHeader( "Content-Type", contentType ); - result.save( response.io(), qPrintable( saveFormat ), imageQuality ); + if ( saveFormat == "JPEG" ) + { + result.save( response.io(), qPrintable( saveFormat ), imageQuality ); + } + else + { + result.save( response.io(), qPrintable( saveFormat ) ); + } } else { diff --git a/tests/src/python/test_authmanager_password_ows.py b/tests/src/python/test_authmanager_password_ows.py index 36f11b38d6e..67279924171 100644 --- a/tests/src/python/test_authmanager_password_ows.py +++ b/tests/src/python/test_authmanager_password_ows.py @@ -276,7 +276,7 @@ class TestAuthManager(unittest.TestCase): # Check the we've got a likely PNG image self.assertTrue(self.completed_was_called) - self.assertTrue(os.path.getsize(destination) > 700000, "Image size: %s" % os.path.getsize(destination)) # > 1MB + self.assertTrue(os.path.getsize(destination) > 2000, "Image size: %s" % os.path.getsize(destination)) # > 1MB with open(destination, 'rb') as f: self.assertTrue(b'PNG' in f.read()) # is a PNG