Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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