Skip to content

Commit

Permalink
[layouts] Respect image rotation exif flags
Browse files Browse the repository at this point in the history
Fixes #38611
  • Loading branch information
nyalldawson committed Sep 27, 2021
1 parent efb9971 commit 6c236a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/layout/qgslayoutitempicture.cpp
Expand Up @@ -384,6 +384,7 @@ void QgsLayoutItemPicture::loadRemotePicture( const QString &url )
if ( reply )
{
QImageReader imageReader( reply );
imageReader.setAutoTransform( true );

if ( imageReader.format() == "pdf" )
{
Expand Down Expand Up @@ -449,6 +450,7 @@ void QgsLayoutItemPicture::loadLocalPicture( const QString &path )
{
//try to open raster with QImageReader
QImageReader imageReader( pic.fileName() );
imageReader.setAutoTransform( true );

if ( imageReader.format() == "pdf" )
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsimagecache.cpp
Expand Up @@ -200,6 +200,7 @@ QImage QgsImageCache::renderImage( const QString &path, QSize size, const bool k
if ( !path.startsWith( QLatin1String( "base64:" ) ) && QFile::exists( path ) )
{
QImageReader reader( path );
reader.setAutoTransform( true );

if ( reader.format() == "pdf" )
{
Expand Down Expand Up @@ -278,6 +279,7 @@ QImage QgsImageCache::renderImage( const QString &path, QSize size, const bool k
buffer.open( QIODevice::ReadOnly );

QImageReader reader( &buffer );
reader.setAutoTransform( true );

if ( reader.format() == "pdf" )
{
Expand Down

0 comments on commit 6c236a2

Please sign in to comment.