Bug report #15553

QGIS Server OPACITIES parameter works only when STYLES parameter is default

Added by Tudor Bărăscu about 3 years ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:QGIS Server
Affected QGIS version:2.18.4 Regression?:No
Operating System:Debian Stretch Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:23476

Description

If in the GetMap request the STYLES parameter is empty/default the OPACITIES parameter works at it should.
If the STYLE=whatever_else then the OPACITIES parameter doesn't work.

How to recreate:

- Download test data from https://github.com/tudorbarascu/qgis-server-tutorial-data/archive/master.zip
- Run GetMap request with default style (works)

http://qgisplatform.demo/cgi-bin/qgis_mapserv.fcgi
?MAP=/home/web/projects/world.qgs
&SERVICE=WMS
&VERSION=1.3.0
&REQUEST=GetMap
&BBOX=-432786,4372992,3358959,7513746
&SRS=EPSG:3857
&WIDTH=665
&HEIGHT=551
&FORMAT=image/jpg
&LAYERS=countries
&STYLES=
&OPACITIES=50

The above request outputs:
OPACITIES parameter works

When running the same GetMap request with explicit STYLE, it doesn't work.

http://qgisplatform.demo/cgi-bin/qgis_mapserv.fcgi
?MAP=/home/web/projects/world.qgs
&SERVICE=WMS
&VERSION=1.3.0
&REQUEST=GetMap
&BBOX=-432786,4372992,3358959,7513746
&SRS=EPSG:3857
&WIDTH=665
&HEIGHT=551
&FORMAT=image/jpg
&LAYERS=countries
&STYLES=classified_by_name
&OPACITIES=50

The above request outputs:
OPACITIES parameter ignored

Tested on QGIS Server master, 2.14 and 2.16

1.jpeg - OPACITIES parameter works (47.1 KB) Tudor Bărăscu, 2016-09-10 01:56 AM

2.jpeg - OPACITIES parameter ignored (83.3 KB) Tudor Bărăscu, 2016-09-10 01:56 AM

History

#1 Updated by Jukka Rahkonen about 3 years ago

I am not sure what QGIS does with OPACITIES, but generally speaking JPEG format does not support transparency so I think that you should do all testing with transparency/opacity with png format.

#2 Updated by Tudor Bărăscu about 3 years ago

Good point.
I actually tested with the png format but at some point in testing and testing I mistakenly turned to jpeg.

Same problem nonetheless.

The second image should be the same as the first one, and they're not.

Thanks.

#3 Updated by Jukka Rahkonen about 3 years ago

I wonder how strict the predefined styles are. For example, if opacity is defined in the style, should if still be possible to change it with OPACITIES? If QGIS server supports the GetStyles request, what does it send with 6STYLES=classified_by_name?

#4 Updated by Tudor Bărăscu over 2 years ago

  • Target version changed from Version 2.14 to Version 2.18

The issue is still present in 2.18.4 and 2.14.12

#5 Updated by Giovanni Manghi over 2 years ago

  • Affected QGIS version changed from 2.14.5 to 2.18.4

#6 Updated by Giovanni Manghi over 2 years ago

  • Regression? set to No
  • Easy fix? set to No

#7 Updated by Tudor Bărăscu about 1 year ago

  • Status changed from Open to Closed

This works in QGIS 3 + 3.4 LTR is coming out so I'm closing it!

#8 Updated by Giovanni Manghi about 1 year ago

  • Resolution set to fixed/implemented
  • Description updated (diff)

Also available in: Atom PDF