mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Merge pull request #6038 from rldhont/server-qgis3-imagequality
[BUGFIX][Server] imageQuality has to be used for JPEG images not PNG
This commit is contained in:
commit
0a17c370f7
@ -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 @@ 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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user