Bug report #10361

GetMap - Add an option to configure JPEG compression per layer

Added by Michael Douchin over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Marco Hugentobler
Category:QGIS Server
Affected QGIS version:2.2.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18780

Description

I have some people giving feedback about the current JPEG compression. Many
users think the "FORMAT=image/jpeg" parameters in the GetMap requests
produce poor quality images, which prevents them from using this option.

I guess the "80%" rate is used. I think it could be enough to increase it
to 90 to produce better looking images (I personaly create my pyramid with
this option with gdal), or better to leave the choice when installing QGIS
Server by using a config parameter.

The best would be to be able to configure this per layer, such as
FORMAT=image/jpeg; compression:90

Any feedback welcome

History

#1 Updated by Michael Douchin over 6 years ago

  • Assignee set to Marco Hugentobler

I copy here Marco's answer (in qgis-dev mailing list)

  • At the moment, the compression rate is left to the Qt library both for png and jpeg (-1 is given to QImage::save). I agree it will be usefull to change from client or from project.
  • The problem here is that there has to be a new parameter for each compression rate. It might be better to have the possibility to configure the image quality in the project or by giving an optional parameter for the image quality (0-100 as the Qt parameter). So if the parameter is not there, the project setting is used. And if the setting is not set, -1 is used as it is now.

#2 Updated by Michael Douchin over 6 years ago

I have almost finished implementing a project WMS capabilities option called "imageQuality". I will send a pull request probably tomorrow to continue the discussion on this feature and ask for a code review

#3 Updated by Michael Douchin over 6 years ago

  • % Done changed from 0 to 90

#4 Updated by René-Luc ReLuc over 6 years ago

The pull request has been merged, could the issue be closed ?

#5 Updated by Giovanni Manghi over 6 years ago

René-Luc ReLuc wrote:

The pull request has been merged, could the issue be closed ?

it works very well!

#6 Updated by Michael Douchin over 6 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF