Skip to content

Commit

Permalink
limit in either axis.
Browse files Browse the repository at this point in the history
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
roya0045 and nyalldawson committed Jan 18, 2021
1 parent 21d625e commit e953755
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/layout/qgslayoutexporter.cpp
Expand Up @@ -293,8 +293,9 @@ 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" ) );
// see https://doc.qt.io/qt-5/qpainter.html#limitations
if ( width > 32768 || height > 32768 )
QgsMessageLog::logMessage( QObject::tr( "Error: output width or height is larger 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 );
Expand Down

0 comments on commit e953755

Please sign in to comment.