diff --git a/src/server/qgswmsserver.cpp b/src/server/qgswmsserver.cpp index e4a2b391a554..393e02b674b9 100644 --- a/src/server/qgswmsserver.cpp +++ b/src/server/qgswmsserver.cpp @@ -2001,8 +2001,8 @@ QImage* QgsWMSServer::createImage( int width, int height, bool useBbox ) const //Adapt width / height if the aspect ratio does not correspond with the BBOX. //Required by WMS spec. 1.3. - QString version = mParameters.value( QStringLiteral( "VERSION" ), QStringLiteral( "1.3.0" ) ); - if ( useBbox && version != QLatin1String( "1.1.1" ) ) + QString version = mParameters.value( "VERSION", "1.3.0" ); + if ( useBbox && version != "1.1.1" ) { bool bboxOk; QgsRectangle mapExtent = _parseBBOX( mParameters.value( "BBOX" ), bboxOk ); @@ -2012,8 +2012,8 @@ QImage* QgsWMSServer::createImage( int width, int height, bool useBbox ) const crs = QString( "EPSG:4326" ); mapExtent.invert(); } - QgsCoordinateReferenceSystem outputCRS = QgsCoordinateReferenceSystem::fromOgcWmsCrs( crs ); - if ( outputCRS.hasAxisInverted() ) + QgsCoordinateReferenceSystem outputCRS = QgsCRSCache::instance()->crsByOgcWmsCrs( crs ); + if ( outputCRS.axisInverted() ) { mapExtent.invert(); }