Skip to content

Commit

Permalink
Merge pull request #5520 from pblottiere/server_bugfix_width_height
Browse files Browse the repository at this point in the history
[server][bugfix] Fixes #17399 WIDTH and HEIGHT parameters are not mandatory for GetPrint
  • Loading branch information
pblottiere committed Nov 10, 2017
2 parents ecacb3b + 2a7f23f commit 67f8465
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -292,7 +292,7 @@ namespace QgsWms
QList<QgsWmsParametersLayer> params = mWmsParameters.layersParameters();

// create the output image
std::unique_ptr<QImage> image( createImage() );
std::unique_ptr<QImage> image( new QImage() );

// configure map settings (background, DPI, ...)
QgsMapSettings mapSettings;
Expand Down
40 changes: 0 additions & 40 deletions tests/src/python/test_qgsserver_wms.py
Expand Up @@ -1189,8 +1189,6 @@ def test_wms_getprint_basic(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1206,8 +1204,6 @@ def test_wms_getprint_basic(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1224,8 +1220,6 @@ def test_wms_getprint_basic(self):
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1243,8 +1237,6 @@ def test_wms_getprint_style(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country_Labels",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1263,8 +1255,6 @@ def test_wms_getprint_style(self):
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country_Labels",
"map0:STYLES": "custom",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1281,8 +1271,6 @@ def test_wms_getprint_style(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"LAYERS": "Country_Labels",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1300,8 +1288,6 @@ def test_wms_getprint_style(self):
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"LAYERS": "Country_Labels",
"STYLES": "custom",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1319,8 +1305,6 @@ def test_wms_getprint_style(self):
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country_Labels",
"LAYERS": "Country_Labels",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1339,8 +1323,6 @@ def test_wms_getprint_style(self):
"map0:LAYERS": "Country_Labels",
"map0:STYLES": "custom",
"LAYERS": "Country_Labels",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1357,8 +1339,6 @@ def test_wms_getprint_legend(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1375,8 +1355,6 @@ def test_wms_getprint_srs(self):
"FORMAT": "png",
"map0:EXTENT": "-309.015,-133.011,312.179,133.949",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:4326"
}.items())])

Expand All @@ -1394,8 +1372,6 @@ def test_wms_getprint_scale(self):
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"map0:SCALE": "36293562",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1414,8 +1390,6 @@ def test_wms_getprint_grid(self):
"map0:LAYERS": "Country,Hello",
"map0:GRID_INTERVAL_X": "1000000",
"map0:GRID_INTERVAL_Y": "2000000",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1433,8 +1407,6 @@ def test_wms_getprint_rotation(self):
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"map0:ROTATION": "45",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1451,8 +1423,6 @@ def test_wms_getprint_selection(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"SELECTION": "Country: 4"
}.items())])
Expand All @@ -1470,8 +1440,6 @@ def test_wms_getprint_opacity(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"SELECTION": "Country: 4",
"LAYERS": "Country,Hello",
Expand All @@ -1490,8 +1458,6 @@ def test_wms_getprint_opacity(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"SELECTION": "Country: 4",
"LAYERS": "Country,Hello",
Expand Down Expand Up @@ -1519,8 +1485,6 @@ def test_wms_getprint_highlight(self):
"map0:HIGHLIGHT_LABELCOLOR": "%2300FF0000",
"map0:HIGHLIGHT_LABELBUFFERCOLOR": "%232300FF00",
"map0:HIGHLIGHT_LABELBUFFERSIZE": "1.5",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857"
}.items())])

Expand All @@ -1538,8 +1502,6 @@ def test_wms_getprint_label(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"IDTEXTBOX": "Updated QGIS composer label"
}.items())])
Expand All @@ -1556,8 +1518,6 @@ def test_wms_getprint_label(self):
"FORMAT": "png",
"map0:EXTENT": "-33626185.498,-13032965.185,33978427.737,16020257.031",
"map0:LAYERS": "Country,Hello",
"HEIGHT": "500",
"WIDTH": "500",
"CRS": "EPSG:3857",
"IDTEXTBOX": ""
}.items())])
Expand Down

0 comments on commit 67f8465

Please sign in to comment.