Skip to content
Permalink
Browse files

wms provider: add TRANSPARENT parameter when image/x-jpegorpng is cho…

…osen (followup 6604d2f)
  • Loading branch information
jef-n committed Apr 18, 2013
1 parent 151369d commit 01e26da9f5cf7e684d51c7b858ed2d6db4da8369
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/providers/wms/qgswmsprovider.cpp
@@ -657,8 +657,9 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
}

//MH: jpeg does not support transparency and some servers complain if jpg and transparent=true
if ( !mImageMimeType.contains( "jpeg", Qt::CaseInsensitive ) &&
!mImageMimeType.contains( "jpg", Qt::CaseInsensitive ) )
if ( mImageMimeType == "image/x-jpegorpng" ||
( !mImageMimeType.contains( "jpeg", Qt::CaseInsensitive ) &&
!mImageMimeType.contains( "jpg", Qt::CaseInsensitive ) ) )
{
setQueryItem( url, "TRANSPARENT", "TRUE" ); // some servers giving error for 'true' (lowercase)
}
@@ -834,8 +835,9 @@ QImage *QgsWmsProvider::draw( QgsRectangle const &viewExtent, int pixelWidth, i
setQueryItem( url, "FORMAT_OPTIONS", QString( "dpi:%1" ).arg( mDpi ) ); //geoserver
}

if ( !mImageMimeType.contains( "jpeg", Qt::CaseInsensitive ) &&
!mImageMimeType.contains( "jpg", Qt::CaseInsensitive ) )
if ( mImageMimeType == "image/x-jpegorpng" ||
( !mImageMimeType.contains( "jpeg", Qt::CaseInsensitive ) &&
!mImageMimeType.contains( "jpg", Qt::CaseInsensitive ) ) )
{
setQueryItem( url, "TRANSPARENT", "TRUE" ); // some servers giving error for 'true' (lowercase)
}

0 comments on commit 01e26da

Please sign in to comment.
You can’t perform that action at this time.