Skip to content

Commit

Permalink
wms provider: add TRANSPARENT parameter when image/x-jpegorpng is cho…
Browse files Browse the repository at this point in the history
…osen (followup 6604d2f)
  • Loading branch information
jef-n committed Apr 18, 2013
1 parent 151369d commit 01e26da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 01e26da

Please sign in to comment.