Feature request #21587

GetPrint doesn't accept jpg format

Added by Nicolas Boisteault over 5 years ago. Updated over 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:QGIS Server
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:29403

Description

Getprint request returns error message "Output format image/jpeg is not supported by the GetPrint request" when setting format to jpg, jpeg or image/jpeg.
We can see here [1] that JPEG has been forgotten in QGIS 3.X.

[1] : https://github.com/qgis/QGIS/blob/master/src/server/services/wms/qgswmsgetprint.cpp#L37

History

#1 Updated by João Gaspar over 5 years ago

I confirm this behaviour in OS Windows.

Seems like missing an extra else if

else if ( format == QgsWmsParameters::JPG )
{
contentType = "application/jpg";
}

But in the other hand, I search in the section of the file qgswmsutils.cpp
and in this file refers to jpeg

Can be related as well?

#2 Updated by Alessandro Pasotti over 5 years ago

  • Tracker changed from Bug report to Feature request

@Joao, is not that easy unfortunately.

#3 Updated by David Marteau over 5 years ago

image/jpeg was not in the available in getprint request since a long time (AMHA it was net even supported in 2.x). May be this was on purpose ?

#4 Updated by Nicolas Boisteault over 5 years ago

@David
Here are different GetPrint with QGIS Server 2.18.28 :

jpg (ok) : https://lizmap.observatoire-environnement.org/lm/index.php/lizmap/service/?repository=smiddest&project=SMIDDEST_CARTO_EN_LIGNE&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetPrint&FORMAT=jpg&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3857&DPI=100&TEMPLATE=Impression&map0:extent=-233930.183541,5552397.96003,-29387.408671,5752318.29931&map0:scale=1155581.108416699&map0:LAYERS=Périmètre%20du%20PAPI%20Estuaire%20de%20la%20Gironde,Bassins%20versants,Perimètre%20du%20SAGE,Masque%20du%20SAGE&map0:STYLES=default,default,default,default&LAYERS=Périmètre%20du%20PAPI%20Estuaire%20de%20la%20Gironde,Bassins%20versants,Perimètre%20du%20SAGE,Masque%20du%20SAGE&STYLES=default,default,default,default&OPACITIES=255,255,255,255

jpeg (nok) : https://lizmap.observatoire-environnement.org/lm/index.php/lizmap/service/?repository=smiddest&project=SMIDDEST_CARTO_EN_LIGNE&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetPrint&FORMAT=jpeg&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3857&DPI=100&TEMPLATE=Impression&map0:extent=-233930.183541,5552397.96003,-29387.408671,5752318.29931&map0:scale=1155581.108416699&map0:LAYERS=Périmètre%20du%20PAPI%20Estuaire%20de%20la%20Gironde,Bassins%20versants,Perimètre%20du%20SAGE,Masque%20du%20SAGE&map0:STYLES=default,default,default,default&LAYERS=Périmètre%20du%20PAPI%20Estuaire%20de%20la%20Gironde,Bassins%20versants,Perimètre%20du%20SAGE,Masque%20du%20SAGE&STYLES=default,default,default,default&OPACITIES=255,255,255,255

image/jpeg (ok) : https://lizmap.observatoire-environnement.org/lm/index.php/lizmap/service/?repository=smiddest&project=SMIDDEST_CARTO_EN_LIGNE&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetPrint&FORMAT=image/jpeg&EXCEPTIONS=application/vnd.ogc.se_inimage&TRANSPARENT=true&SRS=EPSG:3857&DPI=100&TEMPLATE=Impression&map0:extent=-233930.183541,5552397.96003,-29387.408671,5752318.29931&map0:scale=1155581.108416699&map0:LAYERS=Périmètre%20du%20PAPI%20Estuaire%20de%20la%20Gironde,Bassins%20versants,Perimètre%20du%20SAGE,Masque%20du%20SAGE&map0:STYLES=default,default,default,default&LAYERS=Périmètre%20du%20PAPI%20Estuaire%20de%20la%20Gironde,Bassins%20versants,Perimètre%20du%20SAGE,Masque%20du%20SAGE&STYLES=default,default,default,default&OPACITIES=255,255,255,255

Also available in: Atom PDF