Skip to content
Permalink
Browse files

Respect image orientation and transforms in attachment widget

Fixes #16139

(cherry-picked from 574a65)
  • Loading branch information
nyalldawson committed Feb 25, 2018
1 parent b5ca788 commit f7f34efbe3a5b2f3d0ae1fda36797ce0fd0695d4
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/gui/qgsexternalresourcewidget.cpp
@@ -22,6 +22,7 @@
#include <QGridLayout>
#include <QVariant>
#include <QSettings>
#include <QImageReader>
#ifdef WITH_QTWEBKIT
#include <QWebView>
#endif
@@ -235,7 +236,10 @@ void QgsExternalResourceWidget::loadDocument( const QString &path )

if ( mDocumentViewerContent == Image )
{
QPixmap pm( resolvedPath );
// use an image reader to ensure image orientation and transforms are correctly handled
QImageReader ir( resolvedPath );
ir.setAutoTransform( true );
QPixmap pm = QPixmap::fromImage( ir.read() );
mPixmapLabel->setPixmap( pm );
updateDocumentViewer();
}

0 comments on commit f7f34ef

Please sign in to comment.
You can’t perform that action at this time.