Skip to content

Commit f7f34ef

Browse files
committedFeb 25, 2018
Respect image orientation and transforms in attachment widget
Fixes #16139 (cherry-picked from 574a65)
1 parent b5ca788 commit f7f34ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/gui/qgsexternalresourcewidget.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <QGridLayout>
2323
#include <QVariant>
2424
#include <QSettings>
25+
#include <QImageReader>
2526
#ifdef WITH_QTWEBKIT
2627
#include <QWebView>
2728
#endif
@@ -235,7 +236,10 @@ void QgsExternalResourceWidget::loadDocument( const QString &path )
235236

236237
if ( mDocumentViewerContent == Image )
237238
{
238-
QPixmap pm( resolvedPath );
239+
// use an image reader to ensure image orientation and transforms are correctly handled
240+
QImageReader ir( resolvedPath );
241+
ir.setAutoTransform( true );
242+
QPixmap pm = QPixmap::fromImage( ir.read() );
239243
mPixmapLabel->setPixmap( pm );
240244
updateDocumentViewer();
241245
}

0 commit comments

Comments
 (0)
Please sign in to comment.