Skip to content

Commit 0bc3d68

Browse files
committedJan 11, 2018
[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
1 parent 5522f10 commit 0bc3d68

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎src/server/services/wms/qgswmsutils.cpp

Lines changed: 8 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)
Please sign in to comment.