Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #6038 from rldhont/server-qgis3-imagequality
[BUGFIX][Server] imageQuality has to be used for JPEG images not PNG
  • Loading branch information
rldhont committed Jan 11, 2018
2 parents 90c07ef + 0bc3d68 commit 0a17c37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/server/services/wms/qgswmsutils.cpp
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_authmanager_password_ows.py
Expand Up @@ -276,7 +276,7 @@ def testValidAuthFileDownload(self):

# 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

Expand Down

0 comments on commit 0a17c37

Please sign in to comment.