Skip to content

Commit

Permalink
Merge branch 'worlfile-ext'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 26, 2016
2 parents 322da8b + ed90055 commit eb275ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -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
{
Expand Down

0 comments on commit eb275ea

Please sign in to comment.