mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -04:00
Enable LZM compression when saving map as tiff image
This commit is contained in:
parent
c6c00bf6eb
commit
4c88bc54b0
@ -28,6 +28,7 @@
|
||||
#include "qgsvectorlayer.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QImageWriter>
|
||||
#include <QTextStream>
|
||||
#include <QTimeZone>
|
||||
#ifndef QT_NO_PRINTER
|
||||
@ -383,7 +384,13 @@ bool QgsMapRendererTask::run()
|
||||
}
|
||||
else if ( mFileFormat != QLatin1String( "PDF" ) )
|
||||
{
|
||||
const bool success = mImage.save( mFileName, mFileFormat.toLocal8Bit().data() );
|
||||
QImageWriter writer( mFileName, mFileFormat.toLocal8Bit().data() );
|
||||
if ( mFileFormat == QLatin1String( "TIF" ) || mFileFormat == QLatin1String( "TIFF" ) )
|
||||
{
|
||||
// Enable LZW compression
|
||||
writer.setCompression( 1 );
|
||||
}
|
||||
const bool success = writer.write( mImage );
|
||||
if ( !success )
|
||||
{
|
||||
mError = ImageSaveFail;
|
||||
|
Loading…
x
Reference in New Issue
Block a user