Skip to content
Permalink
Browse files

homogenize worldfile extensions when exporting map as image (fix #13264)

  • Loading branch information
alexbruy committed May 25, 2016
1 parent e5d8529 commit ed90055e1903afdb51e736a68e37309aa6d30c77
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/qgsmapcanvas.cpp
@@ -891,8 +891,10 @@ void QgsMapCanvas::saveAsImage( const QString& theFileName, QPixmap * theQPixmap
//Origin Y (center of top left cell)
myHeader += qgsDoubleToString( myRect.yMaximum() - ( mapUnitsPerPixel() / 2 ) ) + "\r\n";
QFileInfo myInfo = QFileInfo( theFileName );
// allow dotted names
QString myWorldFileName = myInfo.absolutePath() + '/' + myInfo.completeBaseName() + '.' + theFormat + 'w';
// build the world file name
QString outputSuffix = myInfo.suffix();
QString myWorldFileName = myInfo.absolutePath() + '/' + myInfo.baseName() + '.'
+ outputSuffix.at( 0 ) + outputSuffix.at( myInfo.suffix().size() - 1 ) + 'w';
QFile myWorldFile( myWorldFileName );
if ( !myWorldFile.open( QIODevice::WriteOnly ) ) //don't use QIODevice::Text
{

0 comments on commit ed90055

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