Skip to content
Permalink
Browse files

[BUGFIX][Server] imageQuality has to be used for JPEG images not PNG

During the server refactoring, the imageQuality has been applied to all format even if this option has been defined only for JPEG.

This bugfix respects the initial proposition #1403
QGIS Server - new project option imageQuality used for JPEG images #1403
  • Loading branch information
rldhont committed Jan 11, 2018
1 parent 5522f10 commit 0bc3d681621d14f8febbf41c396d7071c7cb24d3
Showing with 9 additions and 2 deletions.
  1. +8 −1 src/server/services/wms/qgswmsutils.cpp
  2. +1 −1 tests/src/python/test_authmanager_password_ows.py
@@ -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
{
@@ -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

0 comments on commit 0bc3d68

Please sign in to comment.
You can’t perform that action at this time.