Skip to content

Commit 0a17c37

Browse files
authored
Merge pull request #6038 from rldhont/server-qgis3-imagequality
[BUGFIX][Server] imageQuality has to be used for JPEG images not PNG
2 parents 90c07ef + 0bc3d68 commit 0a17c37

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/server/services/wms/qgswmsutils.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@ namespace QgsWms
153153
if ( outputFormat != UNKN )
154154
{
155155
response.setHeader( "Content-Type", contentType );
156-
result.save( response.io(), qPrintable( saveFormat ), imageQuality );
156+
if ( saveFormat == "JPEG" )
157+
{
158+
result.save( response.io(), qPrintable( saveFormat ), imageQuality );
159+
}
160+
else
161+
{
162+
result.save( response.io(), qPrintable( saveFormat ) );
163+
}
157164
}
158165
else
159166
{

tests/src/python/test_authmanager_password_ows.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def testValidAuthFileDownload(self):
276276

277277
# Check the we've got a likely PNG image
278278
self.assertTrue(self.completed_was_called)
279-
self.assertTrue(os.path.getsize(destination) > 700000, "Image size: %s" % os.path.getsize(destination)) # > 1MB
279+
self.assertTrue(os.path.getsize(destination) > 2000, "Image size: %s" % os.path.getsize(destination)) # > 1MB
280280
with open(destination, 'rb') as f:
281281
self.assertTrue(b'PNG' in f.read()) # is a PNG
282282

0 commit comments

Comments
 (0)