Skip to content
Permalink
Browse files

display message on big images

Fixes 41045
  • Loading branch information
roya0045 authored and nyalldawson committed Jan 18, 2021
1 parent 32e5ec0 commit 21d625eccddd522f1651ecd3ed51a832936ac171
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/layout/qgslayoutexporter.cpp
@@ -27,6 +27,7 @@
#include "qgsfeedback.h"
#include "qgslayoutgeopdfexporter.h"
#include "qgslinestring.h"
#include "qgsmessagelog.h"
#include <QImageWriter>
#include <QSize>
#include <QSvgGenerator>
@@ -292,6 +293,8 @@ QImage QgsLayoutExporter::renderRegionToImage( const QRectF &region, QSize image
QImage image( QSize( width, height ), QImage::Format_ARGB32 );
if ( !image.isNull() )
{
if ( ( width * height ) > 32768 )
QgsMessageLog::logMessage( QObject::tr( "Error: output is bigger than 32768 pixel, result will be clipped" ) );
image.setDotsPerMeterX( static_cast< int >( std::round( resolution / 25.4 * 1000 ) ) );
image.setDotsPerMeterY( static_cast< int>( std::round( resolution / 25.4 * 1000 ) ) );
image.fill( Qt::transparent );

0 comments on commit 21d625e

Please sign in to comment.