Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Respect image orientation and transforms in attachment widget
Fixes #16139
  • Loading branch information
nyalldawson committed Feb 25, 2018
1 parent 8ef9080 commit 574a654
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/qgsexternalresourcewidget.cpp
Expand Up @@ -22,6 +22,7 @@
#include <QGridLayout>
#include <QVariant>
#include <QSettings>
#include <QImageReader>
#ifdef WITH_QTWEBKIT
#include <QWebView>
#endif
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 574a654

Please sign in to comment.